openaq.OpenAQ.sources

OpenAQ.sources(**kwargs)[source]

Provides a list of data sources.

Parameters:
  • order_by (string or list) – order by one or more fields (ex. order_by=[‘active’, ‘country’]). Default value is ‘country’
  • sort (string) – define the sort order for one or more fields (ex. sort=’desc’)
  • limit (number) – Change the number of results returned.
  • page (number) – Paginate through the results
  • df (bool) – return the results as a pandas DataFrame
  • index (string) – if returning as a DataFrame, set index to (‘utc’, ‘local’, None). The default is local
Returns:

a dictionary containing the url, adapter, name, city, country, description, resolution, sourceURL, contacts, and active.

Example:
>>> import openaq
>>> api = openaq.OpenAQ()
>>> status, resp = api.sources()
>>> resp['results']
[
    {
        "url": "http://airquality.environment.nsw.gov.au/aquisnetnswphp/getPage.php?reportid=2",
        "adapter": "nsw",
        "name": "Australia - New South Wales",
        "city": "",
        "country": "AU",
        "description": "Measurements from the Office of Environment & Heritage of the New South Wales government.",
        "resolution": "1 hr",
        "sourceURL": "http://www.environment.nsw.gov.au/AQMS/hourlydata.htm",
        "contacts": [
            "olaf@developmentseed.org"
        ]
    }
    ...
]