REST API

PEPIndex API

Trade Policy Intelligence API & Tariff Risk Data Feed

Photo by Tyler on Unsplash

Base URL: https://api.pepi.apiautomations.com
Free endpoints require no API key. Standard and Premium endpoints require an X-API-Key header.
Interactive docs: Swagger UI · ReDoc · OpenAPI spec (openapi.json)
Get an API key →

Authentication

Pass your API key in the request header:

X-API-Key: pepi_std_your_key_here

Key prefixes: pepi_std_ for Standard tier, pepi_pro_ for Premium tier.

Free endpoints — no key required

MethodPathDescription
GET /api/v1/index Current settled index value (resolved events), 30-day trend, 90-day trend, active event count. The dashboard headline also adds pressure from overdue threats; that live value is in /api/v1/snapshot as index.live_value
GET /api/v1/stats Aggregate stats: total events, average score, chicken rate %, most-targeted entities
GET /api/v1/snapshot Free teaser snapshot — the index (index.value settled, index.live_value live), the live_pressure block (overdue threats and their pressure), stats, branch reaction, government workforce trends, and event summaries with outcome provenance. Paid arrays (price/sector impact, tariff rates, indicators) require a key — full payload via /api/v1/snapshot/full (Standard)
GET /api/v1/index/branch/{branch} Government-branch reaction sub-index (judicial or congressional) — 0–100 recency-weighted activity intensity from public court dockets and Congress.gov, with 30d/90d trends and activity counts. Congressional activity counts the bills threats name and the joint resolutions Congress files in response (emergency terminations, rule disapprovals), with recorded votes and Congressional Budget Office cost estimates; the congressional response adds cbo_estimates_30d and related_bills
GET /api/v1/labor/government Government workforce trends from the monthly labor data: federal, federal excluding the Postal Service, state and local government payrolls, and federal job openings, hires, quits and layoffs — latest, 1-month, 12-month and since-January-2025 change, 24 months of history, and the tracked threats aimed at government workers
GET /api/v1/sources/status Live source freshness — per source: last_changed (data through: newest reference period) and last_ingested (when the pipeline last pulled). No key required.
GET /api/v1/status/api-health Per-endpoint API health from the post-deploy probe — ok / gap / slippage / drift / breakage per endpoint, plus data-through dates. Powers the public status page. No key required.
GET /health API health check

Sample response — /api/v1/index

{
  "value": 31.4,
  "trend_30d": 13.5,
  "trend_90d": -2.1,
  "active_events": 42,
  "resolved_30d": 14,
  "as_of": "2026-10-11"
}

value is the settled composite index (0–100), built from resolved events. trend_30d / trend_90d are the change in value versus 30 and 90 days ago. as_of is the publication date of the latest index. The live headline shown on the dashboard is index.live_value in /api/v1/snapshot. Domain sub-indices are served by the Standard-tier /api/v1/index/domain/{domain} endpoint.

Sample response — /api/v1/index/branch/congressional (abridged)

{
  "value": 0.0,
  "trend_30d": 0.0,
  "trend_90d": 0.0,
  "activity_30d": 0,
  "resolutions_30d": 0,
  "cbo_estimates_30d": 0,
  "as_of": "2026-10-11",
  "related_bills": [
    {
      "bill": "H.J.Res. 150",
      "url": "https://www.congress.gov/bill/119th-congress/house-joint-resolution/150",
      "title": "Terminating the national emergency declared to impose global tariffs.",
      "status": "pending",
      "latest_action_date": "2026-02-17",
      "latest_action": "Referred to the House Committee on Foreign Affairs.",
      "linked_threats": 3,
      "relation": "response",
      "cbo_estimates": 0
    }
  ]
}

relation is named_by_threat (a bill a threat itself names) or response (a resolution Congress filed in answer to a threat). A response adds to the reaction index but never decides a threat's outcome. A 0.0 value means no congressional action in the last 30 days.

Sample response — /api/v1/labor/government (abridged)

