Twelve Data Get Currency Conversion
0.5 credits/call
ae_twelvedata_get_currency_conversion
Convert an amount between forex or cryptocurrency currencies using Twelve Data exchange rates, with an optional historical date or time.
0.5 credits/call
Pricing
0.5 credits/call
| Condition | Charge |
|---|---|
| Each call | 0.5 credits/call |
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
dp | integer | No | The number of decimal places for the data | 5 |
date | string | No | If not null, will use exchange rate from a specific date or time. Format `2006-01-02` or `2006-01-02T15:04:05`. Is set in the local exchange time zone, use timezone parameter to specify a specific time zone | — |
amount | number | Yes | Amount of base currency to be converted into quote currency. Supports values in the range from `0` and above | — |
format | enum (JSON | CSV) | No | Value can be `JSON` or `CSV`. Default `JSON` | JSON |
symbol | string | Yes | The currency pair you want to request can be either forex or cryptocurrency. Slash(`/`) delimiter is used. E.g. `EUR/USD` or `BTC/ETH` will be correct | — |
timezone | string | No | Timezone 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> <i>Take note that the IANA Timezone name is case-sensitive</i> | — |
delimiter | string | No | Specify the delimiter used when downloading the `CSV` file. Default semicolon `;` | ; |
Invocation example
Copy the request and explore its response example.
POST
/agent-api/v1/tool/executeX-Api-KeyRequest coderequest.sh
curl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_twelvedata_get_currency_conversion' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"amount": 100,
"symbol": "USD/CNY"
}
}'Response exampleresponse.json
{
"amount": 666.711,
"rate": 6.66711,
"symbol": "USD/CNY",
"timestamp": 1793187060
}
