Retrieve historical exchange rates for a specific duration of a currency pair with the Currency Time Series Data API. Analyze currency pair trends over time. Whether you're a financial analyst, a developer, or a business owner, this API empowers you to analyze currency trends, compare historical data, and make informed decisions based on reliable exchange rate information. With the ability to specify custom date ranges, select base currencies, and retrieve data for multiple currencies in a single request, our API provides you with the flexibility and precision needed for detailed financial analysis and forecasting.
Access detailed historical exchange rates for specific currency pairs over a custom time range. Whether you're analyzing market trends, evaluating past performance, or forecasting future movements, our API provides you with precise and reliable data for informed decision-making
Retrieve exchange rates for multiple currencies in one request. Focus on the currencies that matter most to you, without any unnecessary data, enabling efficient and relevant analysis.
Analyze historical currency trends by selecting exact start and end dates. Whether you're tracking short-term fluctuations or long-term trends, our API offers flexibility in retrieving data for the precise duration you need.
$ pip install requests
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
startDate | Yes | String | Start date (format YYYY-MM-DD) of the preferred time frame | |
endDate | No | String | Day before current date | End date (format YYYY-MM-DD) of the preferred time frame |
base | No | String | USD | Base currency |
symbols | No | Array | comma separated list of desired currencies/ commodities symbols |
Field | Type | Requirement | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
startDate | String | Mandatory | It is the starting date of interval. It is provided via input. | ||||||||||||
endDate | String | Mandatory | It is the ending date of interval. It is provided via input. | ||||||||||||
base | String | Mandatory | It is the base currency with respect to which all rates will be calculated. It can be provided via input. | ||||||||||||
historicaRatesList | Array | Mandatory | It is list of all rates of interval required for user. It's individual object will contain following fields:
|
HTTP Status | Reasons |
---|---|
400 | Starting date cannot be after current date or ending date. |
400 | Provided Dates are in Invalid Format. Dates must be in a valid format YYYY-MM-DD! |
404 | Rates of provided base and symbols are not found for given intervals. |
Pass the startDate and endDate query parameters to get the exchange rates between two dates. End date if not provided will be equal to the day before the current date. The default base currency is USD. Provide the currencies whose fluctuation rate is to be found in the symbols query parameter. The response will contain exchange rate data for each date in ascending order.
# get euro to usd exchange rate history between startDate and endDate# Response { "startDate": "2022-06-01", "endDate": "2022-06-07", "base": "EUR", "historicalRatesList": [ { "date": "2022-06-01", "rates": { "PKR": "210.58073648790247", "USD": "1.0651300000000001" } }, { "date": "2022-06-02", "rates": { "PKR": "212.41441993262268", "USD": "1.07504" } }, { "date": "2022-06-03", "rates": { "PKR": "211.80743999999882", "USD": "1.0719" } }, { "date": "2022-06-04", "rates": { "PKR": "212.3705498572507", "USD": "1.0719" } }, { "date": "2022-06-05", "rates": { "PKR": "212.49419555477172", "USD": "1.0725240781655547" } }, { "date": "2022-06-06", "rates": { "PKR": "213.19503849443953", "USD": "1.06928999144568" } }, { "date": "2022-06-07", "rates": { "PKR": "215.71624763798502", "USD": "1.0696700000000001" } } ] }$ curl 'https://api.apifreaks.com/v1.0/currency/time-series?apikey=API-KEY&startDate=2022-06-01&endDate=2022-06-07&base=eur&symbols=pkr,usd'
To use the Currency Time Series API, API credits are required. Charges are applied only for successful queries, indicated by a 2xx status code. If a request results in a 4xx or 5xx status code, no credits will be deducted, and any credits already charged will be promptly refunded.
For each successful request, 3 credits will be charged to access currency time-series data. Utilize the Credits Usage API to efficiently monitor your recent consumption of both one-off and subscription credits. This API provides a streamlined way to track and manage your credit usage, ensuring you stay informed about your remaining balance and can optimize your resource allocation effectively.