Skip to content

About

The OpenAQ Python SDK is the official Python client for interacting with OpenAQ API.

The SDK is compatible with Python versions >=3.10. We recommend using it instead of writing API access code by hand, as it has best practices built-in and offers many features to more easily query for data, such as:

  • Comprehensive type annotations - type hinting with inline documentation and enabled better autocomplete in IDEs.
  • Robust API validation - Automatically validates path and query parameters, providing clear, actionable error messages to correct malformed queries.
  • Deserialized response classes - Python objects for attribute access, with options for json and dictionary representations.
  • Automatic rate-limiting and expressive error handling - Graceful error handling and safely manages rate limits.