The Timelory REST API provides programmatic access to historical data including empire borders (GeoJSON), dynasty information, ruler genealogies, and timeline structures.
Base URL: https://api.timelory.com/api
Access GeoJSON data for historical empire and nation borders.
/regions/postgis
Returns GeoJSON FeatureCollection of all historical regions for a specific year.
| Parameter | Type | Required | Description |
|---|---|---|---|
year | integer | Yes | Year to query. Use negative numbers for BCE (e.g., -500 for 500 BCE) |
GET https://api.timelory.com/api/regions/postgis?year=-500
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "Achaemenid Empire",
"start_year": -550,
"end_year": -330,
"color": "#8B4513"
},
"geometry": {
"type": "Polygon",
"coordinates": [[[44.0, 33.0], [50.0, 33.0], ...]]
}
}
]
}
/regions/timeline
Returns list of available years in the historical regions dataset.
{
"success": true,
"data": {
"years": [-3000, -2900, -2800, ..., 2020],
"minYear": -3000,
"maxYear": 2020
}
}
Access dynasty metadata and ruler information.
/dynasties
Returns list of all available dynasties.
{
"success": true,
"data": [
{
"id": "assyrian",
"name": "Assyrian Empire",
"description": "Ancient Mesopotamian empire...",
"startYear": -2025,
"endYear": -609,
"capital": "Nineveh",
"imageUrl": "https://timelory.com/images/assyria.jpg"
}
]
}
/dynasties/{id}
Returns detailed information about a specific dynasty.
/dynasties/{id}/rulers
Returns all rulers for a specific dynasty with events.
{
"success": true,
"data": [
{
"id": "ashurbanipal",
"name": "Ashurbanipal",
"title": "King of Assyria",
"startYear": -669,
"endYear": -631,
"description": "Last great Assyrian king...",
"events": [
{
"year": -640,
"title": "Library of Nineveh",
"description": "Created greatest cuneiform collection",
"type": "cultural"
}
]
}
]
}
Access and manage timeline data structures.
/timelines
Returns list of public timelines.
/timelines/{id}
Returns a specific timeline with all tracks and items.
{
"id": "assyrian-timeline",
"name": "Assyrian Empire Timeline",
"description": "Complete history of Assyria",
"tracks": [
{
"id": "old_assyrian",
"name": "Old Assyrian Period",
"startYear": -2025,
"endYear": -1750,
"color": "#7C3AED",
"items": [
{
"id": "erishum_i",
"name": "Erishum I",
"start": -1974,
"end": -1935,
"events": [...]
}
]
}
]
}
Most read endpoints are public. Write operations require authentication.
/auth/login
Authenticate and receive a bearer token.
{
"email": "user@example.com",
"password": "your-password"
}
Authorization: Bearer {token}
| Tier | Requests/Hour | Notes |
|---|---|---|
| Anonymous | 100 | Public endpoints only |
| Free Account | 1,000 | All read endpoints |
| Premium | 10,000 | Full API access |
{
"success": false,
"error": "Error message",
"code": "ERROR_CODE"
}
| Code | HTTP Status | Description |
|---|---|---|
| UNAUTHORIZED | 401 | Missing or invalid authentication |
| NOT_FOUND | 404 | Resource not found |
| RATE_LIMITED | 429 | Too many requests |
| INVALID_PARAM | 400 | Invalid query parameter |
Official SDKs coming soon. For now, use any HTTP client:
// JavaScript/TypeScript
const response = await fetch('https://api.timelory.com/api/regions/postgis?year=-500');
const data = await response.json();
// Python
import requests
response = requests.get('https://api.timelory.com/api/regions/postgis', params={'year': -500})
data = response.json()