{
  "as_of": "2026-09-01",
  "turnover_as_of": "2026-08-01",
  "baseline": "2025-01-01",
  "measures": [
    {
      "key": "federal",
      "label": "Federal government",
      "group": "payroll",
      "unit": "thousands",
      "latest": {"date": "2026-09-01", "value": 2682.0},
      "change_1m": {"change": -1.0, "pct": -0.04, "from": "2026-08-01"},
      "change_12m": {"change": -232.0, "pct": -7.96, "from": "2025-09-01"},
      "change_since_baseline": {"change": -328.0, "pct": -10.9, "from": "2025-01-01"},
      "series": [{"date": "2024-10-01", "value": 3013.0}, "…"]
    }
  ],
  "related_threats": [{"id": "TACO-2026-0828", "name": "…", "threat_date": "2026-06-10", "domain": "domestic", "status": "resolved", "outcome": "full_implementation"}],
  "related_threats_total": 5
}

Measures: federal, federal_ex_postal, state, local (payrolls), and federal_job_openings, federal_hires, federal_quits, federal_layoffs (turnover, which publishes about a month after payrolls — hence turnover_as_of). Display data: it does not feed any score.

Code examples — /api/v1/index (free, no key)

curl

curl https://api.pepi.apiautomations.com/api/v1/index

JavaScript (fetch)

const res = await fetch("https://api.pepi.apiautomations.com/api/v1/index");
const index = await res.json();
console.log(index.value, index.as_of);

Python (requests)

import requests

r = requests.get("https://api.pepi.apiautomations.com/api/v1/index")
r.raise_for_status()
index = r.json()
print(index["value"], index["as_of"])

Authenticated request (Standard / Premium) — pass your key in the X-API-Key header:

curl -H "X-API-Key: pepi_std_your_key_here" \
  "https://api.pepi.apiautomations.com/api/v1/events?domain=trade&limit=20&offset=0"

Rate limits

Daily limits are enforced per API key per calendar day and reset at midnight UTC. Each key also has a short-window burst limit. Free endpoints are throttled per IP.

TierKey prefixRequests / day
Free— (no key)Per-IP throttle on public endpoints
Standardpepi_std_1,000
Premiumpepi_pro_10,000

List endpoints (e.g. /api/v1/events) support limit, offset, and sort query parameters for pagination.

Errors

Auth and rate-limit errors return a structured detail object with an error code and a human-readable message; some include extra hints (docs, upgrade, resets_at). A 429 also carries a Retry-After header.

Statuserror codeMeaning
401api_key_required / invalid_api_keyNo key supplied, or the key is not recognised
403insufficient_tier / key_inactiveKey valid but tier too low for the endpoint, or deactivated
403unavailable_in_regionPEPIndex is not offered in certain jurisdictions; requests from them are refused
404—Resource not found (e.g. unknown event_id)
429rate_limit_exceededDaily request limit for the key's tier reached (resets at midnight UTC)
429burst_limit_exceededToo many requests in a short window; wait for the Retry-After seconds
500—Server error

Example — 401 when no key is supplied:

{
  "detail": {
    "error": "api_key_required",
    "message": "An API key is required. Include it as: X-API-Key: ",
    "docs": "https://pepi.apiautomations.com/docs#authentication"
  }
}

Example — 429 when the daily limit is reached:

{
  "detail": {
    "error": "rate_limit_exceeded",
    "message": "Daily limit of 1000 requests reached.",
    "resets_at": "midnight UTC"
  }
}

Standard tier — pepi_std_ key

