Skip to content

OverviewIntroduction

Open your project in a coding agent that can read URLs, edit files, and run commands. Copy this prompt and paste it into your agent — the skill it points at carries the setup steps:

Set up Predictefy in this project using this skill: https://docs.predictefy.com/.well-known/agent-skills/predictefy/skill.md

The agent will prepare your integration and verify it with a small authenticated market request. If you do not have an API key yet, it will guide you to create one and enter it locally. Sign-in, key creation, and any required client reload are guided steps. The verification request uses API credits.

For chat-client configuration and reusable skill installation, see AI agents. To set up manually, follow the steps below.

Use these canonical production origins directly:

SurfaceOrigin
REST readshttps://data.predictefy.com
REST executionhttps://exec.predictefy.com
WebSocket streamingwss://stream.predictefy.com

REST examples below use the reads origin. Execution operations in the REST API reference declare the isolated execution origin themselves. WebSocket clients append /v1/stream; see the WebSocket API reference.

Terminal window
export PREDICTEFY_API_URL="https://data.predictefy.com"

Every request is authenticated and metered against your credit balance. Anonymous requests receive 401 UNAUTHORIZED (only the health endpoints and docs are open).

Keys are created in the Predictefy developer dashboard. Sign-up is free during the private beta: every new account starts on the Free plan with 25,000 credits, topped up to 25,000 at the start of each UTC month; unused allowance does not carry over. The top-up is applied within a minute of 00:00 UTC. Trading with your own funds ships on every plan, Free included. Feature access follows your plan from the first request: a Free key gets Free’s caps and 403 PLAN_REQUIRED on the features Free does not include. Cross-venue matching, with each matched pair’s price difference, is on every plan, bulk requests start at Builder, and the arbitrage feed, the /v1/discrepancies price-gap feed and history replay start at Pro. Every plan meters all usage in credits, so upgrade when you need more volume. See Pricing, credits & billing.

Portal sign-in uses Privy with email or wallet; wallet-only accounts are asked to link an email during onboarding. The portal shares its sign-in with the Predictefy terminal: being signed in on one means being signed in on the other, and an X- or wallet-only terminal sign-in is asked to add an email or to switch to the email account you use here. If that email already signs in to a Predictefy account, choose I already sign in with an email on that screen: the fresh wallet-only sign-in is removed (it holds no account, credits, or keys), you sign in with the email, and you link the wallet again from Settings → Sign-in methods. Accounts are never merged automatically.

  1. Sign up (or sign in) via Privy, with your email address or wallet.
  2. Open API keys and choose Create API key. Signing in never creates a key automatically.
  3. Copy the raw pk_live_… value when it appears. Only a hash authenticates it; the console keeps an encrypted copy so API keys can show the full key again later (eye icon), and Regenerate on a key swaps it for a fresh one with the same name.

Treat the key like a password: send it only in the Authorization header, never in URLs (query strings leak into request logs).

List the three highest-volume active Polymarket markets:

Terminal window
curl -s "$PREDICTEFY_API_URL/api/polymarket/fetchMarkets?limit=3&sort=volume" \
-H "Authorization: Bearer pk_live_YOUR_KEY"

Successful responses are always enveloped as { success, data, … }:

{
"success": true,
"data": [
{
"marketId": "…",
"title": "…",
"outcomes": [{ "outcomeId": "…", "label": "Yes", "price": 0.62 }],
"volume24h": 123456.78,
"liquidity": 98765.43,
"url": "https://…",
"asOf": "2026-07-03T09:15:00.000Z",
"provenance": { "source": "overlay" },
"capabilities": { "read": true, "trade": false, "depth": true, "history": false }
}
],
"meta": { "asOf": "2026-07-03T09:15:00.000Z", "provenance": { "source": "overlay" } },
"page": { "limit": 3, "offset": 0, "total": 1519, "hasMore": true, "nextCursor": "…" }
}

Three honest-data fields ride on every record:

  • asOf — when the data was snapshotted (never pretend-fresh).
  • provenance.source — where it came from. The full enum is venue-rest, predictefy-live, fixture, overlay, archive, predictefy-store, glide, and lifi; live catalog reads currently report overlay on both the market record and response meta.
  • capabilities — what this venue actually supports (read / trade / depth / history). trade is false on these reads records; public execution availability is documented separately for each supported venue. The history flag is conservative — it flips on per venue as coverage is proven, while the fetchOHLCV endpoint is already live.

