{"openapi":"3.1.0","info":{"title":"OpenAQ (BYOK) API","version":"0.1.0","description":"OpenAQ (BYOK) lets an AI assistant read your own OpenAQ data through the OpenAQ API with a key you supply (API key). Read-only: 8 tools (list_locations, get_location, get_location_latest, list_location_sensors, get_sensor, get_sensor_measurements, list_parameters, list_countries). The BYOK key travels with each request, is used for that one call only and is never stored, logged or cached; it is...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-openaq.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-openaq/docs"},"termsOfService":"https://connectorbay.com/byok-openaq/terms"},"servers":[{"url":"https://byok-openaq.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-openaq/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/list_locations":{"post":{"operationId":"list_locations","summary":"Find air quality monitoring locations near a point, inside a bounding box or in a country, with their sensors (pollutant","description":"Find air quality monitoring locations near a point, inside a bounding box or in a country, with their sensors (pollutant, unit), provider, coordinates and first and last reading time. Results come with the total found. Use for \"Which air quality monitors are within 5 km of Washington DC\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"coordinates":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Centre point as 'latitude,longitude', for example '38.907,-77.037'. Use together with radius.","title":"Coordinates"},"radius":{"anyOf":[{"maximum":25000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1000,"description":"Search radius in metres around coordinates, up to 25000 (default 1000).","title":"Radius"},"bbox":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"default":null,"description":"Bounding box as 'min_lon,min_lat,max_lon,max_lat', for example '-77.12,38.79,-76.91,38.99'.","title":"Bbox"},"iso":{"anyOf":[{"maxLength":2,"type":"string"},{"type":"null"}],"default":null,"description":"Limit to a country by ISO 3166-1 alpha-2 code, for example US or IN.","title":"Iso"},"countries_id":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Limit to one country ID, or several IDs separated by commas (see list_countries).","title":"Countries Id"},"parameters_id":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Only locations measuring this pollutant ID (see list_parameters), for example 2 for PM2.5.","title":"Parameters Id"},"monitor":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True for reference-grade monitors only, false for low-cost sensors only.","title":"Monitor"},"mobile":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True for mobile locations only, false for fixed ones only.","title":"Mobile"},"limit":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many results per page (the API default is 100).","title":"Limit"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_locationsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_location":{"post":{"operationId":"get_location","summary":"Get one monitoring location by ID: name, locality, timezone, country, owner, provider, instruments, sensors with polluta","description":"Get one monitoring location by ID: name, locality, timezone, country, owner, provider, instruments, sensors with pollutant and unit, coordinates and licence with its attribution text. Use for \"Show me details of OpenAQ location 8118\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"locations_id":{"description":"OpenAQ location ID, a number from list_locations.","minimum":1,"title":"Locations Id","type":"integer"}},"required":["locations_id"],"title":"get_locationArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_location_latest":{"post":{"operationId":"get_location_latest","summary":"Get the latest value of every sensor at a location, with the sensor ID, value, coordinates and reading time. Use for \"Wh","description":"Get the latest value of every sensor at a location, with the sensor ID, value, coordinates and reading time. Use for \"What are the latest air quality readings at OpenAQ location 8118\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"locations_id":{"description":"OpenAQ location ID, a number from list_locations.","minimum":1,"title":"Locations Id","type":"integer"},"datetime_min":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null,"description":"Only readings at or after this date or time, for example 2026-01-01 or 2026-01-01T00:00:00Z.","title":"Datetime Min"},"limit":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many results per page (the API default is 100).","title":"Limit"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"required":["locations_id"],"title":"get_location_latestArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_location_sensors":{"post":{"operationId":"list_location_sensors","summary":"List the sensors at a location with pollutant name, unit, first and last reading time, latest value and summary statisti","description":"List the sensors at a location with pollutant name, unit, first and last reading time, latest value and summary statistics. Use for \"Which sensors does OpenAQ location 8118 have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"locations_id":{"description":"OpenAQ location ID, a number from list_locations.","minimum":1,"title":"Locations Id","type":"integer"}},"required":["locations_id"],"title":"list_location_sensorsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_sensor":{"post":{"operationId":"get_sensor","summary":"Get one sensor by ID: pollutant and unit, first and last reading time, data coverage, latest value and summary statistic","description":"Get one sensor by ID: pollutant and unit, first and last reading time, data coverage, latest value and summary statistics. Use for \"Show OpenAQ sensor 23\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"sensors_id":{"description":"OpenAQ sensor ID, a number from list_location_sensors or the sensors of a location.","minimum":1,"title":"Sensors Id","type":"integer"}},"required":["sensors_id"],"title":"get_sensorArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_sensor_measurements":{"post":{"operationId":"get_sensor_measurements","summary":"Get a sensor's measurements between two dates, newest data per page, with value, pollutant, unit, period and coverage. U","description":"Get a sensor's measurements between two dates, newest data per page, with value, pollutant, unit, period and coverage. Use for \"What did OpenAQ sensor 23 measure between 2026-01-01 and 2026-01-02\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"sensors_id":{"description":"OpenAQ sensor ID, a number from list_location_sensors or the sensors of a location.","minimum":1,"title":"Sensors Id","type":"integer"},"datetime_from":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null,"description":"Start date or time, for example 2026-01-01 or 2026-01-01T00:00:00Z.","title":"Datetime From"},"datetime_to":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null,"description":"End date or time, in the same formats.","title":"Datetime To"},"limit":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many results per page (the API default is 100).","title":"Limit"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"required":["sensors_id"],"title":"get_sensor_measurementsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_parameters":{"post":{"operationId":"list_parameters","summary":"List the pollutants and weather parameters OpenAQ tracks, with ID, name, unit and description. Use for \"Which pollutants","description":"List the pollutants and weather parameters OpenAQ tracks, with ID, name, unit and description. Use for \"Which pollutants does OpenAQ measure\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"parameter_type":{"anyOf":[{"enum":["pollutant","meteorological"],"type":"string"},{"type":"null"}],"default":null,"description":"Only pollutants or only meteorological parameters.","title":"Parameter Type"},"limit":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many results per page (the API default is 100).","title":"Limit"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_parametersArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_countries":{"post":{"operationId":"list_countries","summary":"List countries with OpenAQ data: ID, ISO code, name, first and last data time and the parameters measured. Use for \"Whic","description":"List countries with OpenAQ data: ID, ISO code, name, first and last data time and the parameters measured. Use for \"Which countries does OpenAQ have air quality data for\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"limit":{"anyOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many results per page (the API default is 100).","title":"Limit"},"page":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page"}},"title":"list_countriesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}