OpenAQ Providers API

The Providers API from OpenAQ — 2 operation(s) for providers.

OpenAPI Specification

openaq-providers-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: OpenAQ Averages Providers API
  description: '

    OpenAQ is a nonprofit organization providing universal access to air

    quality data to empower a global community of changemakers to solve air

    inequality-the unequal access to clean air.'
  version: 2.0.0
tags:
- name: Providers
paths:
  /v3/providers/{providers_id}:
    get:
      tags:
      - Providers
      summary: OpenAQ Get a provider by ID
      description: Provides a provider by provider ID
      operationId: provider_get_v3_providers__providers_id__get
      security:
      - APIKeyHeader: []
      parameters:
      - name: providers_id
        in: path
        required: true
        schema:
          type: integer
          description: Limit the results to a specific provider by id
          title: Providers Id
        description: Limit the results to a specific provider by id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvidersResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v3/providers:
    get:
      tags:
      - Providers
      summary: OpenAQ Get providers
      description: Provides a list of providers
      operationId: providers_get_v3_providers_get
      security:
      - APIKeyHeader: []
      parameters:
      - name: order_by
        in: query
        required: false
        schema:
          anyOf:
          - $ref: '#/components/schemas/ProvidersSortFields'
          - type: 'null'
          description: The field by which to order results
          examples:
          - order_by=id
          default: id
          title: Order By
        description: The field by which to order results
      - name: sort_order
        in: query
        required: false
        schema:
          anyOf:
          - $ref: '#/components/schemas/SortOrder'
          - type: 'null'
          description: Sort results ascending or descending. Default ASC
          examples:
          - sort=desc
          default: asc
          title: Sort Order
        description: Sort results ascending or descending. Default ASC
      - name: parameters_id
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: integer
          - type: 'null'
          title: Parameters Id
      - name: monitor
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: Is the location considered a reference monitor?
          title: Monitor
        description: Is the location considered a reference monitor?
      - name: iso
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Limit the results to a specific country using ISO 3166-1 alpha-2 code
          examples:
          - US
          title: Iso
        description: Limit the results to a specific country using ISO 3166-1 alpha-2 code
      - name: countries_id
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: integer
          - type: 'null'
          description: Limit the results to a specific country or countries by country ID as a single country ID or a comma delimited list of IDs
          examples:
          - '1'
          - 1,2,3
          title: Countries Id
        description: Limit the results to a specific country or countries by country ID as a single country ID or a comma delimited list of IDs
      - name: bbox
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: geospatial bounding box of Min X, min Y, max X, max Y in WGS 84 coordinates. Up to 4 decimal points of precision, addtional decimal precision will be truncated to 4 decimal points precision e.g. -77.037,38.907,-77.0,39.910
          examples:
          - -77.1200,38.7916,-76.9094,38.9955
          title: Bbox
        description: geospatial bounding box of Min X, min Y, max X, max Y in WGS 84 coordinates. Up to 4 decimal points of precision, addtional decimal precision will be truncated to 4 decimal points precision e.g. -77.037,38.907,-77.0,39.910
      - name: coordinates
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: WGS 84 Coordinate pair in form latitude,longitude. Supports up to 4 decimal points of precision, additional decimal precision will be truncated in the query e.g. 38.9074,-77.0373
          examples:
          - 38.907,-77.037
          title: Coordinates
        description: WGS 84 Coordinate pair in form latitude,longitude. Supports up to 4 decimal points of precision, additional decimal precision will be truncated in the query e.g. 38.9074,-77.0373
      - name: radius
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            maximum: 25000
            exclusiveMinimum: 0
          - type: 'null'
          description: Search radius from coordinates as center in meters. Maximum of 25,000 (25km) defaults to 1000 (1km) e.g. radius=1000
          examples:
          - '1000'
          title: Radius
        description: Search radius from coordinates as center in meters. Maximum of 25,000 (25km) defaults to 1000 (1km) e.g. radius=1000
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          description: "Change the number of results returned.\n        e.g. limit=100 will return up to 100 results"
          examples:
          - '100'
          default: 100
          title: Limit
        description: "Change the number of results returned.\n        e.g. limit=100 will return up to 100 results"
      - name: page
        in: query
        required: false
        schema:
          type: integer
          description: Paginate through results. e.g. page=1 will return first page of results
          examples:
          - '1'
          default: 1
          title: Page
        description: Paginate through results. e.g. page=1 will return first page of results
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvidersResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GeoJSON:
      properties:
        type:
          type: string
          title: Type
        coordinates:
          items: {}
          type: array
          title: Coordinates
          default: []
      type: object
      required:
      - type
      title: GeoJSON
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    Provider:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        sourceName:
          type: string
          title: Sourcename
        exportPrefix:
          type: string
          title: Exportprefix
        datetimeAdded:
          type: string
          format: date-time
          title: Datetimeadded
        datetimeFirst:
          type: string
          format: date-time
          title: Datetimefirst
        datetimeLast:
          type: string
          format: date-time
          title: Datetimelast
        entitiesId:
          type: integer
          title: Entitiesid
        parameters:
          items:
            $ref: '#/components/schemas/ParameterBase'
          type: array
          title: Parameters
        bbox:
          anyOf:
          - $ref: '#/components/schemas/GeoJSON'
          - type: 'null'
      type: object
      required:
      - id
      - name
      - sourceName
      - exportPrefix
      - datetimeAdded
      - datetimeFirst
      - datetimeLast
      - entitiesId
      - parameters
      title: Provider
    ParameterBase:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        units:
          type: string
          title: Units
        displayName:
          anyOf:
          - type: string
          - type: 'null'
          title: Displayname
      type: object
      required:
      - id
      - name
      - units
      title: ParameterBase
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProvidersResponse:
      properties:
        meta:
          allOf:
          - $ref: '#/components/schemas/openaq_api__v3__models__responses__Meta'
          default:
            limit: 100
            name: openaq-api
            page: 1
            website: /
        results:
          items:
            $ref: '#/components/schemas/Provider'
          type: array
          title: Results
      type: object
      required:
      - results
      title: ProvidersResponse
    openaq_api__v3__models__responses__Meta:
      properties:
        name:
          type: string
          title: Name
          default: openaq-api
        website:
          type: string
          title: Website
          default: /
        page:
          type: integer
          title: Page
          default: 1
        limit:
          type: integer
          title: Limit
          default: 100
        found:
          anyOf:
          - type: integer
          - type: string
          - type: 'null'
          title: Found
      type: object
      title: Meta
    ProvidersSortFields:
      type: string
      const: id
      title: ProvidersSortFields
    SortOrder:
      type: string
      enum:
      - asc
      - desc
      title: SortOrder
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key