Documentation
Get started with Polyhistor in under 5 minutes. Build location-aware apps that understand context, not just coordinates.
Base URL: https://api.thepolyhistor.com | Current version: v1
Getting Started
Polyhistor is a contextual geospatial intelligence API. Unlike traditional place APIs that return raw coordinates and ratings, Polyhistor understands what a place feels like, when it's best to visit, and who it's for.
Join the waitlist
Pricing and self-serve API keys launch next week. Join the waitlist to get early access. For now, you can explore the live demo without an API key.
Make your first request
Once you have an API key, every request includes it in the X-API-Key header:
Integrate into your app
Use the Unified Search endpoint for most use cases. It combines semantic, temporal, and social signals into one ranked result set.
curl "https://api.thepolyhistor.com/api/v1/unified/search?query=cozy+coffee+shop&city=chicago&limit=5" \ -H "X-API-Key: your_api_key_here"
Authentication
All API requests (except the public demo endpoint) require an API key. Include your key in the X-API-Key header.
X-API-Key: dgx_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Getting an API Key
- Sign up at the Developer Dashboard
- Create a new project
- Copy your API key from the project settings page
- Include the key in every request header
Security tip: Never expose your API key in client-side JavaScript. Proxy requests through your backend, or use the demo endpoint for client-side prototypes.
Rate Limits
Rate limits are enforced per API key. Limits vary by plan tier:
| Plan | Requests/min | Requests/month |
|---|---|---|
| Free | 30 | 5,000 |
| Pro | 300 | 100,000 |
| Enterprise | Unlimited | Unlimited |
When you exceed a limit, the API returns 429 Too Many Requests. Retry after the time specified in the Retry-After header.
Demo Search
Public demo endpoint — no API key required. Perfect for prototyping and testing. Rate limited to 30 requests/min per IP.
/api/v1/demo/searchPublic demo search with full contextual response. Returns vibe match scores, temporal states, tribe density, taxonomy, and recommendations.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Required | Natural language query, e.g. "cozy coffee shop for working" |
city | string | Required | City name or alias: san_francisco, chicago, nyc, la, etc. |
limit | integer | Optional | Max results. Default: 10, Max: 50 |
curl "https://api.thepolyhistor.com/api/v1/demo/search?query=cozy+coffee+shop&city=san_francisco&limit=5"
{
"results": [
{
"id": "08f...",
"name": "The Coffee Bar",
"category": "coffee_shop",
"main_category": "cafe",
"taxonomy": {
"primary": "cafe",
"hierarchy": ["cafe", "coffee_shop", "restaurant"],
"alternates": null
},
"latitude": 37.7749,
"longitude": -122.4194,
"distance_meters": 850,
"vibe_match_score": 0.92,
"temporal_state": "PEAK",
"next_transition": 1716051600,
"tribe_density": 0.78,
"tribes": [
{
"tribe_id": "FOUNDER",
"label": "Founder",
"icon": "🚀",
"color": "#8B5CF6",
"rule_score": 0.8,
"embedding_score": 0.75,
"final_score": 0.775
},
{
"tribe_id": "CREATIVE",
"label": "Creative",
"icon": "🎨",
"color": "#EC4899",
"rule_score": 0.65,
"embedding_score": 0.7,
"final_score": 0.675
}
],
"estimated_wait_minutes": 12,
"recommendation": "GO_NOW"
}
]
}Suggestions
Category-based query suggestions and random query generation for discovery. No API key required.
/api/v1/suggestionsReturns categorized query suggestions with icons, descriptions, and example queries per city.
curl "https://api.thepolyhistor.com/api/v1/suggestions"
{
"categories": [
{
"id": "work",
"label": "Work",
"icon": "💻",
"description": "Quiet spaces to focus",
"queries": [
{ "query": "quiet workspace with wifi", "city": "san_francisco", "cityLabel": "San Francisco" }
]
}
],
"meta": { "total_categories": 6, "total_queries": 24 }
}/api/v1/suggestions/randomReturns a single random query suggestion with city pre-selected.
curl "https://api.thepolyhistor.com/api/v1/suggestions/random"
{
"query": "romantic rooftop bar",
"city": "san_francisco",
"cityLabel": "San Francisco"
}API Reference
/api/v1/unified/searchThe primary search endpoint. Combines semantic (V-Layer), temporal (T-Layer), and social (Tribe Layer) signals into a single ranked result set.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Required | Natural language query, e.g. "cozy coffee shop for working" |
city | string | Optional | City name or alias: chicago, nyc, sf, la, etc. |
lat | number | Optional | Latitude (used if city not provided) |
lon | number | Optional | Longitude (used if city not provided) |
limit | integer | Optional | Max results. Default: 10, Max: 50 |
curl "https://api.thepolyhistor.com/api/v1/unified/search?query=cozy+coffee+shop&city=chicago&limit=10" \ -H "X-API-Key: your_api_key_here"
{
"results": [
{
"id": "08f...",
"name": "The Coffee Bar",
"category": "coffee_shop",
"main_category": "cafe",
"taxonomy": {
"primary": "cafe",
"hierarchy": ["cafe", "coffee_shop", "restaurant"],
"alternates": null
},
"latitude": 41.8781,
"longitude": -87.6298,
"distance_meters": 420,
"vibe_match_score": 0.92,
"temporal_state": "PEAK",
"next_transition": 1716051600,
"tribe_density": 0.78,
"tribes": [
{
"tribe_id": "FOUNDER",
"label": "Founder",
"icon": "🚀",
"color": "#8B5CF6",
"rule_score": 0.8,
"embedding_score": 0.75,
"final_score": 0.775
}
],
"estimated_wait_minutes": 8,
"recommendation": "GO_NOW"
}
]
}/api/v1/places/:idGet details for a specific place by ID.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Required | Place UUID |
/api/v1/places/:id/enrichedGet place details with external enrichment data (photos, reviews, hours) if available.
/api/v1/places/nearbySearch for places within a radius of a coordinate.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
lat | number | Required | Latitude |
lon | number | Required | Longitude |
radius | number | Optional | Search radius in meters. Default: 1000 |
limit | integer | Optional | Max results. Default: 20 |
/api/v1/vibe/searchSemantic search by natural language description. Uses the V-Layer (semantic plane) only.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Required | Natural language description |
lat | number | Optional | Latitude |
lon | number | Optional | Longitude |
radius | number | Optional | Search radius in meters. Default: 2000 |
limit | integer | Optional | Max results. Default: 10 |
/api/v1/temporal/stateGet the current temporal state of places in an area. Understands how a place changes character throughout the day.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
placeId | string | Optional | Specific place ID |
lat | number | Optional | Latitude (for area query) |
lon | number | Optional | Longitude (for area query) |
time | string | Optional | Time in HH:MM format. Default: current time |
/api/v1/tribe/heatmapGet social density heatmap for a tribe segment. Uses Uber H3 hexagonal grid (resolution 9, ~0.1 km²).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tribe_id | string | Required | FOUNDER, STUDENT, CREATIVE, FOODIE, FITNESS, NIGHTLIFE, WELLNESS |
city | string | Optional | City name |
bounds | string | Optional | Bounding box: minLat,minLon,maxLat,maxLon |
limit | integer | Optional | Max heatmap cells. Default: 500 |
curl "https://api.thepolyhistor.com/api/v1/tribe/heatmap?tribe_id=FOUNDER&city=chicago&limit=100" \ -H "X-API-Key: your_api_key_here"
/api/v1/tribe/profilesList all tribe definitions with metadata and category mappings.
/api/v1/trip/planMulti-stop itinerary planning with nearest-neighbor routing.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Required | Trip theme: "food tour", "coffee crawl", "bar hop" |
city | string | Required | City name |
stops | integer | Optional | Number of stops. Default: 5 |
start | string | Optional | Start time HH:MM |
curl "https://api.thepolyhistor.com/api/v1/trip/plan?query=food+tour&city=nyc&stops=5&start=10:00" \ -H "X-API-Key: your_api_key_here"
Waitlist
Join the waitlist for early access. No API key required.
/api/v1/waitlistSubscribe to the waitlist. Returns success confirmation or error if already subscribed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Required | Full name |
email | string | Required | Email address |
source | string | Optional | Signup source for analytics (e.g., "waitlist_page") |
curl -X POST "https://api.thepolyhistor.com/api/v1/waitlist" \ -H "Content-Type: application/json" \ -d '{"name":"Ada Lovelace","email":"ada@example.com","source":"docs_page"}'{
"success": true,
"waitlist_id": "wl_abc123"
}/healthDeep health check — verifies database and Redis connectivity.
{
"status": "healthy",
"services": {
"database": "up",
"redis": "up"
}
}/health/pingInstant ping — responds immediately without checking dependencies. Use for load balancer health checks.
SDKs & Examples
We currently provide REST API access. Official SDKs are on the roadmap. In the meantime, here are copy-paste ready snippets for common patterns.
Unified Search
curl -G "https://api.thepolyhistor.com/api/v1/unified/search" \ -H "X-API-Key: your_api_key_here" \ --data-urlencode "query=romantic rooftop bar" \ --data-urlencode "city=nyc" \ --data-urlencode "limit=5"
Trip Planner
curl -G "https://api.thepolyhistor.com/api/v1/trip/plan" \ -H "X-API-Key: your_api_key_here" \ --data-urlencode "query=coffee crawl" \ --data-urlencode "city=sf" \ --data-urlencode "stops=4" \ --data-urlencode "start=09:00"
Error Reference
Polyhistor uses standard HTTP response codes.
| Code | Meaning | How to fix |
|---|---|---|
200 | OK | Success — parse the response body |
400 | Bad Request | Check parameter types and required fields |
401 | Unauthorized | Include a valid X-API-Key header |
429 | Too Many Requests | Wait for Retry-After seconds, then retry |
500 | Server Error | Retry with exponential backoff. Contact support if persistent. |
Error Response Format
{
"error": "Unauthorized",
"message": "Invalid or missing API key"
}Still have questions?
Join the Waitlist