ANTROLOPE API
Real-time air quality and weather data for any city worldwide. Pass a city name and get back live AQI, particulate matter readings, and atmospheric data instantly.
API Key
Include your key as the x-api-key header on every request. Keys are generated once and cannot be retrieved after delivery.
GET /api/v1/aqi?city=paris HTTP/1.1 Host: antrolope.com x-api-key: antrolope_1a2b3c4d...
GET /api/v1/aqi
Returns air quality data aggregated from multiple sources for any location worldwide. Use ?city=london for city lookup, or ?lat=51.5&lon=-0.12 for precise coordinates. One of city or lat+lon is required — omitting both returns a 400 error.
Query Parameters
| Parameter | Description |
|---|---|
| city | City name — e.g. paris, new york, delhi (optional) |
| lat | Latitude — use with lon for precise location |
| lon | Longitude — use with lat for precise location |
Response
{
"pm25": 18.4,
"aqi": 65,
"category": "Moderate",
"location": "London, GB",
"timestamp": "2026-07-05T09:00:00.000Z"
}Schema
| Field | Type | Description |
|---|---|---|
| pm25 | number | Particulate matter concentration in µg/m³ — averaged across all sources |
| aqi | number | US EPA AQI index (0–500) |
| category | string | AQI category label |
| location | string | Resolved city and country |
| timestamp | string | ISO 8601 UTC datetime of reading |
GET /api/v1/aqi/pattern
Returns the cleanest 2-hour window of the day based on 7 days of historical PM2.5 readings, plus per-hour averages across the full day. Use this to find the best time to run, commute, or spend time outdoors. Requires ?city=london. Results are cached for 6 hours.
Response
{
"city": "Delhi",
"window": {
"start": "05:00",
"end": "07:00",
"label": "5:00 AM – 7:00 AM",
"avg_pm25": 28.4,
"category": "Moderate"
},
"hourly": [
{ "hour": 0, "avg_pm25": 52.3, "samples": 14 },
{ "hour": 1, "avg_pm25": 48.1, "samples": 13 }
],
"days_analyzed": 7,
"total_samples": 1284,
"note": "Based on 7-day historical PM2.5 averages — not a real-time forecast",
"generated_at": "2026-07-13T09:00:00.000Z"
}Schema
| Field | Type | Description |
|---|---|---|
| window.start | string | Best window start time — HH:MM (24-hour, local) |
| window.end | string | Best window end time — HH:MM (24-hour, local) |
| window.avg_pm25 | number | Average PM2.5 during the best window in µg/m³ |
| window.category | string | AQI category for the window |
| hourly | object[] | Per-hour breakdown: hour (0–23), avg_pm25, samples |
| days_analyzed | number | Number of days used to compute averages (always 7) |
| total_samples | number | Total raw sensor readings used |
| note | string | Disclaimer — historical average, not forecast |
GET /api/v1/weather
Returns current weather conditions for any city worldwide. Use ?city=london to specify a city — defaults to Mumbai if omitted.
Query Parameters
| Parameter | Description |
|---|---|
| city | City name — e.g. london, delhi, tokyo (optional, defaults to Mumbai) |
Response
{
"temperature": 28.5,
"humidity": 75,
"pressure": 1012,
"wind_speed": 3.2,
"description": "haze",
"location": "Mumbai, IN",
"timestamp": "2026-07-02T06:00:00.000Z"
}Schema
| Field | Type | Description |
|---|---|---|
| temperature | number | Temperature in °C |
| humidity | number | Relative humidity % |
| pressure | number | Atmospheric pressure in hPa |
| wind_speed | number | Wind speed in m/s |
| description | string | Short weather description |
| location | string | City and country |
| timestamp | string | ISO 8601 UTC datetime |
Error Responses
All errors return JSON with error and code fields matching the HTTP status.
{
"error": "Invalid or missing API key",
"code": 401
}| Status | Meaning |
|---|---|
| 400 | Missing required parameter (city or coordinates) |
| 401 | Missing or invalid API key |
| 429 | Rate limit exceeded (future) |
| 503 | Upstream data provider unavailable |
Code Examples
curl
curl "https://antrolope.com/api/v1/aqi?city=london" \ -H "x-api-key: antrolope_your_key_here"
JavaScript (fetch)
const res = await fetch('https://antrolope.com/api/v1/aqi?city=tokyo', {
headers: { 'x-api-key': 'antrolope_your_key_here' },
})
const data = await res.json()
console.log(`AQI: ${data.aqi} (${data.category}) in ${data.location}`)Python (requests)
import requests
r = requests.get(
'https://antrolope.com/api/v1/aqi',
params={'city': 'berlin'},
headers={'x-api-key': 'antrolope_your_key_here'}
)
data = r.json()
print(f"AQI: {data['aqi']} ({data['category']}) in {data['location']}")Get an API Key
Create a free account to generate your API key. One key per account — shown once and emailed to you.