Swap the exchange segment for any of the 16 served venues, or use router to search across all of them at once:

Terminal window
curl -s "$PREDICTEFY_API_URL/api/router/fetchMarkets?query=election&status=active" \
-H "Authorization: Bearer pk_live_YOUR_KEY"

List verbs accept limit (max 100 — fetchArbitrage is the exception, at max 500), offset, page, and cursor pagination. Follow the response’s nextCursor for each page.

Market cursors capture membership and order at cursor creation. Later pages serve the current contents of those rows in that order. Deleted rows consume their captured positions. Inserts, sort changes, and status updates cannot change the walk. A market walk covers at most 5,000 markets. Semantic and hybrid walks cover at most 5,000 results. Lexical walks report the full matching total when counted; total is null if counting times out. Hot-catalog walks retain their snapshot and its capture time. A market cursor is valid for a fixed time from page one; if it expires, restart from page one.

Offsets above 10,000 are rejected. Snapshot/offset cursors are signed; if a cursor fails validation, restart the walk from page one.

Terminal window
# Page 1
curl -s ".../api/kalshi/fetchMarkets?limit=100" -H "Authorization: Bearer pk_live_…"
# Page 2 — pass the previous response's nextCursor
curl -s ".../api/kalshi/fetchMarkets?limit=100&cursor=CURSOR_FROM_PAGE_1" \
-H "Authorization: Bearer pk_live_…"

Cursors expire 60 seconds after issuance by default, measured per page hop. Set snapshotTTL in milliseconds on page 1. For filtered or other non-default requests, a value up to 86,400,000 ms is honored, and 0 disables the per-hop expiry. On fetchArbitrage walks, a replaced page’s snapshot is kept for up to ten minutes (600,000 ms) by default; the service may keep a page for less, and the expiry error states the actual lifetime it had. On those walks snapshotTTL is capped at 600,000 ms and 0 means that cap, not forever. An expired cursor answers 400 VALIDATION_ERROR with the message Cursor has expired: this page's snapshot was kept for <N> s; fetch the next page sooner, raise snapshotTTL on page 1 (up to <cap> ms), or restart without a cursor (cap: 600000 ms on fetchArbitrage walks, 86400000 ms on other requests). The caller must discard the partial walk and restart from page 1 without a cursor. The final page omits nextCursor.

page.total can be null. The data page is the product and the total is only metadata, so a count that overruns its own short budget is abandoned and your page is still served — rather than failing the whole request over a number. null means “not counted”, never “zero matches”, and meta.totalUnavailable says so explicitly. Drive your loop with hasMore / nextCursor, not with total: hasMore is decided by fetching one row past your limit, so it stays correct whether or not the total was computed.

Every error — 4xx or 5xx — uses one shape:

{
"success": false,
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "…",
"retryable": false,
"requestId": "…"
}
}

code, message, retryable, and requestId are always present — treat anything else as optional.

The most common codes:

HTTPcodeMeaningRetry?
400VALIDATION_ERRORBad or missing parameters.no
400NOT_SUPPORTEDAccepted-but-unsupported capability (honest gap).no
401UNAUTHORIZEDMissing, unknown, or revoked API key.no
402INSUFFICIENT_CREDITSBalance below the endpoint weight — see credits & plans.after balance update
403PLAN_REQUIREDThe account does not include this route or history window.after access update
404EXCHANGE_NOT_AVAILABLE, MARKET_NOT_FOUND, EVENT_NOT_FOUND, OUTCOME_NOT_FOUNDUnknown or unserved venue, or unknown record.no
429RATE_LIMITEDPer-key or per-plan request-rate window exceeded.yes (back off)
501NOT_SUPPORTEDVenue has no public feed for this verb (e.g. trades tape).no
503EXCHANGE_NOT_AVAILABLEA served venue’s own upstream failed.yes (backoff)
503CATALOG_UNAVAILABLE, PLATFORM_UNAVAILABLE, HISTORY_UNAVAILABLE, BILLING_UNAVAILABLETemporary outage — fail-closed, never silently wrong.yes (backoff)

EXCHANGE_NOT_AVAILABLE is the one code that carries two statuses: 404 for a venue this deployment does not serve (unserved, unknown, or sandbox), and 503 when a served venue’s own upstream fails. Branch on the status, not on the code alone.

API_KEY_LIMIT applies to creating a key in the developer dashboard when the plan’s key cap is reached; reads and execution operations do not emit it.

The full code enum per endpoint is in the API reference.