Account API
Users can retrieve their usage statistics via meteoblue account API. The API delivers a paginated JSON. The basic URL has the following form:
http://my.meteoblue.com/account/usage?apikey=DEMOKEY
Parameters
Mandatory Parameters:
Parameter | Description | Example |
---|---|---|
apikey | Your personal API key | &apikey=DEMOKEY |
Optional Parameters:
Parameter | Description | Example | Default |
---|---|---|---|
date_start | Start date of the usage statistics in the form yyyy-mm-dd | &date_start=2018-06-20 | none |
date_end | End date of the usage statistics in the form yyyy-mm-dd | &date_end=2018-09-30 | none |
type | Show usage for a specific datafeed | &type=job_count | none |
per | Pagination: How many entries are displayed per page (min value: 1) | &per=20 | 10 |
page | Pagination: The page to be displayed (min value: 1, max value: the number of pages) | &page=2 | 1 |
Example: http://my.meteoblue.com/account/usage?date_start=2020-01-01&date_end=2020-01-14&apikey=DEMOKEY
Output
The Account-API only supports the JSON-Format. The JSON contains a field data
with an array containing the usage statistics, and a field page
with information about the pagination.
The data
-array contains an entry for each date and datafeed. If you called the basic-day
-package for three different locations on a single day, it will be shown as one entry. If you then call sunmoon
-package on the same day, it will be listed as a separate entry.
An example output might look like this:
{
"data": [
{
"request_count": 96,
"request_date": "2019-09-19",
"request_type": "dataset-query-datapoints"
},
{
"request_count": 2,
"request_date": "2019-09-19",
"request_type": "dataset-query-count"
},
{
"request_count": 61320,
"request_date": "2019-09-18",
"request_type": "dataset-query-datapoints"
},
{
"request_count": 7,
"request_date": "2019-09-18",
"request_type": "dataset-query-count"
},
{
"request_count": 2053423008,
"request_date": "2019-09-17",
"request_type": "dataset-job-datapoints"
},
{
"request_count": 7,
"request_date": "2019-09-17",
"request_type": "dataset-job-count"
}
],
"page": {
"position": {
"current": 1,
"max": 1
},
"data": {
"per": 10,
"total": 6
}
}
}
For each data row, the following attributes are returned:
Variable | Description |
---|---|
request_count | How often this call was accounted on the given date |
request_date | The date when the calls were made |
request_type | The type of the call, ie "basic-day" |
The page
field is divided into two parts: The field page.position
contains the variables "current", "next" and "max". The field page.data
contains the variables "per" and "total".
The following table gives an overview over the page
-field:
Variable | Description |
---|---|
position.current | The current page |
position.next | The date when the call was made. If there is no next page, this field is omitted. |
data.per | How much entries are displayed in the data -array |
data.total | The total amount of data -entries available |