# Batches (Useful) The batch request endpoint allows users to request data for multiple financial instruments, time intervals, and data types simultaneously. This endpoint is useful for efficiently gathering diverse financial data in a single operation, reducing the need for multiple individual requests. Errors in specific requests do not affect the processing of others, and each error is reported separately, enabling easy troubleshooting. ### Request body Only JSON `POST` requests are supported. The request content structure consists of key-value items. The key is a unique request ID. The value is requested url. ### Response The response contains key-value data. The key is a unique request ID. The value is returned data. ### API credits - The number of concurrent requests is limited by your subscription plan. - Credits are consumed per requested endpoint, with the total usage equal to the sum of individual requests in the batch. - If the requested data exceeds your available credits, only partial data will be returned asynchronously until your quota is exhausted. - If one or more requests in the batch contain errors (e.g., invalid symbols or unsupported intervals), it will not affect the successful processing of other requests. Errors are reported individually within the response, allowing you to identify and correct specific issues without impacting the entire batch. ## Parameters No parameters are required. ## Response - `code` (integer) HTTP status code - `status` (string) Status of the request - `data` (map (key: string, value: object)) Response data containing individual request results ## Example Request ```bash curl "curl --location 'https://api.twelvedata.com/batch' \ --header 'Content-Type: application/json' \ --header 'Authorization: apikey demo' \ --data @- << EOF { "req_1": { "url": "/time_series?symbol=AAPL&interval=1min&apikey=demo&outputsize=2" }, "req_2": { "url": "/exchange_rate?symbol=USD/JPY&apikey=demo" }, "req_3": { "url": "/currency_conversion?symbol=USD/JPY&amount=122&apikey=demo" } } EOF" ``` ## Example Response ```json { "code": 200, "status": "success", "data": { "req_1": { "response": { "meta": { "currency": "USD", "exchange": "NASDAQ", "exchange_timezone": "America/New_York", "interval": "1min", "mic_code": "XNGS", "symbol": "AAPL", "type": "Common Stock" }, "status": "ok", "values": [ { "close": "248.6", "datetime": "2025-02-21 12:51:00", "high": "248.6", "low": "248.4", "open": "248.5", "volume": "22290" }, { "close": "248.52", "datetime": "2025-02-21 12:50:00", "high": "248.59", "low": "248.43", "open": "248.52", "volume": "64085" } ] }, "status": "success" }, "req_2": { "response": { "rate": 149.25999, "symbol": "USD/JPY", "timestamp": 1740160260 }, "status": "success" }, "req_3": { "response": { "amount": 18209.71933, "rate": 149.25999, "symbol": "USD/JPY", "timestamp": 1740160260 }, "status": "success" } } } ```