Overview
This guide is for API users migrating from GraphQL to REST. If you’re new to the Novig API, start with the Authentication guide.
Authentication
All REST endpoints require authentication via Bearer token. Include your access token in every request:
Authorization: Bearer YOUR_ACCESS_TOKEN
See the Authentication guide for instructions on obtaining an access token using your client credentials.
Environments
| Environment | Base URL |
|---|
| Production | https://api.novig.us |
| QA | https://api.novig.us |
Migration Reference
Before (GraphQL):
query GetLeaguesQuery {
game(distinct_on: [league, sport]) {
id
league
sport
}
}
After (REST):
curl --request GET \
--url https://api.novig.us/nbx/v2/emm/event-metadata/leagues \
--header "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response:
["NFL", "NBA", "MLB", "NHL", "NCAAF", "NCAAB", "MLS", "EPL", "UFC", "PGA"]
Additional metadata endpoints are also available:
GET /nbx/v2/emm/event-metadata/types - All event types
GET /nbx/v2/emm/event-metadata/statuses - All event statuses
2. EventsByLeague → GET /nbx/v2/emm/events
Before (GraphQL):
query EventsByLeague($league: String!) {
event(
where: {
_and: [
{
_or: [
{
_and: [
{ status: { _in: ["CLOSED_PREGAME", "OPEN_PREGAME"] } }
{ is_visible_pregame: { _eq: true } }
]
}
{
_and: [
{ status: { _in: ["OPEN_INGAME", "DELAYED"] } }
{ is_visible_live: { _eq: true } }
]
}
]
}
{ league: { _eq: $league } }
{ type: { _eq: "Game" } }
]
}
) {
id
type
description
status
league
scheduled_start
game {
id
status
scheduled_start
homeTeam { id name symbol }
awayTeam { id name symbol }
}
}
}
After (REST):
curl --request GET \
--url "https://api.novig.us/nbx/v2/emm/events?league=NFL&type=Game&status=OPEN_PREGAME&limit=100" \
--header "Authorization: Bearer YOUR_ACCESS_TOKEN"
Query Parameters:
| Parameter | Type | Required | Description |
|---|
league | string | No | Filter by league (e.g., NFL, NBA, MLB) |
type | string | No | Filter by event type (e.g., Game) |
status | string | No | Filter by status (e.g., OPEN_PREGAME, OPEN_INGAME) |
limit | number | No | Number of results to return (max 100, default 100) |
offset | number | No | Pagination offset (default 0) |
Response:
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "Game",
"status": "OPEN_PREGAME",
"description": "Kansas City Chiefs @ Buffalo Bills",
"league": "NFL",
"scheduledStart": "2025-01-26T18:30:00.000Z",
"game": {
"id": "game-uuid",
"status": "SCHEDULED",
"scheduledStart": "2025-01-26T18:30:00.000Z",
"homeTeam": { "id": "team-uuid", "name": "Buffalo Bills", "symbol": "BUF" },
"awayTeam": { "id": "team-uuid", "name": "Kansas City Chiefs", "symbol": "KC" }
},
"marketIds": ["market-uuid-1", "market-uuid-2", "market-uuid-3"]
}
]
The REST endpoint returns a marketIds array for each event, which can reduce follow-up queries.Visibility filtering: Unlike the GraphQL query, the REST endpoint does not automatically filter by is_visible_pregame or is_visible_live. Filter by status to get the events you need.
3. MarketsByEvent → GET /nbx/v2/emm/events/getMarketsByEvent/:eventId
Before (GraphQL):
query MarketsByEvent($eventId: uuid!) {
event(where: { id: { _eq: $eventId } }) {
markets(
where: {
_and: [
{ status: { _eq: "OPEN" } }
{
_or: [
{ is_consensus: { _eq: true } }
{ outcomes: { available: { _is_null: false } } }
]
}
]
}
) {
id
type
description
status
player { name position }
outcomes {
id
description
available
last
type
competitor { name }
orders(
where: {
_and: [
{ status: { _eq: "OPEN" } }
{ currency: { _eq: "CASH" } }
]
}
) {
id
outcome_id
isBid
qty
price
status
currency
}
}
}
}
}
After (REST):
curl --request GET \
--url "https://api.novig.us/nbx/v2/emm/events/getMarketsByEvent/550e8400-e29b-41d4-a716-446655440000?currency=CASH" \
--header "Authorization: Bearer YOUR_ACCESS_TOKEN"
Path Parameters:
| Parameter | Type | Required | Description |
|---|
eventId | uuid | Yes | The event ID to fetch markets for |
Query Parameters:
| Parameter | Type | Required | Description |
|---|
currency | string | Yes | Currency for orderbook data (CASH or COIN) |
Response:
[
{
"id": "market-uuid",
"type": "Spread",
"description": "Chiefs -3.5",
"status": "OPEN",
"eventId": "550e8400-e29b-41d4-a716-446655440000",
"book": {
"bids": [
{ "price": 0.52, "qty": 100 },
{ "price": 0.51, "qty": 250 }
],
"asks": [
{ "price": 0.54, "qty": 150 },
{ "price": 0.55, "qty": 200 }
]
}
}
]
The REST endpoint returns markets with their current orderbook data included in a single response, eliminating the need to fetch orders separately.
Fetching a Single Event
A new endpoint is available to fetch a single event by ID:
curl --request GET \
--url "https://api.novig.us/nbx/v2/emm/events/550e8400-e29b-41d4-a716-446655440000" \
--header "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "Game",
"status": "OPEN_PREGAME",
"description": "Kansas City Chiefs @ Buffalo Bills",
"league": "NFL",
"scheduledStart": "2025-01-26T18:30:00.000Z",
"game": {
"id": "game-uuid",
"status": "SCHEDULED",
"scheduledStart": "2025-01-26T18:30:00.000Z",
"homeTeam": { "id": "team-uuid", "name": "Buffalo Bills", "symbol": "BUF" },
"awayTeam": { "id": "team-uuid", "name": "Kansas City Chiefs", "symbol": "KC" }
},
"marketIds": ["market-uuid-1", "market-uuid-2", "market-uuid-3"]
}
Need Help?
If you have questions or need assistance with the migration, please reach out to developers@novig.co.