Public API Reference — Hantavirus
Overview
Hantavirus.app provides a public, read-only API for programmatic access to outbreak data. The API is built on tRPC and accessible at https://api.hantavir.us.com/api/trpc.
Authentication
The public API is unauthenticated. All read procedures are available without an API key.
Rate limits
- 60 requests per minute per IP address
- Rate limit headers included in responses:
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset - Exceeding limits returns
429 Too Many Requests
tRPC Routers
| Router | Key procedures | Cache TTL |
|---|---|---|
outbreak.* | getCurrent, getBySlug, list, getRiskLevel | 30s |
cases.* | getCounts, getTimeSeries | 30s |
regions.* | list, byCountry | 60s |
news.* | list, getById | None |
timeline.* | list | 60s (first page) |
faqs.* | list | None |
advisories.* | list, byCountry | None |
ticker.* | list | 10s |
Full procedure documentation is available in the internal API reference.
REST endpoints
For convenience, we also provide REST wrappers:
| Endpoint | Method | Description |
|---|---|---|
/v1/outbreak/:slug | GET | Get outbreak header by slug |
/v1/outbreaks | GET | List all active outbreaks |
/v1/cases/:slug | GET | Get case counts for an outbreak |
Server-Sent Events (SSE)
| Stream | Description | Events |
|---|---|---|
/sse/ticker | Live news ticker updates | text, severity, link |
/sse/ships/:mmsi | Ship position updates | lat, lng, speed, heading |
Example: ticker SSE
const source = new EventSource('https://api.hantavir.us.com/sse/ticker');
source.onmessage = (e) => {
const data = JSON.parse(e.data);
console.log(data.text, data.severity);
};Locale support
All locale-aware procedures accept the language via:
hv-localecookieAccept-Languageheader- Default:
en
Supported: en, ar (Gulf Khaleeji), fr
For full API details, see the complete API documentation.