Files
Julien Lengrand-Lambert 6e94cbbad2 Adding OpenAQ
2024-03-07 16:42:19 +01:00

6.0 KiB

OpenAQ - Jetbrains API Client

General API description

OpenAQ API - https://docs.openaq.org

Documentation for API Endpoints

All URIs are relative to https://api.openaq.org, but will link to the .http file that contains the endpoint definition. There may be multiple requests for a single endpoint, one for each example described in the OpenAPI specification.

Class Method HTTP request Description
V1Api citiesGetv1V1CitiesGet GET /v1/cities Get cities
V1Api countriesGetV1CountriesCountryIdGet GET /v1/countries/{country_id} Get country by ID
V1Api countriesGetv1V1CountriesGet GET /v1/countries Get countries
V1Api latestV1GetV1LatestGet GET /v1/latest Get latest measurements
V1Api latestV1GetV1LatestLocationIdGet GET /v1/latest/{location_id} Get latest measurements by location ID
V1Api locationsv1GetV1LocationsGet GET /v1/locations Get locations
V1Api locationsv1GetV1LocationsLocationIdGet GET /v1/locations/{location_id} Get location by ID
V1Api measurementsGetV1V1MeasurementsGet GET /v1/measurements Get a list of measurements
V1Api parametersGetv1V1ParametersGet GET /v1/parameters Get parameters
V1Api sourcesV1GetV1SourcesGet GET /v1/sources Sources
V2Api averagesV2GetV2AveragesGet GET /v2/averages Get averaged values
V2Api citiesGetV2CitiesGet GET /v2/cities Get cities
V2Api countriesGetV2CountriesCountryIdGet GET /v2/countries/{country_id} Get country by ID
V2Api countriesGetV2CountriesGet GET /v2/countries Get countries
V2Api latestGetV2LatestGet GET /v2/latest Get latest measurements
V2Api latestGetV2LatestLocationIdGet GET /v2/latest/{location_id} Get latest measurements by location ID
V2Api locationsGetV2LocationsGet GET /v2/locations Get locations
V2Api locationsGetV2LocationsLocationIdGet GET /v2/locations/{location_id} Get a location by ID
V2Api measurementsGetV2MeasurementsGet GET /v2/measurements Get measurements
V2Api mfrGetV2ManufacturersGet GET /v2/manufacturers Get manufacturers
V2Api modelGetV2ModelsGet GET /v2/models Get models
V2Api parametersGetV2ParametersGet GET /v2/parameters Get parameters
V2Api projectsGetV2ProjectsGet GET /v2/projects Projects
V2Api projectsGetV2ProjectsProjectIdGet GET /v2/projects/{project_id} Project by ID
V2Api readmeGetV2SourcesReadmeSlugGet GET /v2/sources/readme/{slug} Source Readme
V2Api sourcesGetV2SourcesGet GET /v2/sources Sources
V2Api summaryGetV2SummaryGet GET /v2/summary Platform Summary

Usage

Prerequisites

You need IntelliJ to be able to run those queries. More information can be found here. You may have some luck running queries using the Code REST Client as well, but your mileage may vary.

Variables and Environment files

  • Generally speaking, you want queries to be specific using custom variables. All variables in the .http files have the `` format.
  • You can create public or private environment files to dynamically replace the variables at runtime.

Note: don't commit private environment files! They typically will contain sensitive information like API Keys.

Customizations

If you have control over the generation of the files here, there are two main things you can do

  • Select elements to replace as variables during generation. The process is case-sensitive. For example, API_KEY ->
    • For this, run the generation with the bodyVariables property, followed by a "-" separated list of variables
    • Example: --additional-properties bodyVariables=YOUR_MERCHANT_ACCOUNT-YOUR_COMPANY_ACCOUNT-YOUR_BALANCE_PLATFORM
  • Add custom headers to all requests. This can be useful for example if your specifications are missing security schemes.
    • For this, run the generation with the customHeaders property, followed by a "&" separated list of variables
    • Example : --additional-properties=customHeaders="Cookie:X-API-KEY="&"Accept-Encoding=gzip"

This client was generated by the jetbrains-http-client generator of OpenAPI Generator