Unabated APIGuideReference

Overview

The Unabated Realtime API provides live odds updates through GraphQL subscriptions over WebSocket connections. This allows you to receive real-time market changes as they happen, rather than polling for updates. All subscription data flows through a single endpoint with filtering controlled by the parameters you specify when subscribing.

GraphQL Endpoint

https://realtime.unabated.com

How It Works

Message Structure

  • Each WebSocket message contains top-level filter information (your subscription parameters) in the message root

  • Market updates are included as a collection of odds data that matches your filter criteria

  • Multiple markets and alternate lines may be included in a single message

  • No specific grouping - all matching updates are delivered together based on your filters

Market Line Keys

These keys are NOT meant to be parsed for actual data use, and are meant only to map into the RESTful data snapshots.

If you need a unique key for a market line, please use marketLineId.

Any data from within this key will be available as a first class member in the websocket payload.

Each market line in the subscription data includes a marketLineKey field that provides:

  • JSON path in dot notation format

  • Exact location where the matching line exists in the snapshot data

  • Direct mapping to the REST API structure for easy integration

This allows you to update your local data store precisely without having to search for the corresponding line.

Subscription Parameters

Common parameters available across subscription types (specific subscriptions may have additional parameters - check schema introspection for details):

leagueIds

Your API key may have access to all or a subset of these groups depending on your subscription level.

Parameter

Type

Description

Default Behavior

leagueIds

Array[Integer]

Array of one or more league ID values

If omitted, receives data for all leagues your API key can access

Behavior:

  • Each message contains only data for a single league (messages are not mixed)

  • Each message includes a leagueId field indicating which league the data pertains to

  • Allows filtering to specific leagues of interest

marketSourceGroups

Your API key may have access to all or a subset of these groups depending on your subscription level.

Parameter

Type

Description

Default Behavior

marketSourceGroups

Array[String]

Array specifying which market source groupings to include

If omitted, receives data for all market sources your API key can access

Available Groups:

  • STANDARD - The primary bucket containing most market sources found on the odds grid

  • FANDUEL - FanDuel odds updates

  • MARKET_MAKERS - Market sources considered market makers

  • SPORTTRADE - SportTrade exchange odds updates

Getting Started

Detailed code examples of how to use this API, either in isolation or in conjunction with the snapshot endpoint, can be found here:

https://github.com/UnabatedOrg/unabated-api-docs

You will need the API endpoint noted above, as well as your API key to use these examples.

This repository contains examples of all client usages that are noted below, including how to properly authenticate.

Prerequisites

  • API Key - Required for authentication

  • WebSocket Endpoint - wss://dev-realtime.unabated.com/graphql

  • GraphQL Client - See client options below

Basic Workflow

  1. Initialize your GraphQL WebSocket client with authentication

  2. Subscribe to relevant market updates with appropriate filters

  3. Process incoming messages using the marketLineKey for data mapping

  4. Update your local data store with the received changes

Integration with REST API

The WebSocket API is designed to work seamlessly with the REST endpoints:

  1. Get initial data using /market/{league}/{marketType}/odds

  2. Start WebSocket subscription to receive ongoing updates

  3. Map updates using marketLineKey to update your initial dataset

  4. Handle reconnection by fetching fresh REST data if needed

GraphQL Client Options

AWS AppSync Client

We have found the NodeJS AppSync client to have memory leaks in long running, high frequency situations like this. Contact us for guidance if this becomes an issue.

Best for: AWS-native applications

  • Pros: Lowest integration effort, built-in authentication handling

  • Cons: AWS infrastructure dependency

  • Use case: Applications already using AWS ecosystem

Apollo GraphQL Client

Best for: Universal applications

  • Pros: Framework agnostic, robust feature set, excellent documentation

  • Cons: Slightly more setup than AppSync

  • Use case: Most general-purpose applications

Raw WebSocket Implementation

Best for: Custom requirements or specific performance needs

  • Pros: Complete control over connection handling and message processing

  • Cons: Requires implementing GraphQL WebSocket protocol manually

  • Use case: Specialized applications or when other clients don't meet requirements

Schema Introspection

The schema for our realtime notification subscriptions can be introspected via any GraphQL tool.

We recommend the Apollo GraphQL Sandbox. Postman can be helpful as well, but does not support some of the list-based parameters that we use within our API.

Introspecting the GraphQL Schema

Upon opening the realtime sandbox for the first time, your connection will show red (disconnected). You must configure your API key as detailed below in order for the introspection to start working.

  1. Open https://data.unabated.com/docs/realtime

  2. Press the gear icon next to the sandbox connection input at the top of the screen

  3. Create an Authorization header where the value is your Unabated API Key:

  1. Upon saving, your connection should turn green:

  2. You can now visit the Documentation tab, hit Root and browse through the various options.

Due to the propriety nature of the AppSync GraphQL websocket protocol, you will NOT be able to run subscriptions from this tool (or any other that we have found). However, the schema / subscription builder are accurate and will help you form your queries. These can be used within our code examples for testing purposes.

You will see a full list of schema properties, including mutations, but may not have access to all actions depending on your API key permissions.If you believe you should have access to a set of properties but are not receiving data, please contact your Unabated account representative.