API Documentation
Access Political Temperature Index data programmatically. A free, open API for the current US political climate, top drivers, and breaking events.
Base URL
https://politicaltemperature.com/apiAuthentication
No API key required. All endpoints are free and open.
Rate Limits
Responses are cached (15 min default). Please limit requests to 60 per minute.
Endpoints
/api/temperatureReturns the current published temperature score with sub-index breakdown, coverage stats, momentum, and a 30-day trend array.
Parameters
No query parameters.
{
"current": {
"date": "2026-03-17",
"temperature": 52,
"rawTemperature": 51.3,
"label": "Warm",
"delta": 2.1,
"momentum": { "value": 1.5, "trend": "stable" },
"volatility": 3.2,
"summary": "Political tension rose slightly...",
"isProvisional": false,
"subScores": {
"rhetoricHeat": 38,
"coveragePolarization": 55,
"volumeSignal": 60,
"legislativeFriction": 42
},
"coverage": {
"articles": 1200,
"socialPosts": 850,
"leftPct": 35,
"rightPct": 40,
"centerPct": 25
}
},
"trend": [
{ "score_date": "2026-02-15", "temperature": 48, "label": "Warm" },
{ "score_date": "2026-02-16", "temperature": 50, "label": "Warm" }
]
}curl https://politicaltemperature.com/api/temperature/api/driversReturns the top stories driving the temperature score, ranked by heat contribution. Each driver includes headline samples, story count, and left/right/center coverage split.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| period | string | No | "day" (default) for today's drivers, or "week" for a 7-day aggregate with daysActive count. |
{
"period": "day",
"date": "2026-03-17",
"drivers": [
{
"rank": 1,
"name": "Senate Budget Vote",
"storyCount": 45,
"heatContribution": 18.5,
"headlines": [
"Senate passes budget resolution...",
"Democrats and Republicans clash..."
],
"contextSummary": "The Senate voted 51-49...",
"coverage": {
"left": 40,
"right": 45,
"center": 15,
"skew": 0.05
}
}
]
}curl https://politicaltemperature.com/api/drivers
curl https://politicaltemperature.com/api/drivers?period=week/api/summaryReturns AI-generated narrative summaries describing the current political climate. Summaries include temperature context, active events, and top drivers.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| date | string | No | Date in YYYY-MM-DD format. Defaults to today. |
| type | string | No | "morning", "evening", "breaking", or "all" (default). Controls which summary types to return. |
{
"date": "2026-03-17",
"morning": {
"id": "abc123",
"date": "2026-03-17",
"type": "morning",
"summary": "Political tension sits at 52 this morning...",
"generatedAt": "2026-03-17T11:05:00Z",
"context": {
"temperature": 52,
"momentum": 1.5,
"weekHigh": 58,
"weekLow": 45
}
},
"evening": null,
"breaking": [],
"all": [...]
}curl https://politicaltemperature.com/api/summary
curl "https://politicaltemperature.com/api/summary?date=2026-03-15&type=morning"/api/breaking-eventsReturns breaking political events detected in the last 24 hours. Filtered to critical, major, and moderate severity. Limited to 5 most recent.
Parameters
No query parameters.
[
{
"id": "evt_001",
"title": "Senate Passes Major Legislation",
"severity": "major",
"eventCategory": "legislative",
"heatBoost": 8.5,
"detectedAt": "2026-03-17T14:30:00Z",
"description": "The Senate passed...",
"contextSummary": "This vote marks..."
}
]curl https://politicaltemperature.com/api/breaking-events/api/metricsReturns source coverage metrics including article match rates, source distribution by bias and reliability, and recommendations for improving coverage.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| days | number | No | Number of days to analyze (1-30). Defaults to 7. |
{
"period": {
"start": "2026-03-10",
"end": "2026-03-17",
"days": 7
},
"summary": {
"totalArticles": 8400,
"matchedArticles": 7200,
"matchRate": 0.857,
"uniqueSources": 72,
"uniqueUnmatchedDomains": 15
},
"sourceDistribution": {
"byBias": { "left": 35, "center": 30, "right": 35 },
"byReliability": { "high": 60, "medium": 30, "low": 5, "unknown": 5 }
},
"recommendations": ["Consider adding source X"]
}curl https://politicaltemperature.com/api/metrics
curl https://politicaltemperature.com/api/metrics?days=30/api/exportDownload temperature data as CSV or JSON. Supports date ranges up to 365 days, with optional sub-scores and driver data. Responses include Content-Disposition headers for direct file download.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| format | string | No | "csv" or "json" (default: "csv") |
| from | string | Yes | Start date (YYYY-MM-DD) |
| to | string | Yes | End date (YYYY-MM-DD) |
| sub_scores | string | No | Include 5 sub-index scores (default: "true") |
| drivers | string | No | Include top driver names per day (default: "false") |
[
{
"date": "2026-03-01",
"temperature": 52,
"label": "Warm",
"delta": 2.1,
"rhetoric_heat": 38,
"coverage_polarization": 55,
"volume_signal": 60,
"legislative_friction": 42,
"story_intensity": 48,
"article_count": 1200,
"social_post_count": 850
}
]curl "https://politicaltemperature.com/api/export?format=csv&from=2026-03-01&to=2026-03-31"
curl "https://politicaltemperature.com/api/export?format=json&from=2026-03-01&to=2026-03-31&drivers=true"/api/healthReturns system health status including latest temperature, recent job execution, data freshness, and score validation.
Parameters
No query parameters.
{
"status": "healthy",
"timestamp": "2026-03-17T15:00:00Z",
"checks": {
"latestTemperature": { "value": 52, "date": "2026-03-17", "ok": true },
"staleJobs": { "count": 0, "ok": true },
"scoreValidation": { "allValid": true, "issues": [] },
"dataFreshness": {
"hoursSinceLastArticle": 1.2,
"hoursSinceLastScore": 3.5,
"ok": true
}
}
}curl https://politicaltemperature.com/api/healthRSS Feed
We also provide an RSS 2.0 feed of daily temperature readings, compatible with all major feed readers.
GET /api/rssData Export
Download up to 365 days of temperature data as CSV or JSON via the /api/export endpoint, or use the interactive Data Export page with preview and column selection.
Questions?
For API questions, bug reports, or feature requests, use our contact form or email us at politicaltemperature@proton.me.