Skip to content

OverviewCore concepts

Three levels of grouping exist in the catalog, and confusing them is a common source of integration bugs. Prediction markets, briefly defines the terms; this page covers the verbs.

LevelWhat it isVerbs
MarketOne question, holding its outcomesfetchMarkets, fetchMarket
EventA group of related marketsfetchEvents, fetchEvent, fetchEventMetadata
SeriesA recurring group of eventsfetchSeries

Order books and candles key on the outcome, one level below all of these. Selecting an outcome is always the last step before asking for depth or history.

Event and series lexical searches use the same reviewed synonyms as market lexical search. Event semantic and hybrid search remain unsupported.

An event ties related markets together — an election with a market per candidate, or a fixture with a market per result. Reading at the event level is how you get the whole question rather than one slice of it.

Every event record includes createdAt, the venue’s creation instant as an RFC 3339 string normalized to UTC with millisecond precision, or null. For a real event, it is the single distinct valid parent creation instant among its matched members. Missing member dates do not veto known parent evidence. No validated parent date, or conflicting parent instants, yields null. An event never takes the earliest child creation date as its own. A singleton event uses its market’s createdAt.

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

fetchEvents accepts the same list parameters as fetchMarkets — limit, cursor, status, query, category — and paginates the same way.

fetchEvents and fetchEventsPaginated accept undated=exclude|include|only. The mode filters member markets before grouping; event counts, volume sums, ranking and child projection use the resulting members.

  • exclude is the default. A member with no stored close date is excluded when either closeAfter or closeBefore is set. Without bounds, it remains included.
  • include keeps those undated members alongside dated members that pass the exclusive bounds.
  • only selects undated members and rejects either close bound with 400 VALIDATION_ERROR.

An explicit accepted mode appears as meta.undated, including empty and continuation pages. Omitting the mode adds no echo and preserves existing behavior. Keep the mode and bounds unchanged while following a cursor. A cursor from a different mode is refused; restart from page one. fetchEvent and fetchSeries do not gain this list option.

This does not add a venue-native event identity where none is stored: such markets retain the catalog’s existing singleton grouping. Venue and status restrictions still apply.

Event lists (fetchEvents and fetchEventsPaginated) return at most marketsLimit child markets per event. The default is 20, and valid values range from 1 to 100.

marketCount counts all matching members before the cap. marketsTruncated is true when some matching members were left out. Aggregates, taxonomy, creation dates, freshness and provenance use every matching member, including omitted members.

Use the event’s venue with fetchMarkets?eventId=... and the same filters to page the remaining markets. fetchEvent and fetchSeries stay complete. The cap is bound into the event cursor, so keep marketsLimit unchanged while paging. Omitting the cap and explicitly setting marketsLimit=20 are equivalent.

fetchEvents and fetchEventsPaginated default to sort=volume with sortDir=desc. Events rank by the sum of known native volume24h values from members that pass the request filters. The ranking score is null when every member value is unknown. A non-finite sum also counts as unknown; zero remains known. Nulls sort last in both directions. Equal scores use ascending code-point order of the group identity: evt:{venue}:{eventId} for real events or mkt:{marketPrimaryKey} for singletons.

All matching groups are ranked before the event page is selected, independently of marketsLimit. For example, members with volumes [60, 60] rank ahead of [100] in descending order because their sum is 120.

A cursor opened under a different sort order is refused with 400 VALIDATION_ERROR. Restart from the first page without a cursor.

Every market record carries what Predictefy stores about its parent event, so a market list can be grouped or labelled by event without a second request:

  • eventId: the venue’s identifier for the event. It is omitted when none is stored.
  • eventTitle: the event’s own title as the venue states it, or null when none is stored.
  • eventSlug: the event’s own slug as the venue states it, or null when none is stored. Some venues publish no event slug.
  • displayTitle: the title to show in a UI. It is the event name and the market title, or the market title alone when that title already names the event or no event name is known. Multi-leg combo markets keep their own title.

fetchEvent accepts the eventId as eventId and the eventSlug as slug. A market’s title can combine the event and the question, as in Event - Question, so read the event’s name from eventTitle rather than splitting title, and its slug from eventSlug rather than parsing url. Show displayTitle instead of title in UIs, because a market titled by its type, such as Match Winner, gains the event name and reads as BLG vs TI: Match Winner. url is the venue’s page for the market. Some venues link only to their home page, and a Polymarket market whose event slug is unknown links to https://polymarket.com.

A series is a recurring grouping: the same question asked on a schedule, such as a monthly rate decision. fetchSeries is catalog-derived rather than venue-published.

Not every venue has the concept. On a venue without it, fetchSeries returns an empty list rather than an error — the request succeeded and the answer is that this venue does not organise markets that way. Do not treat an empty series list as a failure.

fetchEventMetadata returns the venue’s own metadata for a single event. It is Kalshi-only and not available on router — it exposes a venue-native structure that has no cross-venue equivalent, so there is nothing sensible for the router to union.

Calling it on another venue returns an honest NOT_SUPPORTED rather than an empty object.

  • Use markets when you want one question and its prices.
  • Use events when you want a whole contest, and when you want to avoid showing a user one candidate’s market without its siblings.
  • Use series to find recurring questions over time, then read the events within them.
  • Use matched clusters when you want the same real-world question across different venues — that is a different relationship from an event, and is Predictefy’s own matching rather than a venue’s grouping.