Authentication with an API key is required to access all of the API’s endpoints. You can find your API key by logging in to your account at https://subscriptions.oanda.com, as shown in the screenshot below:
The API allows you to authenticate using an HTTP header or a query parameter, as described in the next section.
If you use HTTP header authentication in conjunction with a query parameter, the header is used and the query parameter is discarded.
Please visit the OANDA Exchange Rates page to sign-up for a free trial.
Add the Authorization header to all requests:
curl -X GET -H "Authorization: Bearer <API_KEY>" "https://web-services.oanda.com/rates/api/v1/currencies.json"
<API_KEY> with your API key. Do not include the angle brackets.
api_key query parameter to all requests:
curl -X GET "https://web-services.oanda.com/rates/api/v1/currencies.json?api_key=<API_KEY>"
<API_KEY> with your API key. Do not include the angle brackets in the
This method is not recommended, as it is insecure. As the API key is within the URL, it may be logged. This method should only be used if the client you use to access the API is unable to set headers.