openaq.OpenAQ.fetches

OpenAQ.fetches(**kwargs)[source]

Provides data about individual fetch operations that are used to populate data in the platform.

Parameters:
  • order_by (string or list) – order by one or more fields (ex. order_by=[‘timeEnded’, ‘count’]). Default value is ‘country’
  • sort (string) – define the sort order for one or more fields (ex. sort=’desc’)
  • limit (int) – change the number of results returned. Max is 10000. Default is 100.
  • page (int) – paginate through the results. Default is 1.
Returns:

dictionary containing the timeStarted, timeEnded, count, and results

Example:
>>> import openaq
>>> api = openaq.OpenAQ()
>>> status, resp = api.fetches()
>>> resp
{
    "meta": {
        "name": "openaq-api",
        "license":
        "website":
        "page": 1,
        "limit": 100,
        "found": 3,
        "pages": 1
    },
    "results": [
        {
            "count": 0,
            "results": [
                {
                    "message": "New measurements inserted for Mandir Marg: 1",
                    "failures": {},
                    "count": 0,
                    "duration": 0.153,
                    "sourceName": "Mandir Marg"
                },
                {
                    "message": "New measurements inserted for Sao Paulo: 1898",
                    "failures": {},
                    "count": 1898,
                    "duration": 16.918,
                    "sourceName": "Sao Paulo"
                },
                ...
            ],
            "timeStarted": "2016-02-07T15:25:04.603Z",
            "timeEnded": "2016-02-07T15:25:04.793Z",
        }
    ]
}