API call specifications for events

This article explains how to use the Events section of Cortex to create dynamic pre-match, in-play and post-match fixture information for your websites and apps, independent of external data providers. The document then exemplifies the structure of the API call required to fetch that fixture information.

Introduction

While several data providers can be used to source match and event data for websites and apps for most events, rights holders often want to provide similar information regarding events that are not covered by the major data providers, such as pre-season friendlies and under-21's matches.

For this reason, Cortex provides an Events facility to create your own dynamic pre-match, in-play and post-match real-time feeds to your fanbase, like this:

This document firstly provides an overview of the API constructs that will fetch the data used to generate a page of events like this one, then it shows the event creation process in the Cortex platform.

Events - API call constructs

Below are the API calls that may be used to fetch an event or events.

To fetch all events:

💻

GET {environment-id}/v2/public/clients/{clientId}/events

In which:

{environment-id} is the URL shown below, depending on environment used.

{clientId} is your client ID, assigned during onboarding.

💻

GET https://events.cortextech.io/v2/public/clients/DEMO/events

To fetch an individual event, by ID:

💻

GET {environment-id}/v2/public/clients/{clientId}/events/{eventId}

In which:

{environment-id} and {clientId} are as described above.

{eventId} is the identifier for an individual event. This ID can be obtained from the API described above, or from the Cortex platform.

💻

GET https://events.cortextech.io/v2/public/clients/DEMO/events/655c9d9e96549de1ed8a1612

To fetch a filtered list of events

There are many parameters you can choose to include in the API call to filter the list of events returned. The following example includes all of them, each is then explained, below.

💻

GET {environment-id}/v2/public/clients/{clientId}/events&startDate={startDate}&endDate={endDate}&startTime={startTime}&endTime={endTime}&upcoming={upcoming}&previous={previous}&timezone={timezone}&day={day}&teamId={teamId}&homeTeamId={homeTeamId}&awayTeamId={awayTeamId}&venueId={venueId}&competitionId={competitionId}&excludeCompetitionId={excludeCompetitionId}&broadcasterId={broadcasterId}&seasonId={seasonId}&status={status}&statusGroup={statusGroup}&teamNameSearch={teamNameSearch}&sport={sport}

In which:

{environment-id} and {clientId} are as described above.

{startDate} is a timestamp in the RFC3339 format (e.g. 2025-12-31T23:59:59Z). If used, the endpoint will return events that begin on or after the specified date and time.

{endDate} is a timestamp in the RFC3339 format (e.g. 2025-12-31T23:59:59Z). If used, the endpoint will return events that start before the specified date and time.

{upcoming} is similar to {startDate} in that it is a timestamp in the RFC3339 format, and will return events that begin on or after the specified date and time. However, unlike {startDate}, it will also include all events where status: "Postponed". This is because a postponed event might continue to have a date in the past until a new date is confirmed.

{previous} is similar to {endDate} in that it is a timestamp in the RFC3339 format, and will return events that begin before the specified date and time. However, unlike {endDate}, it will exclude any events where status: "Postponed".

{startTime} is a time of day, in the 24-hour format (e.g. 18:00). If used, the endpoint will return events that start at or after the specified time.

{endTime} is a time of day, in the 24-hour format (e.g. 18:00). If used, the endpoint will return events that before the specified time.

{timezone} specifies the timezone to be used when querying events by startTime and endTime. This parameter ensures that the time-based filtering is applied consistently in the specified timezone. This defaults to "Europe/London".

{day} filters events that occur on specific days of the week, specified as an array of integers representing days (e.g., 1 for Sunday, 2 for Monday, etc.).

{teamId} filters events involving a specific teams, specified by their IDs as per the Cortex platform. This parameter is agnostic as to whether the specified team is the home team or away team.

{homeTeamId} filters events where specific teams are the home teams, specified by their IDs in the Cortex plaform.

{awayTeamId} filters events where specific teams are the away teams, specified by their IDs in the Cortex platform.

{venueId} filters events taking place at specific venues, specified by their IDs in the Cortex platform.

{competitionId} filters events in specific competitions, specified by their IDs in the Cortex platform.

{excludeCompetitionId} excludes events related to specific competitions, specified by their IDs.

{broadcasterId} filters events with specific broadcasters, specified by their IDs.

{seasonId} filters events by specific seasons, specified by their IDs.

{status} filters events by their status. If sport: "FOOTBALL", possible values include PreMatch, FirstHalf, HalfTime, SecondHalf, ExtraTime, ExtraTimeFirstHalf, ExtraTimeHalfTime, ExtraTimeSecondHalf, PenaltyShootout, FullTime, Abandoned, and Postponed . For other sports, possible values are Fixture, InPlay, Result, Postponed, or Abandoned.

{statusGroup} filters events based on their status being in one of three status groups, each representing related stages or conditions of an event.

  • The status group Fixture is for scheduled events that have not started yet, and returns events with the statuses PreMatch, Fixture, and Postponed, as well as any empty or undefined statuses.
  • The status group Live is for events that are currently in progress, and returns events with the statuses InPlay, FirstHalf, HalfTime, SecondHalf, ExtraTime, ExtraTimeFirstHalf, ExtraTimeHalfTime, ExtraTimeSecondHalf, and PenaltyShootout.
  • The status group Result is for events that have concluded, and returns events with the statuses FullTime, Result, and Abandoned.

{teamNameSearch} allows searching for events by team name. It performs a case-insensitive and partial match, allowing you to find teams whose names contain the provided search term as a substring.

{sport} filters events by the sport they belong to.