Service version: 2
Last edit: 2022.10.03

What is TomTom's Batch Search API?

Batch Search sends batches of requests to supported endpoints with ease. You can call Batch Search APIs to run either asynchronously or synchronously. The Batch Search service consists of the following endpoints:

Synchronous Batch

Allows the submission of a new batch for synchronous processing.

Asynchronous Batch Submission

Allows the submission of a new batch for asynchronous processing.

Asynchronous Batch Download

Fetches the results of the Asynchronous Batch processing.

Asynchronous API overview

The Asynchronous API is appropriate for processing big volumes of relatively complex search requests. It allows the retrieval of results in a separate call (multiple downloads are possible). The asynchronous API is optimized for reliability and is not expected to run into a timeout. The number of batch items is limited to 10000 for this API.

Data retention period notice

Please be aware that batches processed by an Asynchronous API are available for download for 14 days, after which a request for results download will return a 404 (Not Found) response.

Sequence of Asynchronous API client actions

  1. Client sends a request to the Asynchronous Batch Submission endpoint.
  2. The server will respond with one of the following:
    • HTTP 202 or HTTP 303 (depending on the redirectMode parameter) with the Location header, which points to the Asynchronous Natch Download endpoint.
    • HTTP error (see Asynchronous Batch Submission HTTP status codes).
  3. After getting an HTTP 202 or HTTP 303 response, the client should follow the redirect to the Asynchronous Batch Download endpoint which is a blocking long poll request.
  4. When a client calls the Asynchronous Batch Download endpoint the possible scenarios are:
    • Batch response is calculated before timeout (by default this is 120 seconds it can be changed by using the waitTimeSeconds parameter).
      • The client receives HTTP 200.
      • Batch response is ready and it gets streamed to the client.
    • Batch response is not ready before timeout.
      • The client receives HTTP 202.
      • Batch request is accepted for processing.
      • The client downloads batch results from the URL specified by the Location header (see point 3).

Synchronous API overview

The Synchronous API is recommended for lightweight search requests. When the service receives a request, it will respond as soon as the batch items are calculated and there will be no possibility to retrieve the results later on. The Synchronous API will return a timeout error if the request takes longer than 60 seconds. The number of batch items is limited to 100 for this API.

Sequence of Synchronous API client actions

  1. Client sends a request to the Synchronous Batch endpoint.
  2. The server will respond with one of the following:
    • HTTP 200 Batch processing result: The calculation is finished before timeout and the client downloads results straight away.
    • HTTP 408 Request timeout error: If the request takes longer than 60 seconds and cannot be finished in this timeframe.
    • HTTP another error: See the Synchronous Batch HTTP status codes section.

Supported Search API suite endpoints

A list of Search API suite endpoints supported by the Batch Search API can be found below. For details regarding particular API usage, consult the following respective API documentation pages:

Other API endpoints support

Getting started

  1. To get your API Key, you first need to be registered for the TomTom Developer Portal. If you don't have an account, no worries! Register / Sign in now before continuing.
  2. Once you are registered, go to your Dashboard and locate the API Key that you would like to use (we've created the first one for you, it's called My first API Key).
  3. Read the documentation and start coding.
  4. Consider using the TomTom Maps SDK for Web, for iOS, and for Android.
  5. Check related Blog articles for further information.