layer docs

API reference

Base URL: https://layer-eight.vercel.app. All responses are JSON.

Authentication

Every endpoint except /v0/health needs a key from your dashboard:

authorization: Bearer lyr_your_key

x-api-key: lyr_your_key also works. Each key allows 60 requests per minute.


GET /v0/matches

Every live match, soonest event first. Use it to discover what Layer can answer.

Query Default Meaning
limit 50 1–200
category all e.g. sports, economics, politics, crypto

Response

Field Meaning
count Number of matches returned.
matches[].kalshi The Kalshi market (see Market object).
matches[].polymarket The Polymarket market.
matches[].event_date The day the event happens (YYYY-MM-DD).
matches[].category Layer's category for the event.
matches[].confidence 0–1. 1 when a person approved the match.
matches[].basis identical or equivalent_with_caveats.
matches[].caveats Which rules differ (see Overview).
matches[].tier human_verified or auto_verified.

GET /v0/match

The twin of one market on the other venue.

Query Required Meaning
venue yes kalshi or polymarket — the venue of the id you pass.
market_id yes Kalshi: the market ticker. Polymarket: the conditionId, market slug, or numeric id.

Match found

Field Meaning
source_market The market you asked about.
matched_market Its twin on the other venue.
side Always same: YES on one pays like YES on the other.
tier, confidence, basis, caveats As in /v0/matches.
match_reason Who approved it and which outcomes were paired.
checked_at When this answer was produced.

No match — matched_market is null and reason says why:

reason Meaning
not_indexed Layer doesn't know this id, or the market has closed.
no_candidate Layer found nothing on the other venue that could be the same bet.
pending_review A possible match exists but hasn't been approved yet.
rejected A possible match was checked and is not the same bet.
outcome_unmapped The events match, but this particular outcome has no twin.
rules_changed_pending_review A venue edited its rules since approval; re-checking.
specify_outcome This Polymarket market has two named sides; pass <conditionId>:0 or <conditionId>:1.

Market object

Field Meaning
venue kalshi or polymarket.
market_id The id to use with the venue's own API.
group_id The venue's event id (Kalshi event ticker, Polymarket event slug).
event The event's full title.
question The market's own question.
outcome The outcome this contract pays on.
slug, yes_token_id Polymarket only: the market slug and the CLOB token id for YES — what you trade with.

GET /v0/health

No key needed. Is the API up and can it reach its database?

{
  "ok": true,
  "database": { "reachable": true, "ms": 62 },
  "venues": {
    "kalshi": { "open_events": 12587, "open_markets": 125458, "last_pull": "…" },
    "polymarket": { "open_events": 42935, "open_markets": 364647, "last_pull": "…" }
  },
  "live_market_pairs": 14
}

Errors

Status error When
400 bad_request Missing or invalid query parameters.
401 unauthorized No key, or the key is unknown or revoked.
429 rate_limited Over 60 requests/minute. Wait retry-after seconds.
503 database_not_configured / database_unreachable Layer can't reach its database.