{"__v":8,"_id":"55312175c68f493900aebb45","api":{"auth":"required","params":[],"results":{"codes":[]},"settings":"","url":""},"body":"Exchange rates published through the Open Exchange Rates API are collected from multiple reliable providers, blended together and served up in JSON format for everybody to use. There are no complex queries, confusing authentication methods or long-term contracts.\n\nEnd-of-day rates are available historically for all days going back to 1st January, 1999.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Common Use Cases\"\n}\n[/block]\nData from the Open Exchange Rates API are suitable for use in every framework, language and application, and have been successfully integrated in:\n\n  * Shopping carts from WooCommerce to Shopify, and thousands of individual web stores\n  * Overseas campaigns from the smallest startups to Fortune 500 heavyweights\n  * Accounting departments for multinational brands and shipping/logistics firms\n  * Open source projects and charities\n  * Enterprise-level analytics software\n  * Hundreds of smartphone, tablet and desktop apps\n  * School and university research projects across the world\n\nOur clients range from freelancers and the smallest one-man development shops, to international sports networks and post-IPO startups.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Connecting To The API\"\n}\n[/block]\nWe serve our data in JSON format via a simple URL-based interface over HTTPS, which enables you to use the rates in whichever way you require.\n\nThis is the high-level introduction – for more in-depth guides, please see the relevant Documentation sections.\n\n**Connection Types**\n\nAny language or software that can make HTTP requests or fetch web addresses can access our API (for example, you can visit any of the API routes in your browser to verify they’re working as expected). \n\nFor your integration, you can use whichever library you require. This will vary depending on your development environment. There are guides and  a wide range of open source integrations available, also covered in our documentation.\n\nURLs (routes) are requested once over HTTPS, and deliver all their data in one go, just like a normal web request. \n\nWe do not currently support websockets, webhooks or any other keep-alive or push-notification style connections – in other words, when you want fresh data, you simply request it from our server. We're considering these methods for a future version of our API, so please email us if interested.\n\n**URL Format**\n\nThe API base path is `https://openexchangerates.org/api/`.\n\nAPI routes/endpoints are then appended to this base path, like so:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://openexchangerates.org/api/\\n                                  latest.json\\n                                  currencies.json\\n                                  historical/2013-02-16.json\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\nQuery parameters (such as your App ID, requested base currency, or JSONP callback) are appended as GET request parameters, for example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://openexchangerates.org/api/latest.json\\n                                             ?app_id=YOUR_APP_ID\\n                                             &base=GBP\\n                                             &callback=someCallbackFunction\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\nIf your request is valid and permitted, you will receive a JSON-formatted response to work with. If something is wrong with the request, you will receive an error message.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"API Response Formats\"\n}\n[/block]\nResponses are delivered over HTTPS as plain-text JSON (**J**ava**S**cript **O**bject **N**otation) format, ready to be used however your integration requires.\n\nThis format doesn't limit how and where you can use the data in any way: JSON is simply a fast, simple and lightweight delivery mechanism, which is supported in every major language and framework.\n\nWe designed these responses to be simple to integrate into a variety of apps and software. If needed, you can also programmatically convert JSON data to CSV/spreadsheet format, or any other format.\n\nThere are several main response styles/formats: latest/historical rates, currencies list, time-series and currency conversion. These are detailed individually on each relevant documentation page, and you can see an example (for `latest.json`) below.\n\nHere's an example basic API request for all the latest rates, relative to USD (default):\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://openexchangerates.org/api/latest.json?app_id=YOUR_APP_ID\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\nWhen requesting this URL (assuming your App ID is valid) you will receive a JSON object containing a UNIX timestamp (UTC seconds), base currency (3-letter ISO code), and a rates object with symbol:value pairs, relative to the requested base currency:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    disclaimer: \\\"https://openexchangerates.org/terms/\\\",\\n    license: \\\"https://openexchangerates.org/license/\\\",\\n    timestamp: 1449877801,\\n    base: \\\"USD\\\",\\n    rates: {\\n        AED: 3.672538,\\n        AFN: 66.809999,\\n        ALL: 125.716501,\\n        AMD: 484.902502,\\n        ANG: 1.788575,\\n        AOA: 135.295998,\\n        ARS: 9.750101,\\n        AUD: 1.390866,\\n        /* ... */\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"JSON - latest.json\"\n    }\n  ]\n}\n[/block]\nThe response format is the same for Historical Data (`historical/YYYY-MM-DD.json`) requests.\n\nOther API routes – i.e. `currencies.json`, `time-series.json` and `convert/` – have a different request and response format. Please see their relevant pages for details and examples.","category":"55312175c68f493900aebb43","createdAt":"2015-04-17T15:06:29.836Z","excerpt":"Open Exchange Rates provides a simple, lightweight and portable JSON API with live and historical foreign exchange (forex) rates, via a simple and easy-to-integrate API, in JSON format. Data are tracked and blended algorithmically from multiple reliable sources, ensuring fair and unbiased consistency.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"project":"55312174c68f493900aebb3f","slug":"api-introduction","sync_unique":"","title":"API Introduction","type":"basic","updates":["56e30913cb6ef20e0084f231","576e09c2fa2f0b0e00dd1239"],"user":"5531215e29603d2300011341","version":"55312174c68f493900aebb42","childrenPages":[]}

API Introduction

Open Exchange Rates provides a simple, lightweight and portable JSON API with live and historical foreign exchange (forex) rates, via a simple and easy-to-integrate API, in JSON format. Data are tracked and blended algorithmically from multiple reliable sources, ensuring fair and unbiased consistency.

Exchange rates published through the Open Exchange Rates API are collected from multiple reliable providers, blended together and served up in JSON format for everybody to use. There are no complex queries, confusing authentication methods or long-term contracts. End-of-day rates are available historically for all days going back to 1st January, 1999. [block:api-header] { "type": "basic", "title": "Common Use Cases" } [/block] Data from the Open Exchange Rates API are suitable for use in every framework, language and application, and have been successfully integrated in: * Shopping carts from WooCommerce to Shopify, and thousands of individual web stores * Overseas campaigns from the smallest startups to Fortune 500 heavyweights * Accounting departments for multinational brands and shipping/logistics firms * Open source projects and charities * Enterprise-level analytics software * Hundreds of smartphone, tablet and desktop apps * School and university research projects across the world Our clients range from freelancers and the smallest one-man development shops, to international sports networks and post-IPO startups. [block:api-header] { "type": "basic", "title": "Connecting To The API" } [/block] We serve our data in JSON format via a simple URL-based interface over HTTPS, which enables you to use the rates in whichever way you require. This is the high-level introduction – for more in-depth guides, please see the relevant Documentation sections. **Connection Types** Any language or software that can make HTTP requests or fetch web addresses can access our API (for example, you can visit any of the API routes in your browser to verify they’re working as expected). For your integration, you can use whichever library you require. This will vary depending on your development environment. There are guides and a wide range of open source integrations available, also covered in our documentation. URLs (routes) are requested once over HTTPS, and deliver all their data in one go, just like a normal web request. We do not currently support websockets, webhooks or any other keep-alive or push-notification style connections – in other words, when you want fresh data, you simply request it from our server. We're considering these methods for a future version of our API, so please email us if interested. **URL Format** The API base path is `https://openexchangerates.org/api/`. API routes/endpoints are then appended to this base path, like so: [block:code] { "codes": [ { "code": "https://openexchangerates.org/api/\n latest.json\n currencies.json\n historical/2013-02-16.json", "language": "http" } ] } [/block] Query parameters (such as your App ID, requested base currency, or JSONP callback) are appended as GET request parameters, for example: [block:code] { "codes": [ { "code": "https://openexchangerates.org/api/latest.json\n ?app_id=YOUR_APP_ID\n &base=GBP\n &callback=someCallbackFunction", "language": "http" } ] } [/block] If your request is valid and permitted, you will receive a JSON-formatted response to work with. If something is wrong with the request, you will receive an error message. [block:api-header] { "type": "basic", "title": "API Response Formats" } [/block] Responses are delivered over HTTPS as plain-text JSON (**J**ava**S**cript **O**bject **N**otation) format, ready to be used however your integration requires. This format doesn't limit how and where you can use the data in any way: JSON is simply a fast, simple and lightweight delivery mechanism, which is supported in every major language and framework. We designed these responses to be simple to integrate into a variety of apps and software. If needed, you can also programmatically convert JSON data to CSV/spreadsheet format, or any other format. There are several main response styles/formats: latest/historical rates, currencies list, time-series and currency conversion. These are detailed individually on each relevant documentation page, and you can see an example (for `latest.json`) below. Here's an example basic API request for all the latest rates, relative to USD (default): [block:code] { "codes": [ { "code": "https://openexchangerates.org/api/latest.json?app_id=YOUR_APP_ID", "language": "http" } ] } [/block] When requesting this URL (assuming your App ID is valid) you will receive a JSON object containing a UNIX timestamp (UTC seconds), base currency (3-letter ISO code), and a rates object with symbol:value pairs, relative to the requested base currency: [block:code] { "codes": [ { "code": "{\n disclaimer: \"https://openexchangerates.org/terms/\",\n license: \"https://openexchangerates.org/license/\",\n timestamp: 1449877801,\n base: \"USD\",\n rates: {\n AED: 3.672538,\n AFN: 66.809999,\n ALL: 125.716501,\n AMD: 484.902502,\n ANG: 1.788575,\n AOA: 135.295998,\n ARS: 9.750101,\n AUD: 1.390866,\n /* ... */\n }\n}", "language": "json", "name": "JSON - latest.json" } ] } [/block] The response format is the same for Historical Data (`historical/YYYY-MM-DD.json`) requests. Other API routes – i.e. `currencies.json`, `time-series.json` and `convert/` – have a different request and response format. Please see their relevant pages for details and examples.