Free Currency Exchange and Forex rates API

Free Currency Exchange and Forex rates API

Free & reliable Currency Exchange and Forex API

Introduction

AnyApi’s Currency Exchange API offers real-time foreign exchange rates, historical data, and currency conversion functionality. exchange rate api allows developers to access and retrieve up-to-date currency exchange rates for various currencies.

Features

  • Currency conversation API: Currency converter API allows you to easily convert a specified amount from one currency to another.
  • Realtime Currency Exchange rates: Currency rate API provides access to real-time currency exchange rates for a wide range of currencies.
  • Free and reliable currency exchange API: Currency API converter is provided for free by AnyAPI, making it accessible to developers of all sizes.

Getting Started

To access the Currency Exchange and Forex rates API , you need to obtain an API key from AnyAPI.io. The API key is used for authentication and should be included in the request URL as a query parameter.

Let’s Try Sign In.

Convert currency into other currency endpoint

Send a GET request to the following URL to Convert currency into other currency

curl --request GET \
  --url 'https://anyapi.io/api/v1/exchange/convert?base=USD&to=EUR&amount=10000&apiKey=YOUR_API_KEY'
{
  "base": "USD",
  "to": "EUR",
  "amount": 100,
  "converted": 88.49,
  "rate": 0.8849,
  "lastUpdate": 1640131200
}

Request parameters

Use the parameters listed below to customize your request. Mandatory parameters are indicated

basestringRequired
Base currency code
tostringRequired
Target currency code
amountnumberRequired
Amount to convert
apiKeystringRequired
Your unique API key, which is required to authenticate your requests.

Response parameters

The API returns its response in a simple, lightweight JSON format.

basestring
The base currency used for the conversion.
tostring
The target currency.
amountnumber
The original amount to be converted.
convertednumber
The converted amount in the target currency.
ratenumber
The exchange rate used for the conversion.
lastUpdatenumber
The timestamp of the last update to the exchange rate data.

Get the most recent exchange rates endpoint

Send a GET request to the following URL to Get the most recent exchange rates

curl --request GET \
  --url 'https://anyapi.io/api/v1/exchange/rates?base=USD&apiKey=YOUR_API_KEY'
{
  "lastUpdate": 1716508800,
  "base": "USD",
  "rates": {
    "EUR": 0.9225,
    "USD": 1,
    "JPY": 157.0849,
    "BGN": 1.8042,
    "CZK": 22.8192,
    "DKK": 6.883,
    "GBP": 0.7864,
    "HUF": 355.3321,
    "PLN": 3.9256,
    "RON": 4.5888,
    "SEK": 10.7002,
    "CHF": 0.9155,
    "ISK": 138.2841,
    "NOK": 10.6045,
    "TRY": 32.2453,
    "AUD": 1.5124,
    "BRL": 5.1404,
    "CAD": 1.3713,
    "CNY": 7.2437,
    "HKD": 7.8118,
    "IDR": 16031.2546,
    "ILS": 3.6717,
    "INR": 83.1218,
    "KRW": 1365.7196,
    "MXN": 16.683,
    "MYR": 4.7115,
    "NZD": 1.6372,
    "PHP": 58.19,
    "SGD": 1.3505,
    "THB": 36.6753,
    "ZAR": 18.4046
  }
}

Request parameters

Use the parameters listed below to customize your request. Mandatory parameters are indicated

basestringOptional
Base currency code
apiKeystringRequired
Your unique API key, which is required to authenticate your requests.

Response parameters

The API returns its response in a simple, lightweight JSON format.

basestring
The base currency used for the conversion.
ratesobject
An object containing the exchange rates for various currencies, with the currency code as the key and the exchange rate as the value.
lastUpdatenumber
The timestamp of the last update to the exchange rate data.

Response and error codes

Whenever you make a request that fails for some reason, an error is returned also in the JSON format. The errors include an error code and description, which you can find in detail below.

Status CodeTypeDetails
200OKThe request was successful.
400Bad RequestThe request was invalid or cannot be otherwise served.
401UnauthorizedAuthentication credentials were missing or incorrect.
422Quota reachedThe request cannot be served due to the application's rate limit having been exhausted for the resource.
404Not FoundThe requested resource could not be found.
429Too Many RequestsThe request cannot be served due to the application's rate limit having been exhausted for the resource.
500Internal Server ErrorSomething went wrong on the server.
503Service UnavailableThe service is temporarily unavailable.