The data Trench uses · v1 API

The geopolitical graph,
queryable as a REST API.

A persistent ontology of countries, militant groups, leaders, places, and financial instruments, with every news item, financial move, whale trade, forecaster question, and seismic event linked to the entities they touch. The same data Trench consumes every 10 minutes to decide which conflict markets to trade; now available to your stack.

Want code instead of REST? The framework that builds this graph is open source as trench-core on GitHub and PyPI. pip install trench-core ships the OntologyStore class that backs every endpoint below, typed entities, alias resolver, event log, market linker, all stdlib + SQLite. Build your own graph from your own seed, or hit the API for ours.

What's in the graph

Static layer

Curated entities & relationships

74+ named entities (countries, groups, leaders, places, instruments) with stable IDs, aliases, and 65+ typed relationships (funds, hostile_to, allied_with, leading_indicator_for, located_in).

Dynamic layer

12 source types of live events

News from 70+ RSS feeds, Telegram OSINT, Twitter, financial moves on 11 instruments, Polymarket whale flow, Manifold/Metaculus forecaster consensus, USGS seismic data, and a curated geopolitical events calendar, all auto-tagged with the entities they touch.

Computed signals

Confluence scores per market

Source-diversity corroboration scores per Kalshi/Polymarket conflict ticker, distinct source-type count divided by 5, capped at 1.0. Updated every tick.

Real-time

Surge detection

Live event-volume surge alerts when an entity cluster sees 3× its baseline rate in 5 minutes, the same signal that triggers the trading bot to re-evaluate.

Endpoints

All endpoints are read-only. Anonymous tier (60 req/h per IP) is open; higher tiers require an API key passed as X-API-Key header.

GET/v1/ontology/healthHealthcheck + your rate limit status
GET/v1/ontology/entitiesFull entity list with event counts. ?type=country
GET/v1/ontology/entity/{id}Linked markets, recent events, graph neighbors
GET/v1/ontology/eventsEvent stream. ?entity=iran&source_type=financial
GET/v1/ontology/digestPer-cluster structured digest (the same one the bot reads)
GET/v1/ontology/confluence/{exchange}/{ticker}Per-market source-diversity confluence score
GET/v1/ontology/surgesLive event-volume surge detection
GET/v1/ontology/source-credibilityCurated source-type credibility tiers

Interactive Swagger docs →

Quickstart

Anonymous, no key needed:

curl https://trenchsignals.io/v1/ontology/entities?type=country

With a key (raises your rate limit):

curl -H 'X-API-Key: ts_xxxxxxxx' \\
  https://trenchsignals.io/v1/ontology/digest

Python:

import requests
r = requests.get(
    "https://trenchsignals.io/v1/ontology/confluence/kalshi/KXUSAIRANAGREEMENT-27-26JUL",
    headers={"X-API-Key": "ts_xxxxxxxx"},
)
print(r.json())  # → {score, source_type_count, source_types, ...}

Run the bot yourself

The graph is the data, the bot is the agent. The same code that produces every signal on /log ships as the trench-bot package. One command to install, one to configure, one to run a single analysis cycle.

pip install trench-bot          # PyPI publish pending; today: pip install -e . from the repo
export ANTHROPIC_API_KEY=sk-ant-...
trench-bot init                  # writes ~/.trench/config.toml
trench-bot run --tick-once       # one cycle, exits cleanly

Defaults are paper-trade mode, $1,000 paper bankroll, Claude Haiku for cheap first-touch (under $0.05 per cycle). State persists under ~/.trench/. Real trading needs --live plus Kalshi or Polymarket credentials.

Methodology, config reference, and the going-live guide live in the package README. The open-source scoring stack (trench-core, MIT) ships separately as the framework trench-bot depends on.

Tiers

Anonymous
Free
60 requests / hour / IP
  • All read endpoints
  • No signup
  • Per-IP rate limit
Try it →
Enterprise
Custom
Unlimited / dedicated
  • Webhook event push
  • Custom entity seeding
  • SLA
  • Dedicated graph instance
Talk to us →

How it stays current

The graph is fed by an autonomous bot that polls 70+ news feeds, Telegram channels, Twitter, financial markets (11 instruments), Polymarket whale flow, Manifold/Metaculus forecasters, USGS seismic data, and a curated calendar, every 10 minutes. Each event is tagged with the entities it touches via a deterministic alias resolver covering 200+ proper-noun terms. Source-type credibility weights drive the confluence scoring.

For more detail on how the engine works, see the About page on the live dashboard.