OpenAQ Data Fetch
Use the CLI-owned openaq.air-quality capability. This Skill supplies intent
routing and result-use boundaries only; the CLI owns source discovery,
input/output schemas, API-key injection, pagination, limits, validation, and
receipts.
Before running
- Read
references/tiangong-data-requirement.json.
- Use the caller- or workspace-resolved stable CLI. The requirement declares
compatible capability and operation contract majors; it does not select a
package build.
- Run
data describe with that same CLI. Continue only when the capability
ID and required contract majors match, and copy the exact current
capability/operation versions from that response into the run request.
- Ensure
OPENAQ_API_KEY is present in the CLI process environment, then run
the default static doctor. Never place the key in argv, request JSON, a
Skill-local file, logs, or output.
tiangong-ai data describe openaq.air-quality --json
tiangong-ai data doctor openaq.air-quality --json
Use the returned Discovery Metadata to confirm current ownership, coverage,
granularity, source-specific quality and license limits, selection hints,
provides, and doesNotProvide. Do not substitute facts remembered from an
older Skill revision. A blocked static doctor means the required logical
credential is unavailable; stop instead of bypassing the CLI.
Choose one operation
- Use
search-locations when the relevant sensor ID is not yet known. Supply at
least one explicit country, provider, parameter, license, monitor, mobile,
center-radius, or bounding-box filter. Inspect provider, monitor status,
parameter, license, and coverage metadata before choosing a sensor.
- Use
fetch-sensor-measurements only after selecting one trusted sensor ID.
Choose raw for upstream-reported observations or hourly/daily for
OpenAQ's precomputed aggregates, and use an explicit RFC3339 window of no more
than 366 days. Daily records use the sensor location's local-day boundaries;
preserve the returned period instead of treating them as UTC calendar days.
Do not invent or pass an API path. Do not use this Skill to list or download
OpenAQ S3 archive objects; bulk files require a separately governed
content/download workflow. search-locations returns metadata attached to
bounded location results; it is not a global country, provider, parameter,
license, instrument, or sensor catalog.
Prepare a location request
Build a tiangong.data.run-request.v1 envelope and replace the version
placeholders with the exact versions from the same data describe response. This example searches a
bounded country/parameter combination; use the current input schema from
data describe for other supported filters.
{
"schemaVersion": "tiangong.data.run-request.v1",
"capabilityId": "openaq.air-quality",
"capabilityVersion": "<describe.manifest.capabilityVersion>",
"operationId": "search-locations",
"operationVersion": "<describe.manifest.operations[1].operationVersion>",
"input": {
"countryCode": "NL",
"parameterIds": [2],
"pageSize": 250,
"sortOrder": "asc"
}
}
Do not silently widen spatial or provider filters, turn a bounded search into a
global scan, combine center with bounding box, geocode a place name, or infer
that every returned sensor has continuous data for the desired time window.
Prepare a measurement request
Use the selected sensor's exact ID and an explicit granularity and time window.
Do not merge sensors, convert units, or switch granularity inside this atomic
call.
{
"schemaVersion": "tiangong.data.run-request.v1",
"capabilityId": "openaq.air-quality",
"capabilityVersion": "<describe.manifest.capabilityVersion>",
"operationId": "fetch-sensor-measurements",
"operationVersion": "<describe.manifest.operations[0].operationVersion>",
"input": {
"sensorId": 1001,
"granularity": "hourly",
"startDateTime": "2026-03-01T00:00:00Z",
"endDateTime": "2026-03-07T23:59:59Z",
"pageSize": 1000
}
}
Run
tiangong-ai data run openaq.air-quality search-locations \
--input /absolute/path/to/location-request.json --json
tiangong-ai data run openaq.air-quality fetch-sensor-measurements \
--input /absolute/path/to/measurement-request.json --json
Each command emits a tiangong.data.run-result.v1 envelope. Preserve its
contract, warnings, errors, and receipt with data when handing the
result to another workflow.
Result boundaries
- Preserve OpenAQ attribution and every original provider's license and
attribution metadata. OpenAQ's terms do not replace source-specific terms.
- Treat location, owner, provider, instrument, monitor, sensor, and coverage
fields as provider-dependent metadata, not proof of regulatory-network status
or measurement quality.
- Keep raw, hourly, and daily granularities explicit. Do not mix raw upstream
records with OpenAQ aggregates without an explicit analytical method, and
retain
flagInfo, aggregate summary, coverage interval, and period fields.
- Preserve provider nulls. A null value, period, coordinate, summary member, or
coverage object is a valid unavailable field, not proof of zero, clean data,
absence of pollution, or a failed request. Inspect
flagInfo.hasFlags
separately from nullability.
- Interpret daily aggregates in the selected location's timezone and preserve
their returned period; do not relabel them as UTC calendar-day averages.
- Treat
partial as incomplete page or record coverage. Report missing pages
and provider errors with the usable records.
- Treat
blocked as no usable business result. Surface credential, input,
endpoint, rate-limit, or provider errors instead of bypassing limits,
switching endpoints, or calling the old scripts.
- Report page/record-limit truncation. A truncated or empty result is not proof
that no monitors or pollution observations exist.
- Do not calculate AQI, make health or regulatory claims, infer pollution
sources, forecast conditions, interpolate space, correct calibration,
convert units, or claim completeness from this result alone.
- Cross-sensor comparison, recurring monitoring, source fusion, statistical
inference, bulk archive acquisition, and research evidence admission belong
to the caller or Auto Research, not this atomic Skill.
Reference
references/tiangong-data-requirement.json: stable capability requirement; it is not a package lock.
1---2name: openaq-data-fetch3description: Discover bounded OpenAQ air-quality monitoring locations and retrieve raw, hourly, or daily measurements for one known sensor through the Tiangong CLI. Use when a task needs OpenAQ location, provider, sensor, parameter, license, coverage, or time-series context; do not use for arbitrary API paths, S3 archive downloads, AQI calculation, health or regulatory decisions, forecasting, source attribution, or cross-sensor analysis.4---5
6# OpenAQ Data Fetch
7
8Use the CLI-owned `openaq.air-quality` capability. This Skill supplies intent
9routing and result-use boundaries only; the CLI owns source discovery,
10input/output schemas, API-key injection, pagination, limits, validation, and
11receipts.
12
13## Before running
14
151. Read `references/tiangong-data-requirement.json`.
162. Use the caller- or workspace-resolved stable CLI. The requirement declares
17 compatible capability and operation contract majors; it does not select a
18 package build.
193. Run `data describe` with that same CLI. Continue only when the capability
20 ID and required contract majors match, and copy the exact current
21 capability/operation versions from that response into the run request.
224. Ensure `OPENAQ_API_KEY` is present in the CLI process environment, then run
23 the default static doctor. Never place the key in argv, request JSON, a
24 Skill-local file, logs, or output.
25
26```bash
27tiangong-ai data describe openaq.air-quality --json
28tiangong-ai data doctor openaq.air-quality --json
29```
30
31Use the returned Discovery Metadata to confirm current ownership, coverage,
32granularity, source-specific quality and license limits, selection hints,
33`provides`, and `doesNotProvide`. Do not substitute facts remembered from an
34older Skill revision. A blocked static doctor means the required logical
35credential is unavailable; stop instead of bypassing the CLI.
36
37## Choose one operation
38
39- Use `search-locations` when the relevant sensor ID is not yet known. Supply at
40 least one explicit country, provider, parameter, license, monitor, mobile,
41 center-radius, or bounding-box filter. Inspect provider, monitor status,
42 parameter, license, and coverage metadata before choosing a sensor.
43- Use `fetch-sensor-measurements` only after selecting one trusted sensor ID.
44 Choose `raw` for upstream-reported observations or `hourly`/`daily` for
45 OpenAQ's precomputed aggregates, and use an explicit RFC3339 window of no more
46 than 366 days. Daily records use the sensor location's local-day boundaries;
47 preserve the returned period instead of treating them as UTC calendar days.
48
49Do not invent or pass an API path. Do not use this Skill to list or download
50OpenAQ S3 archive objects; bulk files require a separately governed
51content/download workflow. `search-locations` returns metadata attached to
52bounded location results; it is not a global country, provider, parameter,
53license, instrument, or sensor catalog.
54
55## Prepare a location request
56
57Build a `tiangong.data.run-request.v1` envelope and replace the version
58placeholders with the exact versions from the same `data describe` response. This example searches a
59bounded country/parameter combination; use the current input schema from
60`data describe` for other supported filters.
61
62```json
63{
64 "schemaVersion": "tiangong.data.run-request.v1",
65 "capabilityId": "openaq.air-quality",
66 "capabilityVersion": "<describe.manifest.capabilityVersion>",
67 "operationId": "search-locations",
68 "operationVersion": "<describe.manifest.operations[1].operationVersion>",
69 "input": {
70 "countryCode": "NL",
71 "parameterIds": [2],
72 "pageSize": 250,
73 "sortOrder": "asc"
74 }
75}
76```
77
78Do not silently widen spatial or provider filters, turn a bounded search into a
79global scan, combine center with bounding box, geocode a place name, or infer
80that every returned sensor has continuous data for the desired time window.
81
82## Prepare a measurement request
83
84Use the selected sensor's exact ID and an explicit granularity and time window.
85Do not merge sensors, convert units, or switch granularity inside this atomic
86call.
87
88```json
89{
90 "schemaVersion": "tiangong.data.run-request.v1",
91 "capabilityId": "openaq.air-quality",
92 "capabilityVersion": "<describe.manifest.capabilityVersion>",
93 "operationId": "fetch-sensor-measurements",
94 "operationVersion": "<describe.manifest.operations[0].operationVersion>",
95 "input": {
96 "sensorId": 1001,
97 "granularity": "hourly",
98 "startDateTime": "2026-03-01T00:00:00Z",
99 "endDateTime": "2026-03-07T23:59:59Z",
100 "pageSize": 1000
101 }
102}
103```
104
105## Run
106
107```bash
108tiangong-ai data run openaq.air-quality search-locations \
109 --input /absolute/path/to/location-request.json --json
110
111tiangong-ai data run openaq.air-quality fetch-sensor-measurements \
112 --input /absolute/path/to/measurement-request.json --json
113```
114
115Each command emits a `tiangong.data.run-result.v1` envelope. Preserve its
116`contract`, `warnings`, `errors`, and `receipt` with `data` when handing the
117result to another workflow.
118
119## Result boundaries
120
121- Preserve OpenAQ attribution and every original provider's license and
122 attribution metadata. OpenAQ's terms do not replace source-specific terms.
123- Treat location, owner, provider, instrument, monitor, sensor, and coverage
124 fields as provider-dependent metadata, not proof of regulatory-network status
125 or measurement quality.
126- Keep raw, hourly, and daily granularities explicit. Do not mix raw upstream
127 records with OpenAQ aggregates without an explicit analytical method, and
128 retain `flagInfo`, aggregate summary, coverage interval, and period fields.
129- Preserve provider nulls. A null value, period, coordinate, summary member, or
130 coverage object is a valid unavailable field, not proof of zero, clean data,
131 absence of pollution, or a failed request. Inspect `flagInfo.hasFlags`
132 separately from nullability.
133- Interpret daily aggregates in the selected location's timezone and preserve
134 their returned period; do not relabel them as UTC calendar-day averages.
135- Treat `partial` as incomplete page or record coverage. Report missing pages
136 and provider errors with the usable records.
137- Treat `blocked` as no usable business result. Surface credential, input,
138 endpoint, rate-limit, or provider errors instead of bypassing limits,
139 switching endpoints, or calling the old scripts.
140- Report page/record-limit truncation. A truncated or empty result is not proof
141 that no monitors or pollution observations exist.
142- Do not calculate AQI, make health or regulatory claims, infer pollution
143 sources, forecast conditions, interpolate space, correct calibration,
144 convert units, or claim completeness from this result alone.
145- Cross-sensor comparison, recurring monitoring, source fusion, statistical
146 inference, bulk archive acquisition, and research evidence admission belong
147 to the caller or Auto Research, not this atomic Skill.
148
149## Reference
150
151- `references/tiangong-data-requirement.json`: stable capability requirement; it is not a package lock.