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:

HTTP Header
Authorization: Bearer YOUR_API_KEY

Getting an API Key

To obtain an API key:

  1. Log in to your AeroViz account
  2. Navigate to Settings → API Keys
  3. Generate a new API key
  4. 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

API 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

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

WebSocket URL
wss://api.aeroviz.org/v1/stream/air-quality

Research

Access research data and publications through our API.

Get Research Publications

API Endpoint
GET /api/v1/research/publications

Webhooks

Configure webhooks to receive notifications when specific conditions are met.

Setting up Webhooks

  1. Create a webhook endpoint on your server
  2. Register the webhook URL with our API
  3. Configure trigger conditions
  4. 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.