About batch requests
You can send multiple API requests within one call with Batch service. For example, this could be useful when you need to find a location for a range of addresses or calculate multiple routes / isolines. Geoapify batch requests can contain up to 1000 inputs.
Batch requests are processed asynchronously:
- First, you submit a batch job with an HTTP POST request and specify inputs in the request body. You get the job
idas a result of the request.
- Then request the job results with the job
idwith some interval. We recommend setting at least 60000ms (= 1 minute) time interval for big jobs.
- The response code of the processing job is 202.
- As soon as the job is finished you get response code 200 and the result.
The job result is available for the next 24 hours and can be requested multiple times.
Usage and pricing
Batch requests allow you to process more data at a lower price.
Geoapify provides special plans for Batch requests where API call cost is at least 2 times lower than a single API call. For other pricing plans, all API calls made with the Batch service are counted with a coefficient of 0.5 (2 times cheaper).
Counting usage for batch requests:
- Each input is counted as a one API call
- Setting a job a counted as a one API call
- Each result request is counted as a one API call
For example, when you set a batch job with 1000 inputs and then in 1 minute query and get a result it's counted as:
1000 inputs + 1 job call + 1 result call = 1002 API calls