Twelve Data Get Time Series Mid Price

0.5 credits/call
ae_twelvedata_get_time_series_mid_price

Use Twelve Data to calculate a smoothed mid-price series by averaging an instrument’s highs and lows over a selected period.

Crypto
0.5 credits/call

Pricing

0.5 credits/call
ConditionCharge
Each call0.5 credits/call

Parameters

Optional parameters use the platform defaults when omitted.

ParameterTypeRequiredDescriptionDefault
dpintegerNoSpecifies the number of decimal places for floating values. Should be in range [0, 11] inclusive. By default, the number of decimal places is automatically determined based on the values provided-1
datestringNoSpecifies the exact date to get the data for. Could be the exact date, e.g. `2021-10-27`, or in human language `today` or `yesterday`—
isinstringConditionalISIN of the instrument. Use a real non-empty identifier; if this instrument is unavailable by ISIN, resolve its ticker symbol first.—
typeenum (American Depositary Receipt | Bond | Bond Fund | Closed-end Fund | Common Stock | Depositary Receipt | Digital Currency | ETF | Exchange-Traded Note | Global Depositary Receipt | Limited Partnership | Mutual Fund | Physical Currency | Preferred Stock | REIT | Right | Structured Product | Trust | Unit | Warrant)NoThe asset class to which the instrument belongs—
cusipstringConditionalCUSIP of the instrument. Use a real non-empty identifier; if this instrument is unavailable by CUSIP, resolve its ticker symbol first.—
orderenum (asc | desc)NoSorting order of the outputdesc
adjustenum (all | splits | dividends | none)NoAdjusting mode for pricessplits
formatenum (JSON | CSV)NoThe format of the response dataJSON
symbolstringConditionalTicker symbol of the instrument, for example AAPL, EUR/USD or ETH/BTC. Use a real non-empty symbol; a supported ISIN or CUSIP may be used instead when this endpoint accepts it.—
countrystringNoThe country where the instrument is traded, e.g., `United States` or `US`—
end_datestringNoThe ending date and time for data selection, see `start_date` description for details.—
exchangestringNoExchange where instrument is traded—
intervalenum (1min | 5min | 15min | 30min | 45min | 1h | 2h | 4h | 8h | 1day | 1week | 1month)YesInterval between two consecutive points in time series—
mic_codestringNoMarket Identifier Code (MIC) under ISO 10383 standard—
timezonestringNoTimezone at which output datetime will be displayed. Supports: <ul> <li>1. <code>Exchange</code> for local exchange time</li> <li>2. <code>UTC</code> for datetime at universal UTC standard</li> <li>3. Timezone name according to the IANA Time Zone Database. E.g. <code>America/New_York</code>, <code>Asia/Singapore</code>. Full list of timezones can be found <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones" target="blank">here</a></li> </ul> <p>Interval Limitation: The timezone parameter is only applicable for intraday intervals (less than 1 day). For intervals of 1day, 1week, or 1month, the timezone parameter is ignored, and data is strictly returned in the Exchange local time.</p> <i>Take note that the IANA Timezone name is case-sensitive</i>Exchange
delimiterstringNoThe separator used in the CSV response data;
outputsizeintegerNoNumber of data points to retrieve. Supports values in the range from `1` to `5000`. Default `30` when no date parameters are set, otherwise set to maximum30
start_datestringNoCan be used separately and together with `end_date`. Format `2006-01-02` or `2006-01-02T15:04:05` Default location: <ul> <li>Forex and Cryptocurrencies - <code>UTC</code></li> <li>Stocks - where exchange is located (e.g. for AAPL it will be <code>America/New_York</code>)</li> </ul> Both parameters take into account if <code>timezone</code> parameter is provided.<br/> If <code>timezone</code> is given then, `start_date` and `end_date` will be used in the specified location Examples: <ul> <li>1. <code>&symbol=AAPL&start_date=2019-08-09T15:50:00&…</code><br/> Returns all records starting from 2019-08-09T15:50:00 New York time up to current date</li> <li>2. <code>&symbol=EUR/USD&timezone=Asia/Singapore&start_date=2019-08-09T15:50:00&…</code><br/> Returns all records starting from 2019-08-09T15:50:00 Singapore time up to current date</li> <li>3. <code>&symbol=ETH/BTC&timezone=Europe/Zurich&start_date=2019-08-09T15:50:00&end_date=2019-08-09T15:55:00&...</code><br/> Returns all records starting from 2019-08-09T15:50:00 Zurich time up to current date</li> </ul>—
time_periodintegerNoNumber of periods to average over. Takes values in the range from `1` to `800`9
include_ohlcbooleanNoSpecify if OHLC values should be added in the outputfalse
previous_closebooleanNoA boolean parameter to include the previous closing price in the time_series data. If true, adds previous bar close price value to the current objectfalse

Invocation example

Copy the request and explore its response example.

POST/agent-api/v1/tool/executeX-Api-Key
Request coderequest.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_twelvedata_get_time_series_mid_price' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "exchange": "NASDAQ",
    "interval": "1min",
    "symbol": "AAPL"
  }
}'
Response exampleresponse.json
JSONPartial content
{
  "meta": {
    "currency": "USD",
    "exchange": "NASDAQ",
    "exchange_timezone": "America/New_York",
    "indicator": {
      "name": "MIDPRICE - Midpoint Price over period",
      "time_period": 9
    },
    "interval": "1min",
    "type": "Common Stock"
  },
  "status": "ok",
  "values": [
    {
      "datetime": "2026-09-22 15:59:00",
      "midprice": "339.69499"
    }
  ]
}

This example shows part of the response. Copied content is valid JSON.