Skip to main content
This quickstart calls the Forager REST API from Node.js with the built-in fetch (Node 18 or newer): one person lookup, a small client that handles the failure responses, and an asynchronous work email lookup that you submit, poll and read. No Forager package is needed, and none is published yet, so there is nothing to install.
1

Set your credentials

Create the key on the API page of the Forager Web App and copy the Account ID from My Account. The code reads both from process.env; keep the key out of source files, logs and anything that ships to a browser. See API key authentication.
2

Run your first lookup

A person lookup costs 1 credit and takes a LinkedIn public identifier (the slug after /in/) or a Forager person_id.
first-lookup.mjs
Run it with node first-lookup.mjs. The response is one person record. Trimmed, with fictional values:
Response (illustrative)
Keep id: the phone and personal email lookups take it as person_id.
3

Handle 403, 429 and running out of credits

resp.ok is false for every error. The cases below need different handling, so wrap fetch in a small client:
forager-client.mjs
An empty list on a contact lookup is a result, not an error: the person was found but no number or address is on record.
4

Submit an async work email lookup

The work email lookup answers 202 at once with a job_id, because verifying an address takes longer than a request should wait. Identify the person by name and company domain, or by LinkedIn public identifier.
202 response (illustrative)
5

Poll until the job is terminal

Poll the job result until status is completed or failed. Polling is free. While the job is still running the response carries a Retry-After header that says how long to wait.
Completed job (illustrative)
5 credits are charged only when result is found. To skip polling, send a webhook_url with the submit request and Forager POSTs the result there. For more than a handful of people, use the bulk lookup instead of a loop of single lookups.

Test without spending credits

Stub fetch in your tests so they never reach api-v2.forager.ai. In Node 18 and later, globalThis.fetch can be replaced with a function that returns new Response(JSON.stringify(body), { status, headers }): return a 403 to check the auth error, a 429 then a 200 to check the retry, and a completed job body to check the polling loop.

Next steps

Nightly job postings sync

A complete Node.js script built on this client.

Choose the right endpoint

Match what you have to the endpoint you need, with each call’s credit cost.

Errors and rate limits

Every documented status code and limit.

Python quickstart

The same walkthrough with requests.
Last modified on November 1, 2026