Skip to main content
The TrendlineLabs Public API serves read-only prediction-market data across Polymarket, Kalshi, Limitless and predict.fun: events, markets, prices, order books, price history and trades, with every answer carrying its own freshness signal.

1. Get a key

API access is free, and our team approves each account.
  1. Sign in at trendlinelabs.ai and open API keys from your account menu (trendlinelabs.ai/developer).
  2. Choose Request API access. You can add a short note about what you are building.
  3. Once we approve it, the same page shows the key manager. Choose Create key, pick its scopes and copy the key.
Keys look like tl_live_ plus a secret. The secret is shown once, at creation, so store it somewhere safe. You can list and revoke your keys on the same page. Until access is granted, creating a key answers 403 access_not_granted.

2. Make your first request

Every request sends the key as a bearer token. Set it once:
Read your own key back, which needs no scope: The answer is examples/getKey.response.json: the key’s id, scopes, tier, and its limit per window_s seconds.

3. Walk from an event to a book

  1. List events: examples/listEvents.sh (.py, .mjs). Each event carries its universal_id.
  2. Read one event: examples/getEvent.sh. Its markets list carries each market’s universal_id.
  3. Read a market’s order book on one venue: examples/getOrderbook.sh.
Every example reads TRENDLINE_API_BASE and TRENDLINE_API_KEY from the environment, so the same file runs against any base you point it at.

4. What every answer carries

  • X-Request-Id: this request’s id. Send your own X-Request-Id and it is echoed; the error envelope’s request_id is the same value. Quote it when you ask for help.
  • Cache-Control: no-store on every operation’s answer (not on the reference document itself).
  • X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset once your key has passed the rate limiter (see Rate limits).
Next: Authentication, Errors, Freshness.

Examples on this page

getKey

Response

listEvents

Response

getEvent

Response

getOrderbook

Response