Introduction

Service version: 2
Last edit: 2024.01.15

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

Use the following topics to become more acquainted with this API and its endpoints.

How to get a TomTom API Key

How to get a TomTom API Key

When you use our location Service APIs, we need a way to identify that it is your application that is making the request to use the service (API).

The TomTom Knowledge Base

TomTom Knowledge Base

The TomTom Knowledge Base optimizes the retrieval of information via articles, blogs, FAQs, tutorials, and videos for your use and reference.