API Reference
Welcome to the AeroViz API documentation. This comprehensive guide will help you integrate with our platform and access air quality data programmatically.
API Information:
Base URL: https://api.aeroviz.org/v1
Authentication: API Key required for most endpoints
Format: JSON responses
Authentication
All API requests require authentication using an API key. Include your API key in the request header:
Authorization: Bearer YOUR_API_KEY
Getting an API Key
To obtain an API key:
- Log in to your AeroViz account
- Navigate to Settings → API Keys
- Generate a new API key
- Store it securely
Data Endpoints
Get Air Quality Data
Retrieve current air quality measurements from monitoring stations.
| Parameter | Type | Required | Description |
|---|---|---|---|
station_id |
string | No | Specific station ID. If omitted, returns all stations. |
parameter |
string | No | Air quality parameter (PM2.5, PM10, O3, etc.) |
start_date |
string | No | Start date in YYYY-MM-DD format |
end_date |
string | No | End date in YYYY-MM-DD format |
Example Request
GET /api/v1/data/air-quality?station_id=TAIPEI_001¶meter=PM2.5&start_date=2025-01-01&end_date=2025-01-31
Example Response
{
"status": "success",
"data": {
"station_id": "TAIPEI_001",
"station_name": "Taipei Main Station",
"location": {
"latitude": 25.0478,
"longitude": 121.5319
},
"measurements": [
{
"timestamp": "2025-01-15T10:00:00Z",
"parameter": "PM2.5",
"value": 25.3,
"unit": "μg/m³",
"aqi": 75
}
]
}
}
Monitoring
Real-time monitoring endpoints for live data streams.
Live Data Stream
Subscribe to real-time air quality updates using WebSocket connection.
wss://api.aeroviz.org/v1/stream/air-quality
Research
Access research data and publications through our API.
Get Research Publications
GET /api/v1/research/publications
Webhooks
Configure webhooks to receive notifications when specific conditions are met.
Setting up Webhooks
- Create a webhook endpoint on your server
- Register the webhook URL with our API
- Configure trigger conditions
- Handle incoming webhook payloads
Rate Limits
API requests are rate-limited to ensure fair usage:
- Free Tier: 100 requests per hour
- Pro Tier: 1,000 requests per hour
- Enterprise: 10,000 requests per hour
Rate Limit Headers: Check the X-RateLimit-Remaining header to monitor your usage.
Error Codes
Common HTTP status codes and their meanings:
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request successful |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Insufficient permissions |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error occurred |
Need Help? Check our Documentation or contact our support team.