Skip to main content

Bulk requests

Learn how to get multiple symbols, endpoints, or technical indicators with a single API query to improve performance and simplify management

Team avatar
Written by Team
Updated today

A standard API request follows this format:

https://api.twelvedata.com/time_series?symbol=MMM&interval=1day&apikey=

While this approach is effective for single-symbol queries, you may benefit from batching when handling several symbols or endpoints simultaneously. There are two primary ways to make bulk requests: batch requests using query strings and multi-endpoint requests using JSON POST.

Batch request

This type of request is ideal when querying multiple symbols from the same endpoint. Benefits include faster responses compared to individual requests, reduced data traffic, and simplified error handling. Symbols should be separated by a comma, and a colon can be used to specify the exchange if needed.

Method 1: Batch request using query parameters

This method is ideal when retrieving data from a single endpoint for multiple symbols. It supports faster response times, lower data overhead, and simplified error handling.

To use this method, list multiple symbols in the symbol parameter, separated by commas. If a symbol belongs to a specific exchange, use a colon to specify it.

Example:

https://api.twelvedata.com/time_series?symbol=MMM,SBIN:NSE,EUR/USD&interval=1day&apikey=YOUR_API_KEY

This example queries daily time series data for three instruments. Although only one request is made, each symbol consumes one API credit, so this call uses three credits.

Compatible endpoints

This method works with a range of endpoints, including:

  • /time_series

  • /quote

  • /price

  • /exchange_rate

  • /currency_conversion

  • /eod

Note that all symbols in the request must use the same endpoint and parameters.

Method 2: Multi-endpoint request using JSON POST

This method allows you to send multiple distinct requests to different endpoints, symbols, and intervals in a single POST call. It is especially useful when your use case involves diverse data types or timeframes.

How it works

  • Send a JSON POST request to the API

  • The request body consists of key-value pairs:

    • The key is a unique identifier for each sub-request

    • The value is the full API path (excluding domain and API key)

Example request body

{
"request_1": "/time_series?symbol=AAPL&interval=1min",
"request_2": "/quote?symbol=TSLA",
"request_3": "/exchange_rate?symbol=USD/EUR"
}

Only JSON format via POST is supported. Do not attempt this using query string parameters.

Response format

The response will also use a key-value structure. Each key in the response matches the identifier from the request. This allows you to match results precisely, regardless of order.

Example response

{
"request_1": { "status": "ok", "data": { ... } },
"request_2": { "status": "ok", "data": { ... } },
"request_3": { "status": "error", "message": "Invalid symbol" }
}

Errors in one request do not affect the success of others. You will receive individual responses for each, including error messages where applicable.

Credit usage and limitations

  • Each sub-request consumes credits based on the target endpoint

  • Your credit usage is the total sum of all successful and attempted sub-requests

  • The maximum number of concurrent requests depends on your subscription tier

  • If your available credits are exceeded, only a portion of the data will be returned. Remaining requests will be processed asynchronously or dropped, depending on quota availability

More reading

Did this answer your question?