# Get currency exchange

## Get Currency Exchange Rate

> The \`exchange\_rates\` endpoint allows you to get the exchange of any currency compared against USD.\
> You need to specify a country ISO code and optionally an amount in USD.\
> If no amount is specified, 1 USD will be assumed.\
> Please find all the country codes in the Countries Specifications section.

```json
{"openapi":"3.0.0","info":{"title":"Currency Exchange API","version":"3.0.0"},"servers":[{"url":"https://api-stg.onekeypayments.com","description":"Staging environment"}],"paths":{"/v3/exchange_rates":{"get":{"summary":"Get Currency Exchange Rate","description":"The `exchange_rates` endpoint allows you to get the exchange of any currency compared against USD.\nYou need to specify a country ISO code and optionally an amount in USD.\nIf no amount is specified, 1 USD will be assumed.\nPlease find all the country codes in the Countries Specifications section.","tags":["Exchange Rates"],"parameters":[{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string","default":"application/json"},"description":"Media type of the body sent to the API."},{"name":"X-Date","in":"header","required":true,"schema":{"type":"string","format":"date-time"},"description":"ISO8601 Datetime with Timezone (e.g., 2023-05-20T15:30:00Z or 2023-05-20T12:30:00-03:00)."},{"name":"X-Login","in":"header","required":true,"schema":{"type":"string"},"description":"Merchant X-Login API Key."},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Bearer token for authentication. Example: 'Bearer your_read_only_key_here'"},{"name":"X-Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Unique idempotency key for ensuring that the same request is not processed more than once."},{"name":"country","in":"query","required":true,"description":"Country ISO code in whose local currency the amount will be converted to. Please find all the country codes in the Countries Specifications section.","schema":{"type":"string"}},{"name":"amount","in":"query","required":false,"description":"Amount to convert in USD. If none is specified, `1` will be assumed.","schema":{"type":"number","format":"float","default":1}}],"responses":{"200":{"description":"Currency exchange correctly returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeRateResponse"}}}},"400":{"description":"The country specified was incorrect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidCountryError"}}}},"401":{"description":"Invalid credentials error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidCredentialsError"}}}}}}}},"components":{"schemas":{"ExchangeRateResponse":{"type":"object","description":"Schema for the successful currency exchange response.","properties":{"fx_rate":{"type":"number","format":"float","description":"Currency exchange rate."},"currency":{"type":"string","description":"Currency used for the conversion."},"converted_amount":{"type":"number","format":"float","description":"Amount resulting from multiplying the amount you sent with the fx_rate."}}},"InvalidCountryError":{"type":"object","description":"Schema for the 'Invalid Country' error response.","properties":{"error":{"type":"string","description":"Description of the error."}}},"InvalidCredentialsError":{"type":"object","description":"Schema for the 'Invalid Credentials' error response.","properties":{"code":{"type":"integer","description":"Error code."},"description":{"type":"string","description":"Description of the error."}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.onekeypayments.com/api-reference/deposits-api/currency-exchange/get-currency-exchange.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
