@cufinder/cufinder-ts
v1.3.1
Published
Typescript SDK for the CUFinder API.
Readme
CUFinder Typescript SDK
A Typescript SDK for the CUFinder API that provides access to all company and person enrichment services.
Table of Contents
Installation
npm i @cufinder/cufinder-tsor
yarn add @cufinder/cufinder-tsor
pnpm add @cufinder/cufinder-tsUsage
import { Cufinder } from '@cufinder/cufinder-ts';
// Initialize the client
const client = new Cufinder('your-api-key-here');
// Initialize with more options
const client = new Cufinder('your-api-key-here', { timeout: 60000 });API Reference
This SDK covers all 20 Cufinder API (v2) endpoints:
- CUF - Company Name to Domain
- LCUF - LinkedIn Company URL Finder
- DTC - Domain to Company Name
- DTE - Company Email Finder
- NTP - Company Phone Finder
- REL - Reverse Email Lookup
- FCL - Company Lookalikes Finder
- ELF - Company Fundraising
- CAR - Company Revenue Finder
- FCC - Company Subsidiaries Finder
- FTS - Company Tech Stack Finder
- EPP - LinkedIn Profile Enrichment
- FWE - LinkedIn Profile Email Finder
- TEP - Person Enrichment
- ENC - Company Enrichment
- CEC - Company Employee Count
- CLO - Company Locations
- CSE - Company Search
- PSE - Person Search
- LBS - Local Business Search (Google Maps Search API)
CUF - Company Name to Domain
Returns the official website URL of a company based on its name.
const result = await client.cuf('cufinder', 'US');
console.log(result);LCUF - LinkedIn Company URL Finder
Finds the official LinkedIn company profile URL from a company name.
const result = await client.lcuf('cufinder');
console.log(result);DTC - Domain to Company Name
Retrieves the registered company name associated with a given website domain.
const result = await client.dtc('cufinder.io');
console.log(result);DTE - Company Email Finder
Returns up to five general or role-based business email addresses for a company.
const result = await client.dte('cufinder.io');
console.log(result);NTP - Company Phone Finder
Returns up to two verified phone numbers for a company.
const result = await client.ntp('apple');
console.log(result);REL - Reverse Email Lookup
Enriches an email address with detailed person and company information.
const result = await client.rel('[email protected]');
console.log(result);FCL - Company Lookalikes Finder
Provides a list of similar companies based on an input company's profile.
const result = await client.fcl('apple');
console.log(result);ELF - Company Fundraising
Returns detailed funding information about a company.
const result = await client.elf('cufinder');
console.log(result);CAR - Company Revenue Finder
Estimates a company's annual revenue based on name.
const result = await client.car('apple');
console.log(result);FCC - Company Subsidiaries Finder
Identifies known subsidiaries of a parent company.
const result = await client.fcc('amazon');
console.log(result);FTS - Company Tech Stack Finder
Detects the technologies a company uses.
const result = await client.fts('cufinder');
console.log(result);EPP - LinkedIn Profile Enrichment
Takes a LinkedIn profile URL and returns enriched person and company data.
const result = await client.epp('linkedin.com/in/iain-mckenzie');
console.log(result);FWE - LinkedIn Profile Email Finder
Extracts a verified business email address from a LinkedIn profile URL.
const result = await client.fwe('linkedin.com/in/iain-mckenzie');
console.log(result);TEP - Person Enrichment
Returns enriched person data based on full name and company name.
const result = await client.tep('iain mckenzie', 'stripe');
console.log(result);ENC - Company Enrichment
Provides a complete company profile from a company name.
const result = await client.enc('cufinder');
console.log(result);CEC - Company Employee Count
Returns an estimated number of employees for a company.
const result = await client.cec('cufinder');
console.log(result);CLO - Company Locations
Returns the known physical office locations of a company.
const result = await client.clo('apple');
console.log(result);CSE - Company Search
Search for companies by keyword, partial name, industry, location, or other filters.
const result = await client.cse({
name: 'cufinder',
country: 'germany',
state: 'hamburg',
city: 'hamburg'
});
console.log(result);PSE - Person Search
Search for people by name, company, job title, location, or other filters.
const result = await client.pse({
full_name: 'iain mckenzie',
company_name: 'stripe'
});
console.log(result);LBS - Local Business Search (Google Maps Search API)
Search for local businesses by location, industry, or name.
const result = await client.lbs({
country: 'united states',
state: 'california',
page: 1
});
console.log(result);Error Handling
The SDK provides comprehensive error handling with custom error types:
import {
CufinderError,
AuthenticationError,
CreditLimitError,
NotFoundError,
PayloadError,
RateLimitError,
ServerError,
NetworkError
} from '@cufinder/cufinder-ts';
try {
const result = await client.cuf('cufinder', 'US');
} catch (error) {
if (error instanceof AuthenticationError) {
// 401 - Invalid API key
console.log('Authentication failed:', error.message);
} else if (error instanceof CreditLimitError) {
// 400 - Not enough credit
console.log('Not enough credit:', error.message);
} else if (error instanceof NotFoundError) {
// 404 - Not found result
console.log('Not found result:', error.message);
} else if (error instanceof PayloadError) {
// 422 - Error in the payload
console.log('Payload error:', error.message, error.details);
} else if (error instanceof RateLimitError) {
// 429 - Rate limit exceeded
console.log('Rate limit exceeded. Retry after:', error.details?.retryAfter);
} else if (error instanceof ServerError) {
// 500, 501, ... - Server errors
console.log('Server error:', error.message, 'Status:', error.statusCode);
} else if (error instanceof NetworkError) {
console.log('Network error:', error.message);
} else {
console.log('Unknown error:', error.message);
}
}Types
The SDK exports comprehensive TypeScript types:
import type {
// Request types
CseParams,
PseParams,
LbsParams,
// Response types
BaseResponse,
ApiResponse,
// Model types
Company,
Person,
LookalikeCompany,
FundraisingInfo,
CompanyLocation,
TepPerson,
CloCompanyLocation
CompanySearchResult,
PersonSearchResult,
LocalBusinessResult,
// Configuration
CufinderClientConfig,
// Error types
CufinderError,
AuthenticationError,
CreditLimitError,
NotFoundError,
PayloadError,
RateLimitError,
ServerError,
NetworkError
} from '@cufinder/cufinder-ts';Support
For support, please open an issue on the GitHub repository.
