potarix-enricher
v0.2.0
Published
Typed TypeScript client for the Potarix Enricher API (company-name to website, verified work emails, decision-maker lookup, company email rosters).
Downloads
137
Maintainers
Readme
potarix-enricher (JavaScript / TypeScript)
Typed client for the Potarix Enricher API. Resolve a company name to its website, find verified work emails, recover decision-maker contacts from a domain, turn a LinkedIn URL into an email, scrape a company-wide email roster, or run the whole enricher in one call.
Zero runtime dependencies. Uses the built-in fetch (Node 18+ or the browser).
Install
npm install potarix-enricherAuth
Every call uses a Potarix API key that starts with ptk_live_, sent as a bearer token. Mint one at enricher.potarix.com or headlessly via POST /auth/signup. New accounts get 25 free trial credits.
Quick start
import { PotarixEnricher } from "potarix-enricher";
const client = new PotarixEnricher(process.env.POTARIX_API_KEY!);
// Resolve a company name to its website (2 credits)
const site = await client.findWebsite({
company_name: "Tycho",
context: "company that raised funding",
});
console.log(site.website_url, site.confidence, site.credits_remaining);
// Find a person's verified work email (25 credits on a hit)
const person = await client.findEmailPerson({
first_name: "Jane",
last_name: "Doe",
domain: "acme.com",
});
console.log(person.email, person.email_status, person.source);
// Find a decision-maker by role (25 credits on a hit)
const dm = await client.findEmailDecisionMaker({
decision_maker_category: "ceo",
domain: "acme.com",
});
console.log(dm.name, dm.email, dm.job_title);
// LinkedIn URL to email (10 credits on a hit) — pass the URL directly
const li = await client.findEmailLinkedin("https://www.linkedin.com/in/janedoe");
console.log(li.email);
// Company-wide email roster (flat 25 credits)
const roster = await client.findEmailCompany({ domain: "acme.com" });
console.log(roster.count, roster.emails);
// Everything in one call (cost = sum of the sub-calls that hit)
const all = await client.findAll({
company_name: "Acme Inc",
dm_categories: ["ceo", "sales"],
skip_company_emails: false,
});
console.log(all.website.url, all.decision_makers, all.credits_charged);
// Account
const me = await client.me(); // profile + balance + has_saved_card
const bal = await client.credits(); // just the balance
console.log(me.credits_remaining, bal.total_purchased);Constructor
new PotarixEnricher(apiKey: string, options?: {
baseUrl?: string; // default "https://api.potarix.com/enricher"
timeoutMs?: number; // default 60000
fetch?: typeof fetch; // override for older runtimes (e.g. node-fetch)
})Methods and credit costs
| Method | Endpoint | Credits |
| --- | --- | --- |
| findWebsite(req) | POST /find-website | 2 |
| findEmailPerson(req) | POST /find-email/person | 25 (on hit) |
| findEmailDecisionMaker(req) | POST /find-email/decision-maker | 25 (on hit) |
| findEmailLinkedin(urlOrReq) | POST /find-email/linkedin | 10 (on hit) |
| findEmailCompany(req) | POST /find-email/company | 25 (flat) |
| findAll(req) | POST /find-all | sum of sub-calls |
| me() | GET /me | 0 |
| credits() | GET /credits | 0 |
Whiffed lookups (no result) are not charged. A repeat lookup of the same input by the same caller is served from cache for free (cached: true).
Errors
Non-2xx responses throw a PotarixEnricherError with .status (HTTP code) and .body (parsed response). Common cases: 401 (bad key), 402 (insufficient credits), 404 (no email found, on the find-email endpoints).
import { PotarixEnricher, PotarixEnricherError } from "potarix-enricher";
try {
await client.findEmailPerson({ full_name: "Jane Doe", domain: "acme.com" });
} catch (err) {
if (err instanceof PotarixEnricherError) {
if (err.status === 404) console.log("No email found");
else if (err.status === 402) console.log("Out of credits");
else throw err;
}
}License
MIT
