Skip to content

Get Historical Forex Rates With A Restful API

What are historical forex rates?

Historical forex rates are the exchange rates recorded at previous dates. In order to know how much a currency is worth at any given moment, you need to know what the rate was in the past. For example, the rate of British Pounds to US Dollars on July 8th, 2018.

What is a RESTful API?

REST stands for Representational State Transfer. It’s an architectural style that lets a client interact with a server through standard interactions like GET, PUT, and POST. A RESTful API returns data in well-defined formats such as JSON or XML.

RESTful APIs allow you to access different parts of a website or program when you know how to navigate through it. A good RESTful API has predictable, standard endpoints that allow you to easily access data.

Get Historical Forex Rates With A Restful API

Why should you get historical forex rates with a RESTful API?

If you have an application or website that needs to retrieve currency exchange rates, it makes sense not to write your own code from scratch.

If you want to integrate a historical currency exchange rate into your own system, a RESTful API is the perfect solution because it allows you to programmatically access historical data through web requests.

There are many Forex APIs out there, but we recommend you try out Exchangr.

Exchangr

Get Historical Forex Rates With A Restful API

Exchangr is a REST API that leverages the JSON data format to provide consumers and companies with accurate currency exchange rates and conversions.

Exchangr’s forex API determines cross rates by connecting major currencies, in addition to supporting common currency pairs. They go to great lengths to get accurate data from a range of reliable sources in order to cover even the most minor traded currencies. Here’s a link to previous data coverage. As a result, you can rely on the Exchangr FX API to manage even the most demanding business requirements.

To utilize the Exchangr API, create a free account and get your API key; no credit card is required. You can also use your Google account to sign up.

There is historical data on currency rates available.

You’ve come to the correct spot if you’re seeking for an API to get current and historical pricing. The Exchangr API provides historical data, daily closing rates, and historical currency exchange rates. It’s also a fantastic API for obtaining bitcoin data such as current and historical values. An efficient historical FX API supports more than 164 currencies, including eight cryptos.

By adding a date (format YYYY-MM-DD) to the base URL, you may query the Exchangr API for historical rates.

This endpoint’s URL is https://api.getexchangr.com/historical/DATE, and here’s a sample curl command to retrieve historical USD currency values for 2021-04-26:

$ curl 'https://api.getexchangr.com/historical/2021-04-26?apikey=YOUR_APIKEY'
{
    "date": "2021-04-26",
    "base": "USD",
    "rates": {
        "FJD": "2.033",
        "MXN": "19.8618",
        "STD": "20738.069016",
        "SCR": "14.146",
        "CDF": "1991.5905",
        "BBD": "2.0",
        "HNL": "24.0876",
        "UGX": "3600.499",
        "ZAR": "14.2733",
        "STN": "20.500089"
        }

The difference in currency exchange rates between two dates in the past can also be obtained. This endpoint may be used to check up historical rates in the API between two dates. It’s the most effective way to get time-series data for researching historical currency patterns. It may also be used to plot and track historical exchange rates for certain days, months, or years across time.

You can sign up here to get forex rates with a RESTful API

Related posts:

Tips To Make Foreign Exchange APIs Less Overwhelming


Also published on Medium.

Published inCategory
%d bloggers like this: