Skip to content

Commit 5c1e16e

Browse files
committed
docs updates
1 parent 32d1099 commit 5c1e16e

File tree

7 files changed

+91
-39
lines changed

7 files changed

+91
-39
lines changed

package-lock.json

+10-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"starlight-openapi": "^0.7.0"
2323
},
2424
"devDependencies": {
25+
"@iconify-json/mdi": "^1.2.0",
2526
"@types/node": "^22.10.0",
2627
"knip": "^5.38.1",
2728
"typescript": "^5.7.2"

src/content/docs/resources/latest.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description:
44
The Latest resource provides the most recent air quality measurements from
55
sensors, including the measurement time, value, location coordinates, and
66
sensor information. Track real-time air quality trends and gain insights into
7-
the newest data available across locations and parameters.
7+
the newest data available across Locations and Parameters.
88
---
99
import FeedbackForm from '../../../components/FeedbackForm.astro';
1010

@@ -31,8 +31,8 @@ The Latest resource provides access to the newest air quality data from sensors.
3131
It shows recent measurements and their geographic location, allowing users to
3232
track air quality trends quickly and make timely decisions.
3333

34-
The Latest resource is accessible through either a single [location](locations),
35-
showing latest values for all sensors available at that location, or by
34+
The Latest resource is accessible through either a single [Location](locations),
35+
showing latest values for all sensors available at that Location, or by
3636
parameter, showing the latest value across all sensors that measure that
3737
parameter, e.g.:
3838

@@ -55,7 +55,7 @@ https://api.openaq.org/v3/parameters/2/latest
5555
- coordinates: the location in WGS84 latitude and longitude of the reading.
5656
- sensorsId: the unique ID for the sensor that took the reading. See the
5757
[Sensors](sensors) resource page for more information.
58-
- locationsId: the unique ID for the location where the sensor is situated. See
58+
- locationsId: the unique ID for the :ocation where the sensor is situated. See
5959
the [Locations](locations) resource page for more information.
6060

6161
## Example response payload

src/content/docs/resources/measurements.mdx

+6-6
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ the selected time range.
7272

7373
<Aside type="note">
7474
A call to the `/v3/sensors/{sensors_id}/measurements/hourly` is functionally
75-
the same as `/v3/sensors/{sensors_id}/hours`. The `/hours` options is the
76-
preferred resource.
75+
the same as `/v3/sensors/{sensors_id}/hours`. The `/hours` resource is the
76+
preferred option.
7777
</Aside>
7878

7979
### Daily
@@ -87,8 +87,8 @@ selected time range.
8787

8888
<Aside type="note">
8989
A call to the `/v3/sensors/{sensors_id}/hours/daily` is functionally the same
90-
as `/v3/sensors/{sensors_id}/days`. The `/days` options is the preferred
91-
resource.
90+
as `/v3/sensors/{sensors_id}/days`. The `/days` resource is the
91+
preferred option.
9292
</Aside>
9393

9494
### Monthly
@@ -115,8 +115,8 @@ the selected time range.
115115

116116
<Aside type="note">
117117
A call to the `/v3/sensors/{sensors_id}/hours/yearly` is functionally the same
118-
as `/v3/sensors/{sensors_id}/years`. The `/years` options is the preferred
119-
resource.
118+
as `/v3/sensors/{sensors_id}/years`. The `/years` resource is the
119+
preferred option.
120120
</Aside>
121121

122122
### Hour of day

src/content/docs/resources/sensors.mdx

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import FeedbackForm from '../../../components/FeedbackForm.astro';
1010

1111

1212
The Sensors resource in the OpenAQ API provides details about individual air
13-
quality sensors that collect environmental data. Each sensor tracks a single
14-
parameter, such as air pollutant measurements or related measurements (e.g.,
15-
temperature and humidity) and reports on their concentration over time.
13+
quality sensors that collect environmental data. One or more sensors belong to a
14+
[Location](locations). Each sensor tracks a single parameter, such as air pollutant
15+
measurements or related measurements (e.g., temperature and humidity) and
16+
reports on their concentration over time.
1617

1718
## Purpose and Use
1819

src/content/docs/using-the-api/errors.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ and address any problems that arise when using the API.
2828
<tbody>
2929
<tr><td>200</td><td>OK</td><td>Successful request.</td></tr>
3030
<tr><td>401</td><td>Unauthorized</td><td>Valid API key is missing.</td></tr>
31+
<tr><td>403</td><td>Forbidden</td><td>The requested resource may exist but the user is not granted access. This may be a sign that the user account has been blocked for non-compliance of the terms of use.</td></tr>
3132
<tr><td>404</td><td>Not Found</td><td>The requested resource does not exist.</td></tr>
32-
<tr><td>405</td><td>Method Not Allow</td><td>The HTTP method is not supported. The OpenAQ API currently only supports GET requests.</td></tr>
33+
<tr><td>405</td><td>Method Not Allowed</td><td>The HTTP method is not supported. The OpenAQ API currently only supports GET requests.</td></tr>
3334
<tr><td>408</td><td>Request Timeout</td><td>The request timed out, the query may be too complex causing it to run too long.</td></tr>
3435
<tr><td>422</td><td>Unprocessable Content</td><td>The query provided is
3536
incorrect and does not follow the standards set by the API specification.</td></tr>

src/content/docs/using-the-api/quick-start.mdx

+64-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,70 @@ using the command line on your computer.
4747
--header "X-API-Key: YOUR-OPENAQ-API-KEY"
4848
```
4949

50-
4. The JSON response will give you the data for location 8118. You have now
51-
used the OpenAQ API successfully.
50+
4. The JSON response will looks something like the following:
51+
52+
```json
53+
{
54+
"meta": {
55+
"name": "openaq-api",
56+
"website": "/",
57+
"page": 1,
58+
"limit": 100,
59+
"found": 1
60+
},
61+
"results": [
62+
{
63+
"id": 8118,
64+
"name": "New Delhi",
65+
"locality": "India",
66+
"timezone": "Asia/Kolkata",
67+
"country": { "id": 9, "code": "IN", "name": "India" },
68+
"owner": { "id": 4, "name": "Unknown Governmental Organization" },
69+
"provider": { "id": 119, "name": "AirNow" },
70+
"isMobile": false,
71+
"isMonitor": true,
72+
"instruments": [{ "id": 2, "name": "Government Monitor" }],
73+
"sensors": [
74+
{
75+
"id": 23534,
76+
"name": "pm25 µg/m³",
77+
"parameter": {
78+
"id": 2,
79+
"name": "pm25",
80+
"units": "µg/m³",
81+
"displayName": "PM2.5"
82+
}
83+
}
84+
],
85+
"coordinates": { "latitude": 28.63576, "longitude": 77.22445 },
86+
"licenses": [
87+
{
88+
"id": 33,
89+
"name": "US Public Domain",
90+
"attribution": {
91+
"name": "Unknown Governmental Organization",
92+
"url": null
93+
},
94+
"dateFrom": "2016-01-30",
95+
"dateTo": null
96+
}
97+
],
98+
"bounds": [77.22445, 28.63576, 77.22445, 28.63576],
99+
"distance": null,
100+
"datetimeFirst": {
101+
"utc": "2016-11-09T19:00:00Z",
102+
"local": "2016-11-10T00:30:00+05:30"
103+
},
104+
"datetimeLast": {
105+
"utc": "2024-12-13T14:30:00Z",
106+
"local": "2024-12-13T20:00:00+05:30"
107+
}
108+
}
109+
]
110+
}
111+
112+
```
113+
52114

53115
</Steps>
54116

0 commit comments

Comments
 (0)