Using the Batch API

The Batch API is most efficient if you have a a large number of leads to score at a given time. Essentially you construct a CSV of all the leads you want to score and POST it as the body to the following URL:


For example, if we want to score these leads:

1231231231,Infer,CA,Chung Wu,,,
485-787-6512,acme,NY,John Tops,,,Media

Then the POST content is simply the above posted as binary data.

Since the POST content is not form data, please set the Content-Type header to application/octet-stream:

Content-Type: application/octet-stream

Once the leads are saved to a CSV (say leads.csv) then you can post like so:

curl "<formula_id>/batched" \
-u <auth_key>:X \
--data-binary "@leads.csv" \
--header "Content-Type: application/octet-stream"

If you have a lot of data you can gzip the CSV content in order to significantly reduce the request size. If you so so, be sure to set the Content-Encoding header:

Content-Encoding: gzip

And an example curl command would be:

curl "<formula_id>/batched" \
-u <auth_key>:X \
--data-binary "@leads.csv.gz" \
--header "Content-Type: application/octet-stream" \
--header "Content-Encoding: gzip"

Please try not to send more than 1000 companies per batch call, to avoid excessively long HTTP connections.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Powered by Zendesk