<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Range Historical Exchange Rates | fxapi Documentation</title>
    <meta name="generator" content="VuePress 1.9.10">
    <link rel="icon" type="image/x-icon" href="https://app.fxapi.com/img/favicon/fxapi.ico">
    <script src="/docs/scripts/scroll-to-hash.js"></script>
    <script defer="defer" data-api="https://fxapi.com/api/event" src="https://fxapi.com/js/form.js"></script>
    <meta name="description" content="">
    <meta name="theme-color" content="#059669">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link href="https://fxapi.com/docs/range" rel="canonical" />
    <link rel="preload" href="/docs/assets/css/0.styles.1e177608.css" as="style"><link rel="preload" href="/docs/assets/js/app.657d1c29.js" as="script"><link rel="preload" href="/docs/assets/js/2.6ad3e565.js" as="script"><link rel="preload" href="/docs/assets/js/1.480c7c06.js" as="script"><link rel="preload" href="/docs/assets/js/35.41dc3949.js" as="script"><link rel="preload" href="/docs/assets/js/22.763ab560.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.02bbe909.js"><link rel="prefetch" href="/docs/assets/js/11.f636680a.js"><link rel="prefetch" href="/docs/assets/js/12.723510a3.js"><link rel="prefetch" href="/docs/assets/js/13.9eb85bc6.js"><link rel="prefetch" href="/docs/assets/js/14.a4df9396.js"><link rel="prefetch" href="/docs/assets/js/15.6ed45353.js"><link rel="prefetch" href="/docs/assets/js/16.a07e0aa9.js"><link rel="prefetch" href="/docs/assets/js/17.bd3e849b.js"><link rel="prefetch" href="/docs/assets/js/18.38e4479e.js"><link rel="prefetch" href="/docs/assets/js/19.8f9ca7b8.js"><link rel="prefetch" href="/docs/assets/js/20.aa60c50e.js"><link rel="prefetch" href="/docs/assets/js/21.0d23901b.js"><link rel="prefetch" href="/docs/assets/js/23.802a3efd.js"><link rel="prefetch" href="/docs/assets/js/24.f69fba30.js"><link rel="prefetch" href="/docs/assets/js/25.14be0e16.js"><link rel="prefetch" href="/docs/assets/js/26.3fa967cf.js"><link rel="prefetch" href="/docs/assets/js/27.d4760ca0.js"><link rel="prefetch" href="/docs/assets/js/28.3585119a.js"><link rel="prefetch" href="/docs/assets/js/29.a606b152.js"><link rel="prefetch" href="/docs/assets/js/3.adfc2293.js"><link rel="prefetch" href="/docs/assets/js/30.9e9c8c28.js"><link rel="prefetch" href="/docs/assets/js/31.464b6907.js"><link rel="prefetch" href="/docs/assets/js/32.9b542a03.js"><link rel="prefetch" href="/docs/assets/js/33.d338fb12.js"><link rel="prefetch" href="/docs/assets/js/34.5174b54d.js"><link rel="prefetch" href="/docs/assets/js/36.6b4fab58.js"><link rel="prefetch" href="/docs/assets/js/37.c2983564.js"><link rel="prefetch" href="/docs/assets/js/38.08b79197.js"><link rel="prefetch" href="/docs/assets/js/4.c6846cca.js"><link rel="prefetch" href="/docs/assets/js/5.35abbe5f.js"><link rel="prefetch" href="/docs/assets/js/6.56285f1a.js"><link rel="prefetch" href="/docs/assets/js/7.0591d375.js"><link rel="prefetch" href="/docs/assets/js/vendors~docsearch.3ae8c029.js">
    <link rel="stylesheet" href="/docs/assets/css/0.styles.1e177608.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><img src="https://app.fxapi.com/img/logo/fxapi.png" alt="fxapi Documentation" class="logo"> <span class="site-name can-hide">fxapi Documentation</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/docs/" class="nav-link">
  Guide
</a></div><div class="nav-item"><a href="/docs/examples/" class="nav-link">
  Examples
