Developer Docs

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.

Authentication

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...
Endpoints

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

ParameterDescription
cityCity name — e.g. paris, new york, delhi (optional)
latLatitude — use with lon for precise location
lonLongitude — 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

FieldTypeDescription
pm25numberParticulate matter concentration in µg/m³ — averaged across all sources
aqinumberUS EPA AQI index (0–500)
categorystringAQI category label
locationstringResolved city and country
timestampstringISO 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

FieldTypeDescription
window.startstringBest window start time — HH:MM (24-hour, local)
window.endstringBest window end time — HH:MM (24-hour, local)
window.avg_pm25numberAverage PM2.5 during the best window in µg/m³
window.categorystringAQI category for the window
hourlyobject[]Per-hour breakdown: hour (0–23), avg_pm25, samples
days_analyzednumberNumber of days used to compute averages (always 7)
total_samplesnumberTotal raw sensor readings used
notestringDisclaimer — 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

ParameterDescription
cityCity 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

FieldTypeDescription
temperaturenumberTemperature in °C
humiditynumberRelative humidity %
pressurenumberAtmospheric pressure in hPa
wind_speednumberWind speed in m/s
descriptionstringShort weather description
locationstringCity and country
timestampstringISO 8601 UTC datetime
Errors

Error Responses

All errors return JSON with error and code fields matching the HTTP status.

{
  "error": "Invalid or missing API key",
  "code": 401
}
StatusMeaning
400Missing required parameter (city or coordinates)
401Missing or invalid API key
429Rate limit exceeded (future)
503Upstream data provider unavailable
Quickstart

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']}")
Access

Get an API Key

Create a free account to generate your API key. One key per account — shown once and emailed to you.