{"__v":4,"_id":"566b438f1766bf0d00e73981","category":{"__v":8,"_id":"566b431d03b4b20d00d02c3a","pages":["566b438f1766bf0d00e73981","566b51a3f46dc90d009de82a","566b57f068eba90d009cac72","566b6564461c970d0038bfd9","566b6f17bc5adc0d0096760c","566b7c8a03870a0d008ee7a2","566b81db30cdb417008d217b","56a48d9521d3d60d000341f4"],"project":"55312174c68f493900aebb3f","version":"55312174c68f493900aebb42","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-11T21:41:49.917Z","from_sync":false,"order":1,"slug":"basic-requests","title":"API Endpoints"},"editedParams":true,"editedParams2":true,"project":"55312174c68f493900aebb3f","user":"5531215e29603d2300011341","version":{"__v":10,"_id":"55312174c68f493900aebb42","project":"55312174c68f493900aebb3f","createdAt":"2015-04-17T15:06:28.598Z","releaseDate":"2015-04-17T15:06:28.598Z","categories":["55312175c68f493900aebb43","566b431d03b4b20d00d02c3a","566b58f212bc0517005d3068","566b59110506f40d0034f148","566b7cc94d1a4d0d00801c00","566b82d130cdb417008d217d","566b855b4d1a4d0d00801c04","566b856f03870a0d008ee7a7","566c42d2f0a5dc0d009acbab","566c443d85dc790d0062c134"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"0.7.0","version":"0.7"},"updates":["571a802deeb4160e002ce980"],"next":{"pages":[],"description":""},"createdAt":"2015-12-11T21:43:43.589Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"","code":"https://openexchangerates.org/api/latest.json?app_id=[[app:app_id]]","language":"http"},{"code":"$.get('https://openexchangerates.org/api/latest.json', {app_id: '[[app:app_id]]'}, function(data) {\n    console.log(data);\n});","language":"javascript","name":"jQuery"}]},"results":{"codes":[{"name":"","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","status":200}]},"settings":"","auth":"never","params":[{"_id":"566b47ff85fbc81700f89547","ref":"","in":"query","required":false,"desc":"Your unique App ID (required)","default":"Required","type":"string","name":"app_id"},{"_id":"566b438f1766bf0d00e73983","ref":"","in":"query","required":false,"desc":"Change base currency (3-letter code, default: USD)","default":"Optional","type":"string","name":"base"},{"_id":"566b438f1766bf0d00e73982","ref":"","in":"query","required":false,"desc":"Limit results to specific currencies (comma-separated list of 3-letter codes)","default":"Optional","type":"string","name":"symbols"}],"url":"/latest.json"},"isReference":false,"order":0,"body":"The `base` property provides the 3-letter currency code to which all the delivered exchange rates are relative. This base currency is also given in the rates object by default (e.g. `\"USD\": 1`).\n\nThe `rates` property is an object (hash/dictionary/associative array) containing all the conversion or exchange rates for all of the available (or requested) currencies, labeled by their international-standard 3-letter currency codes. All the values are relative to 1 unit of the requested `base` currency.\n\nThe `timestamp` property indicates the time (UNIX) that the rates were published. (If you’re using the timestamp value in JavaScript, remember to multiply it by 1000, because JavaScript uses time in milliseconds instead of seconds.)\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Additional Parameters\",\n  \"body\": \"Changing the `base` currency and requesting specific `symbols` are currently available for clients on the Developer, Enterprise and Unlimited plans.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Basic Code Samples\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$.get('https://openexchangerates.org/api/latest.json', {app_id: '[[app:app_id]]'}, function(data) {\\n    console.log(\\\"1 US Dollar equals \\\" + data.rates.GBP + \\\" British Pounds\\\");\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"jQuery\"\n    },\n    {\n      \"code\": \"<?php\\n$app_id = '[[app:app_id]]';\\n$oxr_url = \\\"https://openexchangerates.org/api/latest.json?app_id=\\\" . $app_id;\\n\\n// Open CURL session:\\n$ch = curl_init($oxr_url);\\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\\n\\n// Get the data:\\n$json = curl_exec($ch);\\ncurl_close($ch);\\n\\n// Decode JSON response:\\n$oxr_latest = json_decode($json);\\n\\n// You can now access the rates inside the parsed object, like so:\\nprintf(\\n    \\\"1 %s equals %s GBP at %s\\\",\\n    $oxr_latest->base,\\n    $oxr_latest->rates->GBP,\\n    date('H:i jS F, Y', $oxr_latest->timestamp)\\n);\\n// -> eg. \\\"1 USD equals: 0.656741 GBP at 11:11, 11th December 2015\\\"\\n?>\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"# Required ruby gems:\\nrequire 'json'\\nrequire 'net/http'\\n\\n# Assign app ID and base currency:\\nyour_app_id = #your_app_id\\nbase = \\\"USD\\\"\\n\\n# Build URI with your app ID and base currency:\\nuri = URI(\\\"https://openexchangerates.org/api/latest.json?app_id=#{your_app_id}&base=#{base}\\\")\\n\\n# Submit get request with your URI and parse results as JSON:\\nrates = JSON.parse(Net::HTTP.get(uri))\\n\\n# rates is a hash where exchange rates can be accessed like so:\\n# rates[\\\"rates\\\"][\\\"GBP\\\"]\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"More code samples are on their way! Please get in touch if you'd like to submit a new/improved code sample in your languague or framework.\",\n      \"language\": \"text\",\n      \"name\": \"Others...\"\n    }\n  ]\n}\n[/block]\nTo request rates for a different base currency, please see [Changing Base Currency](doc:changing-base-currency).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Errors\"\n}\n[/block]\nPlease see [API Error Messages](doc:errors) for a list of possible errors.","excerpt":"Get the latest exchange rates available from the Open Exchange Rates API. \n\nThe most simple route in our API, latest.json provides a standard response object containing all the conversion rates for all of the currently available symbols/currencies, labeled by their international-standard 3-letter ISO currency codes.\n\nThe latest rates will always be the most up-to-date data available on your plan.","slug":"latest-json","type":"get","title":"/latest.json"}

get/latest.json

Get the latest exchange rates available from the Open Exchange Rates API. The most simple route in our API, latest.json provides a standard response object containing all the conversion rates for all of the currently available symbols/currencies, labeled by their international-standard 3-letter ISO currency codes. The latest rates will always be the most up-to-date data available on your plan.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

app_id:
stringRequired
Your unique App ID (required)
base:
stringOptional
Change base currency (3-letter code, default: USD)
symbols:
stringOptional
Limit results to specific currencies (comma-separated list of 3-letter codes)

Examples


Result Format


Documentation

The `base` property provides the 3-letter currency code to which all the delivered exchange rates are relative. This base currency is also given in the rates object by default (e.g. `"USD": 1`). The `rates` property is an object (hash/dictionary/associative array) containing all the conversion or exchange rates for all of the available (or requested) currencies, labeled by their international-standard 3-letter currency codes. All the values are relative to 1 unit of the requested `base` currency. The `timestamp` property indicates the time (UNIX) that the rates were published. (If you’re using the timestamp value in JavaScript, remember to multiply it by 1000, because JavaScript uses time in milliseconds instead of seconds.) [block:callout] { "type": "info", "title": "Additional Parameters", "body": "Changing the `base` currency and requesting specific `symbols` are currently available for clients on the Developer, Enterprise and Unlimited plans." } [/block] [block:api-header] { "type": "basic", "title": "Basic Code Samples" } [/block] [block:code] { "codes": [ { "code": "$.get('https://openexchangerates.org/api/latest.json', {app_id: '[[app:app_id]]'}, function(data) {\n console.log(\"1 US Dollar equals \" + data.rates.GBP + \" British Pounds\");\n});", "language": "javascript", "name": "jQuery" }, { "code": "<?php\n$app_id = '[[app:app_id]]';\n$oxr_url = \"https://openexchangerates.org/api/latest.json?app_id=\" . $app_id;\n\n// Open CURL session:\n$ch = curl_init($oxr_url);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n// Get the data:\n$json = curl_exec($ch);\ncurl_close($ch);\n\n// Decode JSON response:\n$oxr_latest = json_decode($json);\n\n// You can now access the rates inside the parsed object, like so:\nprintf(\n \"1 %s equals %s GBP at %s\",\n $oxr_latest->base,\n $oxr_latest->rates->GBP,\n date('H:i jS F, Y', $oxr_latest->timestamp)\n);\n// -> eg. \"1 USD equals: 0.656741 GBP at 11:11, 11th December 2015\"\n?>", "language": "php" }, { "code": "# Required ruby gems:\nrequire 'json'\nrequire 'net/http'\n\n# Assign app ID and base currency:\nyour_app_id = #your_app_id\nbase = \"USD\"\n\n# Build URI with your app ID and base currency:\nuri = URI(\"https://openexchangerates.org/api/latest.json?app_id=#{your_app_id}&base=#{base}\")\n\n# Submit get request with your URI and parse results as JSON:\nrates = JSON.parse(Net::HTTP.get(uri))\n\n# rates is a hash where exchange rates can be accessed like so:\n# rates[\"rates\"][\"GBP\"]", "language": "ruby" }, { "code": "More code samples are on their way! Please get in touch if you'd like to submit a new/improved code sample in your languague or framework.", "language": "text", "name": "Others..." } ] } [/block] To request rates for a different base currency, please see [Changing Base Currency](doc:changing-base-currency). [block:api-header] { "type": "basic", "title": "Errors" } [/block] Please see [API Error Messages](doc:errors) for a list of possible errors.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}