</a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/docs/" class="nav-link">
  Guide
</a></div><div class="nav-item"><a href="/docs/examples/" class="nav-link">
  Examples
</a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Guide</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/" aria-current="page" class="sidebar-link">Authentication &amp; API key Information</a></li><li><a href="/docs/status-codes.html" class="sidebar-link">Request Status Codes</a></li><li><a href="/docs/testing.html" class="sidebar-link">Testing</a></li><li><a href="/docs/currency-list.html" class="sidebar-link">Currency List</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>Endpoints</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/status.html" class="sidebar-link">Status Endpoint</a></li><li><a href="/docs/currencies.html" class="sidebar-link">Currencies Endpoint</a></li><li><a href="/docs/latest.html" class="sidebar-link">Latest Exchange Rates</a></li><li><a href="/docs/historical.html" class="sidebar-link">Historical Exchange Rates</a></li><li><a href="/docs/range.html" class="active sidebar-link">Range Historical Exchange Rates</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/range.html#request-parameters" class="sidebar-link">Request Parameters</a></li><li class="sidebar-sub-header"><a href="/docs/range.html#valid-accuracy-time-ranges" class="sidebar-link">Valid Accuracy Time Ranges</a></li><li class="sidebar-sub-header"><a href="/docs/range.html#sample-response" class="sidebar-link">Sample Response</a></li></ul></li><li><a href="/docs/convert.html" class="sidebar-link">Convert Exchange Rates</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="range-historical-exchange-rates"><a href="#range-historical-exchange-rates" class="header-anchor">#</a> Range Historical Exchange Rates</h1> <p>Returns a range of exchange rates. Generally, we provide data going back to 1999.</p> <div class="custom-block tip"><p class="custom-block-title">Switching Accuracy</p> <p>Depending on your subscription plan you can request different accuracies: <code>day</code>, <code>hour</code>, <code>quarter_hour</code>, <code>minute</code></p></div> <p><strong>Request Method:</strong> <code>GET</code><br> <strong>Request URL:</strong> <code>https://api.fxapi.com/v1/range</code></p> <h2 id="request-parameters"><a href="#request-parameters" class="header-anchor">#</a> Request Parameters</h2> <table><thead><tr><th>Parameter</th> <th>Type</th> <th>Mandatory</th> <th>Description</th></tr></thead> <tbody><tr><td><code>apikey</code></td> <td><em>string</em></td> <td><svg width="20px" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" class="h-6 w-6"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg>️</td> <td>Your API Key</td></tr> <tr><td><code>datetime_start</code></td> <td><em>string</em></td> <td><svg width="20px" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" class="h-6 w-6"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg>️</td> <td>Datetime for the start of your requested range (format: 2021-12-31T23:59:59Z / ISO8601 Datetime)</td></tr> <tr><td><code>datetime_end</code></td> <td><em>string</em></td> <td><svg width="20px" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" class="h-6 w-6"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg>️</td> <td>Datetime for the end of your requested range (format: 2021-12-31T23:59:59Z / ISO8601 Datetime)</td></tr> <tr><td><code>accuracy</code></td> <td><em>string</em></td> <td></td> <td>The accuracy you want to receive. <br>Possible Values: <code>day</code>, <code>hour</code>, <code>quarter_hour</code>, <code>minute</code><br>Default: <code>day</code><br> For valid time ranges see below</td></tr> <tr><td><code>base_currency</code></td> <td><em>string</em></td> <td></td> <td>The base currency to which all results are behaving relative to<br>By default all values are based on USD</td></tr> <tr><td><code>currencies</code></td> <td><em>string</em></td> <td></td> <td>A list of comma seperated currency codes which you want to get (EUR,USD,CAD)<br>By default all available currencies will be shown</td></tr></tbody></table> <h2 id="valid-accuracy-time-ranges"><a href="#valid-accuracy-time-ranges" class="header-anchor">#</a> Valid Accuracy Time Ranges</h2> <h4 id="day"><a href="#day" class="header-anchor">#</a> <code>day</code></h4> <ul><li>not more than 366 days back</li></ul> <h4 id="hour"><a href="#hour" class="header-anchor">#</a> <code>hour</code></h4> <ul><li>not more than 7 days between start and end</li> <li>not more than 3 months back</li></ul> <h4 id="quarter-hour"><a href="#quarter-hour" class="header-anchor">#</a> <code>quarter_hour</code></h4> <ul><li>not more than 24 hours between start and end</li> <li>not more than 7 days back</li></ul> <h4 id="minute"><a href="#minute" class="header-anchor">#</a> <code>minute</code></h4> <ul><li>not more than 6 hours between start and end</li> <li>not more than 7 days back</li></ul> <h2 id="sample-response"><a href="#sample-response" class="header-anchor">#</a> Sample Response</h2> <p>The API response comes with an easy-to-read JSON format and contains currency pairs for all supported world currencies.</p> <p>The <code>datetime</code> in each object holds the datetime when the entry was last updated.
Daily accuracy would result in end-of-day values and accuracy of an hour would result in end-of-hour values, and so on.</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;data&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token punctuation">{</span>
            <span class="token property">&quot;datetime&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2022-01-01T23:59:59Z&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;currencies&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">&quot;AED&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token string">&quot;AED&quot;</span><span class="token punctuation">,</span>
                    <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">3.67306</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">&quot;AFN&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token string">&quot;AFN&quot;</span><span class="token punctuation">,</span>
                    <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">91.80254</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">&quot;ALL&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token string">&quot;ALL&quot;</span><span class="token punctuation">,</span>
                    <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">108.22904</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">&quot;AMD&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token string">&quot;AMD&quot;</span><span class="token punctuation">,</span>
                    <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">480.41659</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">&quot;...&quot;</span><span class="token operator">:</span> <span class="token string">&quot;150+ more currencies&quot;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token punctuation">{</span>
            <span class="token property">&quot;datetime&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2022-01-02T23:59:59Z&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;currencies&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">&quot;AED&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token string">&quot;AED&quot;</span><span class="token punctuation">,</span>
                    <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">3.67306</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">&quot;AFN&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token string">&quot;AFN&quot;</span><span class="token punctuation">,</span>
                    <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">91.80254</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">&quot;ALL&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token string">&quot;ALL&quot;</span><span class="token punctuation">,</span>
                    <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">108.22904</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">&quot;AMD&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token string">&quot;AMD&quot;</span><span class="token punctuation">,</span>
                    <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">480.41659</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">&quot;...&quot;</span><span class="token operator">:</span> <span class="token string">&quot;150+ more currencies&quot;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token punctuation">{</span>
            <span class="token property">&quot;datetime&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2022-01-03T23:59:59Z&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;currencies&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                <span class="token property">&quot;AED&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token string">&quot;AED&quot;</span><span class="token punctuation">,</span>
                    <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">3.67306</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">&quot;AFN&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token string">&quot;AFN&quot;</span><span class="token punctuation">,</span>
                    <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">91.80254</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">&quot;ALL&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token string">&quot;ALL&quot;</span><span class="token punctuation">,</span>
                    <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">108.22904</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">&quot;AMD&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
                    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token string">&quot;AMD&quot;</span><span class="token punctuation">,</span>
                    <span class="token property">&quot;value&quot;</span><span class="token operator">:</span> <span class="token number">480.41659</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                <span class="token property">&quot;...&quot;</span><span class="token operator">:</span> <span class="token string">&quot;150+ more currencies&quot;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre></div></div> <footer class="page-edit"><!----> <!----></footer> <!----> </main></div><div class="global-ui"><!----></div></div>
    <script src="/docs/assets/js/app.657d1c29.js" defer></script><script src="/docs/assets/js/2.6ad3e565.js" defer></script><script src="/docs/assets/js/1.480c7c06.js" defer></script><script src="/docs/assets/js/35.41dc3949.js" defer></script><script src="/docs/assets/js/22.763ab560.js" defer></script>
  </body>
</html>