{"__v":1,"_id":"56a48d9521d3d60d000341f4","category":{"__v":8,"_id":"566b431d03b4b20d00d02c3a","pages":["566b438f1766bf0d00e73981","566b51a3f46dc90d009de82a","566b57f068eba90d009cac72","566b6564461c970d0038bfd9","566b6f17bc5adc0d0096760c","566b7c8a03870a0d008ee7a2","566b81db30cdb417008d217b","56a48d9521d3d60d000341f4"],"project":"55312174c68f493900aebb3f","version":"55312174c68f493900aebb42","sync":{"url":"","isSync":false},"reference":true,"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":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-24T08:38:45.584Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"http","code":"https://openexchangerates.org/api/usage.json?app_id=[[app:app_id]]","name":""},{"name":"jQuery","language":"javascript","code":"$.get('https://openexchangerates.org/api/usage.json', {app_id: '[[app:app_id]]'}, function(data) {\n    console.log(data);\n});"}]},"results":{"codes":[{"status":200,"language":"json","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}","name":"OK"},{"name":"missing_app_id","status":401,"language":"json","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}"},{"name":"invalid_app_id","status":401,"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 support@openexchangerates.org.\"\n}"}]},"settings":"","auth":"required","params":[{"_id":"566b47ff85fbc81700f89547","ref":"","in":"query","required":false,"desc":"Your unique App ID (required)","default":"Required","type":"string","name":"app_id"},{"_id":"566b438f1766bf0d00e73982","ref":"","in":"query","required":false,"desc":"Set 'false' to minify response","default":"true","type":"boolean","name":"prettyprint"}],"url":"/usage.json"},"isReference":true,"order":999,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Early Beta\",\n  \"body\": \"App ID usage information is available for all clients, and is currently in early beta. The request and response format may change, but will be released as \\\"Stable\\\" in the coming weeks.\\n\\nPlease contact us with any feedback or questions about this feature.\"\n}\n[/block]\n\n[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: For 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: '[[app: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]","excerpt":"Get basic plan information and usage statistics for your App ID","slug":"usage-json","type":"get","title":"/usage.json (beta)"}

get/usage.json (beta)

Get basic plan information and usage statistics for your 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

Examples


Result Format


Documentation

[block:callout] { "type": "warning", "title": "Early Beta", "body": "App ID usage information is available for all clients, and is currently in early beta. The request and response format may change, but will be released as \"Stable\" in the coming weeks.\n\nPlease contact us with any feedback or questions about this feature." } [/block] [block:callout] { "type": "info", "body": "Requests to `usage.info` do not count towards your usage volume." } [/block] If 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: * `app_id`: The app ID you provided. * `status`: The current status of this app ID (either 'active' or 'access_restricted') * `plan`: Plan information for this app ID * `name`: The name of the current plan * `quota`: The monthly request allowance (formatted string for display) * `update_frequency`: The rate at which data refreshes on this plan * `features`: The supported features of this plan (`base`, `symbols`, `experimental`, `time-series`, `convert`) * `usage`: Usage information for this app ID * `requests`: Number of requests made since month start * `requests_quota`: Number of requests allowed each month with this plan * `requests_remaining`: Number of requests remaining this month * `days_elapsed`: Number of days since start of month * `days_remaining`: Number of days remaining until next month's start * `daily_average`: Average requests per day NB: For unlimited requests, the `usage.requests_quota` and `usage.requests_remaining` values will be `-1`. [block:callout] { "type": "info", "title": "Public Endpoint", "body": "Because this API endpoint is accessible to anybody with any App ID, no personal or sensitive account data is ever returned." } [/block] [block:api-header] { "type": "basic", "title": "Basic Code Samples" } [/block] [block:code] { "codes": [ { "code": "$.get('https://openexchangerates.org/api/usage.json', {app_id: '[[app:app_id]]'}, function(response) {\n console.log(\"This Open Exchange Rates app ID has made \" + response.data.usage.requests + \"hits this month.\");\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($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?>", "language": "php" }, { "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]

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 }}