Skip to main content
Large requests run as background jobs. You create a job, the API works through it on its own, and you download the results when it finishes. Three kinds of job work this way, and they share the same status, download, and cancel steps.

Job types

Each job is a batch. Creating one returns a batch id, which you use for everything else.

How a job works

1

Create the job

Send the create request. The API responds with 202 and a batch status that includes the batch id.
2

Wait for it to finish

Check GET /v2/batches/{id} until status is completed or cancelled. The SDKs and the CLI can wait for you.
3

Download the results

Fetch the results from the job’s results endpoint as JSON, NDJSON, or CSV.
The job runs on CompanyEnrich’s side. Your program does not need to stay connected: keep the batch id and come back later.

Run a job from start to finish

The SDK examples on this page assume a client created like this, with your API key in the COMPANYENRICH_API_KEY environment variable:
This example enriches a list of domains in bulk, prints progress while it waits, and saves the results as a CSV file.
A search export follows the same three steps. See Export a large search to CSV and Export a people search to CSV.

Batch status

Creating a job, checking it, and cancelling it all return the same batch status object. status is one of these values: progress counts the requests inside the batch. A bulk enrichment has one request per domain. A search export has one request per page of results, added as each earlier page settles.

Check on a job

Fetch the batch status at any time with the batch id.
The wait helpers poll this endpoint for you until the batch is completed or cancelled. By default they wait as long as it takes. When a wait times out, the job keeps running. Only the waiting stops.

Download results

Each job type has its own results endpoint. All of them take a format of json, ndjson, or csv, and default to json. Things to know about downloads:
  • Order. Records come back in input order for bulk enrichment, and in search result order for exports.
  • You can download early. Each download is a snapshot of the results that have settled so far. A later download can include more.
  • Signed links expire. The resultsUrl in a batch status works without credentials for one hour. After that, use your API key, or get a fresh link from a new status response.
The SDKs wrap the three formats. These methods exist on companies.bulkEnrichment, companies.searchExport, and people.searchExport, in each language’s own naming style: This example reads a finished company search export one record at a time:

Raw results

GET /v2/batches/{id}/results returns the raw outcome of every request in the batch as NDJSON: its index, state, statusCode, response body, any error, and the credits it cost. Use it to see exactly what was charged or why a request failed. The SDKs expose it as rawResults or raw_results on batches, and the CLI as companyenrich batch results <id> --raw.

List your jobs

GET /v2/batches returns your batches, newest first, with the same status and progress as a single batch. It returns 20 per page by default and at most 100.
Pass kind to list one kind of batch, such as company-enrichment. To get the next page, send nextCursor as cursor with the same kind.

Cancel a job

Cancelling stops the remaining work. Results that were already charged stay downloadable.
The status moves to cancelling, then cancelled. Cancelling a batch that has already finished does nothing.

Credits and failures

Jobs use the same prices as the equivalent single requests. The creditsCharged field on the batch status shows what a job has cost so far.
  • Bulk enrichment checks your balance first. It returns 402 unless your balance covers every domain at the enrichment price, including the expansions you asked for. Credits are not reserved, and you are charged as results complete.
  • Exports have no upfront check. An export runs as a series of ordinary search pages. If a page fails, such as with a 402 when your credits run out, the export stops and the records already exported stay downloadable.
  • An export can return fewer records than limit. Results whose record is no longer available are skipped, and a search can simply match fewer records than you asked for.
  • People exports that expand company request 25 people per page, because a page can expand at most 500 unique companies.

Limits

Common questions

Can I download results before a job finishes?

Yes. A download returns the results that have settled so far, and you can download again later for more.

Do I need to keep my program running?

No. The job runs on CompanyEnrich’s side. Save the batch id, then check the status or download the results from any later session.

What happens if I run out of credits partway through?

A bulk enrichment job is refused up front unless your balance covers it. An export stops at the first page it cannot pay for, and everything exported before that stays downloadable.

How do I see which domains failed in a bulk enrichment?

Each result record has a success flag, the statusCode, and an error when the enrichment failed. A domain that could not be enriched comes back as a record with success set to false. The signed resultsUrl works without credentials for one hour. After that, download with your API key, or request the batch status again for a new link.

Should I use a batch request or a bulk job?

For up to 50 domains, a batch enrichment answers in the same request. For more, use a bulk job.

Company Enrichment API

Single, batch, and bulk company enrichment.

Company Search API

The queries a company search export accepts.

People Search API

The queries a people search export accepts.

Credits

How background jobs are charged.