{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/usage.json","auth":"required","examples":{"codes":[{"name":"","code":"https://openexchangerates.org/api/usage.json?app_id=YOUR_APP_ID","language":"http"},{"code":"$.get('https://openexchangerates.org/api/usage.json', {app_id: 'YOUR_APP_ID'}, function(data) {\n console.log(data);\n});","language":"javascript","name":"jQuery"}]},"method":"get","params":[{"name":"app_id","type":"string","default":"Required","desc":"Your unique App ID (required)","required":false,"in":"query","ref":"","_id":"566b47ff85fbc81700f89547"},{"name":"prettyprint","type":"boolean","default":"true","desc":"Set 'false' to minify response","required":false,"in":"query","ref":"","_id":"566b438f1766bf0d00e73982"}],"results":{"codes":[{"name":"OK","code":"{\n \"status\": 200,\n \"data\": {\n \"app_id\": \"YOUR_APP_ID\",\n \"status\": \"active\",\n \"plan\": {\n \"name\": \"Enterprise\",\n \"quota\": \"100,000 requests/month\",\n \"update_frequency\": \"30-minute\",\n \"features\": {\n \"base\": true,\n \"symbols\": true,\n \"experimental\": true,\n \"time-series\": true,\n \"convert\": false\n }\n },\n \"usage\": {\n \"requests\": 54524,\n \"requests_quota\": 100000,\n \"requests_remaining\": 45476,\n \"days_elapsed\": 16,\n \"days_remaining\": 14,\n \"daily_average\": 2842\n }\n }\n}","language":"json","status":200},{"status":401,"name":"missing_app_id","code":"{\n \"error\": true,\n \"status\": 401,\n \"message\": \"missing_app_id\",\n \"description\": \"No App ID provided. Please sign up at https://openexchangerates.org/signup, or contact support:::at:::openexchangerates.org.\"\n}","language":"json"},{"code":"{\n \"error\": true,\n \"status\": 401,\n \"message\": \"invalid_app_id\",\n \"description\": \"Invalid App ID - please sign up at https://openexchangerates.org/signup, or contact [email protected]\"\n}","language":"json","status":401,"name":"invalid_app_id"}]},"settings":""},"next":{"description":"","pages":[]},"title":"/usage.json","type":"endpoint","slug":"usage-json","excerpt":"Get basic plan information and usage statistics for an Open Exchange Rates App ID","body":"[block:callout]\n{\n \"type\": \"info\",\n \"body\": \"Requests to `usage.info` do not count towards your usage volume.\"\n}\n[/block]\nIf the App ID you provided is valid, you will receive a JSON response with a `status` value (containing the HTTP code of the response) and a `data` object, containing the following attributes:\n\n* `app_id`: The app ID you provided.\n* `status`: The current status of this app ID (either 'active' or 'access_restricted')\n* `plan`: Plan information for this app ID\n * `name`: The name of the current plan\n * `quota`: The monthly request allowance (formatted string for display)\n * `update_frequency`: The rate at which data refreshes on this plan\n * `features`: The supported features of this plan (`base`, `symbols`, `experimental`, `time-series`, `convert`)\n* `usage`: Usage information for this app ID\n * `requests`: Number of requests made since month start\n * `requests_quota`: Number of requests allowed each month with this plan\n * `requests_remaining`: Number of requests remaining this month\n * `days_elapsed`: Number of days since start of month\n * `days_remaining`: Number of days remaining until next month's start\n * `daily_average`: Average requests per day\n\nNB: If the App ID belongs to an account with unlimited requests, the `usage.requests_quota` and `usage.requests_remaining` values will be `-1`.\n[block:callout]\n{\n \"type\": \"info\",\n \"title\": \"Public Endpoint\",\n \"body\": \"Because this API endpoint is accessible to anybody with any App ID, no personal or sensitive account data is ever returned.\"\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/usage.json', {app_id: 'YOUR_APP_ID'}, function(response) {\\n console.log(\\\"This Open Exchange Rates app ID has made \\\" + response.data.usage.requests + \\\"hits this month.\\\");\\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($api_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\": \"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]","updates":["5cab9758e5ad6302d983b310","60edd19887d47f023c4d2188","6104cb2aaaf06200236c6ece"],"order":6,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"56a48d9521d3d60d000341f4","project":"55312174c68f493900aebb3f","user":"5531215e29603d2300011341","category":{"sync":{"isSync":false,"url":""},"pages":["566b438f1766bf0d00e73981","566b51a3f46dc90d009de82a","566b57f068eba90d009cac72","566b6564461c970d0038bfd9","566b6f17bc5adc0d0096760c","566b7c8a03870a0d008ee7a2","566b81db30cdb417008d217b","56a48d9521d3d60d000341f4"],"title":"API Endpoints","slug":"basic-requests","order":1,"from_sync":false,"reference":true,"_id":"566b431d03b4b20d00d02c3a","version":"55312174c68f493900aebb42","__v":8,"createdAt":"2015-12-11T21:41:49.917Z","project":"55312174c68f493900aebb3f"},"version":{"version":"0.7","version_clean":"0.7.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["55312175c68f493900aebb43","566b431d03b4b20d00d02c3a","566b58f212bc0517005d3068","566b59110506f40d0034f148","566b7cc94d1a4d0d00801c00","566b82d130cdb417008d217d","566b855b4d1a4d0d00801c04","566b856f03870a0d008ee7a7","566c42d2f0a5dc0d009acbab","566c443d85dc790d0062c134"],"_id":"55312174c68f493900aebb42","project":"55312174c68f493900aebb3f","releaseDate":"2015-04-17T15:06:28.598Z","__v":10,"createdAt":"2015-04-17T15:06:28.598Z"},"editedParams":true,"githubsync":"","__v":5,"createdAt":"2016-01-24T08:38:45.584Z","editedParams2":true,"parentDoc":null}
get/usage.json
Get basic plan information and usage statistics for an Open Exchange Rates App ID
Definition
{{ api_url }}{{ page_api_url }}
Parameters
Query Params
app_id:
stringRequired
Your unique App ID (required)
prettyprint:
booleantrue
Set 'false' to minify response