MethodPathDescription
GET/api/v1/index/historyDaily index time series with domain breakdowns (trade, foreign_policy, domestic, rhetorical)
GET/api/v1/index/domain/{domain}Sub-index for a single domain
GET/api/v1/eventsPaginated events with filters: domain, status, min_score, sort, limit, offset
GET/api/v1/events/{event_id}Full event detail: threat text, timeline, analyst notes, confidence, statutory authority
GET/api/v1/events/{event_id}/federal-registerLinked Federal Register documents (EOs, proclamations, tariff schedules)
GET/api/v1/events/{event_id}/timelineChronological lifecycle: threat → escalation → deadline → action → outcome
GET/api/v1/events/{event_id}/sector-impactPer-sector (COICOP-3) consumer price impact derived from the event's applied tariff rates
GET/api/v1/sector-reactionsCross-event sector reaction rollup — per sector ETF, threat-day and threat→outcome moves relative to the S&P 500, ranked by reactivity
GET/api/v1/tariff-ratesLatest applied rates by country (weighted avg, HS chapter count, data_as_of)
GET/api/v1/tariff-rates/detailPer-HS-2 chapter applied rates for a single country
GET/api/v1/economic-indicatorsBLS + FRED time series: CPI, PPI, employment cost, dollar index, yields
GET/api/v1/economic-statsAggregate trade stats: avg tariff gap, total CPI contribution, consumer burden
GET/api/v1/research-sourcesMethodological bibliography
GET/api/v1/courtsCourt registry — the courts whose opinions are tracked: the trade courts, the Supreme Court and the courts hearing executive-order litigation

Premium tier — pepi_pro_ key

MethodPathDescription
GET/api/v1/events/{event_id}/tariff-ratesTime series of statutory vs. applied rates + gap per event
GET/api/v1/events/{event_id}/price-impactDaily four-group price impact (imported affected/unaffected, domestic affected/unaffected)
GET/api/v1/events/{event_id}/economic-impactFull impact: tariff gap, CPI contribution, consumer incidence, distributional burden
GET/api/v1/events/{event_id}/market-impactMarket data around threat/outcome: S&P 500, VIX, and consumer, industrial and emerging-market sector ETFs
GET/api/v1/events/{event_id}/taco-tradeTACO trade return: threat/low/outcome prices, hold days, annualized return
GET/api/v1/events/{event_id}/sector-reactionPer-event sector reaction: threat-day and threat→outcome move per sector ETF, each relative to the S&P 500

Event provenance

Every scored event is auditable. For a given event_id, these endpoints return its primary-source lineage so you can verify the score independently:

See validation & backtesting for the calibration events and external benchmarks behind the scoring.

Sample notebook

A runnable Jupyter quickstart that hits the free endpoints with requests and pandas is in the repo at notebooks/pepi-quickstart.ipynb.

Event alerts — free

Subscribe to be notified when a new threat event is detected or a tracked event resolves. Double opt-in — nothing is sent until the confirmation email is clicked. One digest email per pipeline cycle (never per-event floods), plus optional per-event webhook POSTs signed with X-PEPI-Signature: sha256=<HMAC-SHA256 over the raw body> (the signing secret is returned once at subscribe). Payloads carry the same teaser-safe fields as the free snapshot. Unsubscribe is one click from any email footer.

POST https://api.pepi.apiautomations.com/api/v1/alerts/subscribe
Content-Type: application/json

{
  "email": "you@example.com",
  "min_severity": 60,                  // 0–100 floor; omit for all events
  "domains": ["trade"],                // omit for all domains
  "webhook_url": "https://example.com/pepi-hook"   // optional, https only
}

Snowflake Marketplace — free live sample

PEPIndex is also on the Snowflake Marketplace as a free live sample: the last 30 days of events (teaser columns), 90 days of the daily index, the re-threat lineage view, the economic sample for the documented 2018–2026 calibration benchmark events, court filings and court-verified outcomes, and the research bibliography. It refreshes daily. Full history and the live economic stack are served by this REST API (see pricing); private full-dataset Snowflake shares and clean-room arrangements are available for enterprise — data@apiautomations.com.

Key self-service

Buy a Standard or Premium key from the API tab on the dashboard (Stripe checkout; the key is emailed on payment). To request a key for review instead (research, press, evaluation), POST:

POST https://api.pepi.apiautomations.com/api/v1/keys/request
Content-Type: application/json

{
  "name": "Your Name",
  "email": "you@example.com",
  "organization": "Your Organization",
  "use_case": "Brief description of intended use",
  "tier_requested": "standard"
}
Ready to get started?
The free /api/v1/index endpoint requires no key. For events, history, and tariff data, see pricing & tiers or get a Standard key.