Documentation
Unified API reference
All endpoints return stable, presentation-ready JSON with meta, data, links, and attribution.
Base URL
Use the current domain as base. Example:
https://aifire.ai/api/v1
Endpoints
- /api/v1 - index of available endpoints
- /api/v1/status - app status, cache health, uptime
- /api/v1/module - active module based on hostname
- /api/v1/events - aggregated events (params: module, limit)
- /api/v1/earthquakes - USGS feed proxy
- /api/v1/weather - OpenWeather proxy (params: lat, lon)
Example requests
curl https://aifire.ai/api/v1/status
curl https://aiflood.ai/api/v1/events?module=flood&limit=10
curl https://aiearthquake.ai/api/v1/earthquakes
curl "https://aiweather.ai/api/v1/weather?lat=34.05&lon=-118.24"
Caching
External API responses are cached for 5-15 minutes in /storage/cache. If a live call fails, stale data is returned with stale=true.
Rate limits
Upstream providers enforce rate limits. The cache layer reduces calls to NASA, USGS, and OpenWeather. For demos, keep refreshes to a reasonable cadence (5-10 minutes).
Authentication
Public demo endpoints do not require auth. Add an OpenWeather API key via OPENWEATHER_API_KEY in cPanel environment variables.