NAV Navbar
json
  • Lightning API v0 Beta Documentation
  • Crypto Exchange API
  • NFL Data
  • NBA Data
  • Contact Us
  • Lightning API v0 Beta Documentation

    Connect With Us

    Follow us on twitter @Suredbits

    We invite you to join our Slack channel Suredbits Slack

    Background Resources

    Thank you and welcome to Suredbits' Lightning App API documentation. This API allows you to query our NFL, NBA and Crypto Exchange data. Our NFL and NBA APIs offer multiple channels including teams, players, games, scores, and statistics. Our Crypto Exchange API allows you to stream data on Trades, Tickers and Order Books.

    We are currently focused primarily on developers already familiar with Bitcoin and know Lightning or are interested in building apps using the Lightning protocol. However, if you are just starting out in cryptocurrency development, we have included some helpful links below.

    Here are some useful resources to help you learn and get started with Bicoin and Lightning Network. Read and watch and come back when you're ready.

    1. Download Bitcoin Core
    2. Lightning Network Background
    3. Lightning Whitepaper
    4. Introduction to Bitcoin

    Suredbits Lightning Node

    In order to access our APIs, you will need to connect to our lightning node via your preferred lightning client.

    The url is:

    033[email protected]ln.test.suredbits.com

    Suredbits Lightning Payment

    This is our recommended lnd lightning client library: https://github.com/Suredbits/sb-api-lnd

    This is an alternative c-lightning client library: https://github.com/suredbits/lightning-charge

    UUID

    Example Data returned with valid UUID

    {
      "uuid":"123e4567-e89b-12d3-a456-426655440000",
      "data":
        {
          "version":"8",
          "lastRosterDownload":"2018-07-20T141610.664Z",
          "seasonType":"Regular",
          "seasonYear":2017,
          "week":"NflWeek17" 
        }
     }
    

    A valid uuid is required for all requests and will appear on all invoices, data responses, and errors related to that request. If no uuid is specified in a request, then there will be an error message returned.

    Format

    Basic example request

    {  
       "channel":"players",
       "lastName":"Moss",
       "firstName":"Randy",
       "uuid":"bfbef9da-eb9e-418c-8f6b-963743355ef7"
    }
    

    Example Data returned

    {  
      "uuid":"bfbef9da-eb9e-418c-8f6b-963743355ef7",
      "data":
      [
        { 
          "playerId":"00-0011754",
          "gsisName":"R.Moss",
          "fullName":"Randy Moss",
          "firstName":"Randy",
          "lastName":"Moss",
          "team":"UNK",
          "position":"UNK",
          "profileId":2502220,
          "profileUrl":"http://www.nfl.com/player/randymoss/2502220/profile",
          "birthDate":"2/13/1977",
          "college":"Marshall",
          "yearsPro":14,
          "height":76,
          "weight":210,"status":
          "Unknown",:
        }
      ]
    }
    

    Suredbits APIs are available via websockets with the following format:

    1. Send a request over the websocket (see NFL Data).

    2. Upon confirmation of a valid request, you will receive a Lightning Network Invoice that should appear similar to the one below.

    3. Pay that ln invoice in your lightning client

    4. Receive data :)

    Ping/Pong

    To confirm your connection, send a ping request. Ping has an optional uuid field for correlating multiple pongs to multiple pings.

    Sample Lightning Invoice

    A successful request will generate a lightning invoice that will look similar to the example below:

    lnbcrt10n1pd5v2mwpp5ulxpj8ht4gvtqnyl8zuykfk4wcv6sz455ce5dy0e0lqt...

    Crypto Exchange API

    Crypto Exchange Websocket Endpoint

    wss://test.api.suredbits.com/exchange/v0

    Overview

    Trading Pairs Supported

    Symbol Binance Bitfinex
    BTCUSDT X
    ETHBTC X X
    ETHUSDT X
    BTCUSD X
    ETHUSD X

    Subscribe

    Example request Format:

    {  
       "event":"subscribe",
       "channel":"trades",
       "symbol":"BTCUSDT",  
       "exchange":"binance",
       "duration":120000,
       "refundInvoice":"lnbcrt1pdace6qpp5my6nc58d50r5gk38ynyz...",
       "uuid":"8dda8625-2946-4500-8dd5-13c78d2f42b8"
    }
    

    Example Subscription confirmation

    {  
       "uuid":"8dda8625-2946-4500-8dd5-13c78d2f42b8",
       "exchange":"binance",
       "symbol":"BTCUSDT",
       "duration":100000,
       "event":"payment received"
    }
    

    To subscribe to a data stream, use the following command format:

    Field Type Example
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    event String "subscribe"
    channel String "tickers"
    symbol String "ETHBTC"
    exchange String "bitfinex"
    duration Integer (milliseconds) "15000"
    refundInvoice String lnbcrt10n1pd5v2mwpp5ulxpj8ht...

    Payment

    1 second = 1 Satoshi

    10 seconds = 10 Satoshis

    100 seconds = 100 Satoshis

    We will post notification of any future changes in our pricing model here and via our twitter @Suredbits.

    Snapshots

    Example of Snapshot from Trades Channel

    {  
       "uuid":"f8363f36-65dd-4a07-a3e0-75f38b816df7",
       "snapshot":[  
          {  
             "eventTime":1543347647113,
             "symbol":"BTCUSDT",
             "tradeId":82634229,
             "price":3809.1,
             "quantity":0.293552,
             "buyerId":195007870,
             "sellerId":195007859,
             "tradeTime":1543347647109,
             "marketMaker":false
          },
          ...
        ]
    }
    

    Upon subscribing to a channel an initial snapshot is sent. The snapshot provides a view of the current state of the market.

    Refill

    You may refill your subscrption at any time with the following command format:

    Field Type Example
    uuid String "e.g. 123e4567-e89b-12d3-a456-426655440000"
    addedDuration Integer (milliseconds) "1000"
    event String "refill"

    Unsubscribe

    You may unsubscribe from a channel using the following command:

    Field Type Example
    uuid String "e.g. 123e4567-e89b-12d3-a456-426655440000"
    event String "unsubscribe"

    Maintenance

    In the event of maintenance or service interruption, we will refund any remaining portion of your subscription.

    Tickers

    Example Request Tickers

    {  "event":"subscribe",
       "channel":"tickers",
       "symbol":"BTCUSDT",
       "exchange":"binance",
       "duration":120000,
       "refundInvoice":"lnbcrt1pdace6qpp5my6nc58d50r5gk...",
        "uuid":"dc48f38e-7f71-4ea2-8c4c-52c683db93fa"
    }
    

    Example Tickers data

    
    {  
       "uuid":"dc48f38e-7f71-4ea2-8c4c-52c683db93fa",
       "exchange":"binance",
       "symbol":"BTCUSDT",
       "duration":120000,
       "event":"payment received"
    }
    
    {  
       "uuid":"dc48f38e-7f71-4ea2-8c4c-52c683db93fa",
       "snapshot":[  
          {  
             "eventTime":1543849532563,
             "symbol":"BTCUSDT",
             "priceChange":-253.84,
             "priceChangePerc":-6.08,
             "weightedAvePrice":4079.82822535,
             "prevClose":4174.49,
             "close":3921.26,
             "closeQuantity":1.144132,
             "bid":3920.31,
             "bidSize":0.052611,
             "ask":3922.57,
             "askSize":1.207388,
             "open":4175.1,
             "high":4268,
             "low":3896.03,
             "volume":42258.714174,
             "quoteVolume":172408294.85387801,
             "statOpenTime":1543763132561,
             "statCloseTime":1543849532561,
             "firstTradeId":83998182,
             "lastTradeId":84182065,
             "totalTrades":183884
          }
       ]
    }
    
    
    {  
       "uuid":"dc48f38e-7f71-4ea2-8c4c-52c683db93fa",
       "data":{  
          "eventTime":1541716718571,
          "symbol":"BTCUSDT",
          "priceChange":-68.06,
          "priceChangePerc":-1.036,
          "weightedAvePrice":6524.40647569,
          "prevClose":6575.83,
          "close":6503.16,
          "closeQuantity":0.040421,
          "bid":6501.05,
          "bidSize":0.123017,
          "ask":6503.16,
          "askSize":0.463804,
          "open":6571.22,
          "high":6594,
          "low":6471.22,
          "volume":12760.988421,
          "quoteVolume":83257875.49020969,
          "statOpenTime":1541630318568,
          "statCloseTime":1541716718568,
          "firstTradeId":77686104,
          "lastTradeId":77828352,
          "totalTrades":142249
       }
    }
    

    The Tickers channel streams high level updates for given trading pairs. See the table below for which exchanges return which fields.

    Field Type Exchanges Supporting
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    eventTime Integer bitfinex , binance
    symbol String binance
    priceChange Double binance , bitfinex
    priceChangePerc Double binance , bitfinex
    weightedAvePrice Double binance
    prevClose Double binance
    close Double binance , bitfinex
    closeQuantity Double binance
    bid Double bitfinex , binance
    bidSize Double bitfinex , binance
    ask Double bitfinex , binance
    askSize Double bitfinex , binance
    open Double binance
    high Double binance , bitfinex
    low Double binance , bitfinex
    volume Double binance , bitfinex
    quoteVolume Double binance
    statOpenTime Integer binance
    statCloseTime Integer binance
    firstTradeId Integer binance
    lastTradId Integer binance
    totalTrades Integer binance

    Trades

    Example request Trades

    
    {  "event":"subscribe",
       "channel":"trades",
       "symbol":"BTCUSDT",
       "exchange":"binance",
       "duration":12000,
       "refundInvoice":"lnbcrt1pdace6qpp5my6nc58d50r5gk38ynyz...",
       "uuid":"8dda8625-2946-4500-8dd5-13c78d2f42b8"
    }
    

    Example Trades data

    
    {  
       "uuid":"8dda8625-2946-4500-8dd5-13c78d2f42b8",
       "exchange":"binance",
       "symbol":"BTCUSDT",
       "duration":10000,
       "event":"payment received"
    }
    
    {  
       "uuid":"8dda8625-2946-4500-8dd5-13c78d2f42b8",
       "snapshot":[  
          {  
             "eventTime":1543839862868,
             "symbol":"BTCUSDT",
             "tradeId":84153760,
             "price":4038.81,
             "quantity":0.115984,
             "buyerId":199276007,
             "sellerId":199274414,
             "tradeTime":1543839862861,
             "marketMaker":false
          },
          ...
        ]
    }
    
    {  
       "uuid":"8dda8625-2946-4500-8dd5-13c78d2f42b8",
       "data":{  
          "eventTime":1541715784094,
          "symbol":"BTCUSDT",
          "tradeId":77827378,
          "price":6502.99,
          "quantity":0.030665,
          "buyerId":183136564,
          "sellerId":183136526,
          "tradeTime":1541715784094,
          "marketMaker":false
       }
    }{  
       "uuid":"8dda8625-2946-4500-8dd5-13c78d2f42b8",
       "data":{  
          "eventTime":1541715784161,
          "symbol":"BTCUSDT",
          "tradeId":77827379,
          "price":6501.35,
          "quantity":0.088033,
          "buyerId":183136558,
          "sellerId":183136565,
          "tradeTime":1541715784156,
          "marketMaker":true
       }
    }
    

    The Trades channel streams executed trades for a given trading pair. See the table below for which exchanges returns which fields.

    Field Type Exchanges Supporting
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    eventTime Integer bitfinex , binance
    symbol String binance
    tradeId Integer bitfinex , binance
    price Double binance , bitfinex
    quantity Double bitfinex , binance
    buyerId Integer binance
    sellerId Integer binance
    tradeTime Integer binance
    marketMaker Boolean binance

    Order Books

    Example Request Order Books

    { "event":"subscribe", 
      "channel":"books", 
      "symbol":"BTCUSD", 
      "exchange":"bitfinex", 
      "duration":15000,
      "refundInvoice":"lnbcrt1pdace6qpp5my6nc58d50r5...",
      "uuid":"d7975109-e6d0-47ae-9c26-531d553c420b"
    }
    

    Example Order Books data

    
    {  
          "uuid":"d7975109-e6d0-47ae-9c26-531d553c420b",
          "exchange":"bitfinex",
          "symbol":"BTCUSD",
          "duration":15000,
          "event":"payment received"
    }
    
    {  
       "uuid":"d7975109-e6d0-47ae-9c26-531d553c420b",
       "snapshot":[  
          {  
             "eventTime":1543850299172,
             "orderId":19811509228,
             "price":3894.7,
             "quantity":0.25
          },
          ...
       ]
    }
    
    {  
          "uuid":"d7975109-e6d0-47ae-9c26-531d553c420b",
          "data":{  
             "eventTime":1541715102336,
             "orderId":18836717052,
             "price":6504.4,
             "quantity":0.16911629
          }
       }{  
          "uuid":"d7975109-e6d0-47ae-9c26-531d553c420b",
          "data":{  
             "eventTime":1541715102336,
             "orderId":18836717013,
             "price":6502.9,
             "quantity":0.1691553
          }
       }
    

    The Books channel streams bids and asks for a given trading pair on given exchange. Currently, only the Bitfinex exchange is supported for this feature.

    Field Type Exchanges Supporting
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    eventTime Integer bitfinex
    orderId Integer bitfinex
    price Double bitfinex
    quantity Double bitfinex

    NFL Data

    NFL Websocket Endpoint

    wss://test.api.suredbits.com/nfl/v0

    Info

    Example request

    {
       "channel": "info", 
        "uuid": "[uuid]"
    }
    

    This provides a check and confirmation on the status of the API.

    Example data

    {
      "[uuid]",
      "data":
        [
          {
            "version":"8",
            "lastRosterDownload":"2018-08-13T17:07:53.668Z",
            "seasonType":"Preseason",
            "seasonYear":2018,
            "week":"NflPreSeasonWeek1"
           }
        ]
     }
    

    Games

    Example request Games

    {
      "channel":"games", 
      "week":1, 
      "seasonPhase" : "Regular", 
      "year" : 2017, 
      "uuid": "8ccbd2d9-65aa-401e-a056-44d543544d47"
    }
    

    Example of Games data

    
     {
       "uuid": "8ccbd2d9-65aa-401e-a056-44d543544d47",
       "data":
        [
          {
          "gsisId":"2017091006",
          "gameKey":"57241",
          "startTime":"2017-09-10T17:00:00.000Z",
          "week":"NflWeek1",
          "dayOfWeek":"Sunday",
          "seasonYear":2017,
          "seasonType":"Regular",
          "finished":true,
          "homeTeam":{
            "team":"MIA",
            "score":0,
            "scoreQ1":0,
            "scoreQ2":0,
            "scoreQ3":0,
            "scoreQ4":0,
            "turnovers":0
            },
          "awayTeam":{
            "team":"TB",
            "score":0,
            "scoreQ1":0,
            "scoreQ2":0,
            "scoreQ3":0,
            "scoreQ4":0,
            "turnovers":0
          },
          "timeInserted":"2017-08-04T18:29:15.669Z",
          "timeUpdate":"2018-06-08T19:34:44.063Z",
         },
         ...
        ]
     }
    

    The Games channel returns data for specific games.

    The required fields to query NFL Games data are as follows:

    Required fields

    Field Type Example
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    week Integer 1, 2, 3 etc...
    seasonPhase String Preaseason, Regular , or Postseason

    Optional fields

    Field Type Example
    year Integer 2009, 2010, 2011, etc.
    teamId String CHI, MIN, GB, MIA etc. See Team ID Table
    realtime Boolean true

    Players

    Example request Players

    {
      "channel":"players", 
      "lastName" : "Moss", 
      "firstName" : "Randy", 
      "uuid": "dfd2a7d4-3a36-4624-96c4-80f0c166d447ok"
    }
    
    

    Example Players data

    
    {
      "uuid":"dfd2a7d4-3a36-4624-96c4-80f0c166d447",
      "data":
        [
          {
            "playerId":"00-0011754",
            "gsisName":"R.Moss",
            "fullName":"Randy Moss",
            "firstName":"Randy",
            "lastName":"Moss",
            "team":"UNK",
            "position":"UNK",
            "profileId":2502220,
            "profileUrl":"http://www.nfl.com/player/randymoss/2502220/profile",
            "birthDate":"2/13/1977",
            "college":"Marshall",
            "yearsPro":14,
            "height":76,
            "weight":210,
            "status": "Unknown",:
           }
        ]
      }
    

    The Players channel returns data for particular players by name .

    The required fields to request NFL Player data are as follows:

    Required Fields

    Field Type Example
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    firstName String Randy
    lastName String Moss

    Team

    Example request Rosters

    Example request Rosters in Year

    {
      "channel": "team", 
      "teamId": "MIN", 
      "retrieve": "schedule", 
      "year": 2018, 
      "uuid": "[uuid]"
    }
    
    {
      "channel": "team", 
      "teamId": "MIN", 
      "retrieve": "roster", 
      "uuid": "db69a9d5-13c3-42a0-958a-623630a0fc81"
    }
    

    Example of Roster data

    
    {
      "uuid":"db69a9d5-13c3-42a0-958a-623630a0fc81",
      "data":
        [
          {
            "playerId":"00-0027981",
            "gsisName":"K.Rudolph",
            "fullName":"Kyle Rudolph",
            "firstName":"Kyle",
            "lastName":"Rudolph",
            "team":"MIN",
            "position":"TE",
            "profileId":2495438,
            "profileUrl":"http://www.nfl.com/player/kylerudolph/2495438/profile",
            "uniformNumber":82,
            "birthDate":"11/9/1989",
            "college":"Notre Dame",
            "yearsPro":8,"height":78,
            "weight":265,
            "status":"Active",
           },
           ...
        ]
      }
    
    
    

    Example request Schedules

    {
      "channel": "team", 
      "teamId": "CHI", 
      "retrieve": "schedule", 
      "uuid": "ede60177-f218-40ff-8fde-605f29a8bfce"
    }
    

    Example of Schedule data

    
     {
       "uuid": "ede60177-f218-40ff-8fde-605f29a8bfce",
       "data":
        [
          {
            "gsisId":"2017091001",
            "gameKey":"57236",
            "startTime":"2017-09-10T170000.000Z",
            "week":"NflWeek1",
            "dayOfWeek":"Sunday",
            "seasonYear":2017,
            "seasonType":"Regular",
            "finished":true,
            "homeTeam":
          {
            "team":"CHI",
            "score":17,
            "scoreQ1":0,
            "scoreQ2":10,
            "scoreQ3":0,
            "scoreQ4":7,
            "turnovers":0
          },
        "awayTeam":
          {
            "team":"ATL",
            "score":23,
            "scoreQ1":3,
            "scoreQ2":7,
            "scoreQ3":3,
            "scoreQ4":10,
            "turnovers":1
          },
        "timeInserted":"2017-08-04T182915.669Z",
        "timeUpdate":"2018-06-08T192330.452Z",
        },
        ...
       ]
     }
    

    The Team channel returns data for roster or schedule for a given NFL team.

    The required fields to request NFL Team & Roster data are as follows:

    Required fields:

    Field Type Example
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    teamID String CHI , MIN etc.
    retrieve String roster or schedule

    Optional Field

    Field Type Example
    year Integer 2018 , 2015 , 2011 , etc.

    Team ID Table

    Team Id City & Name TeamID City & Name
    ARI Arizona Cardinals LA Los Angeles Rams
    ATL Atlanta Falcons MIA Miami Dolphins
    BAL Baltimore Ravens MIN Minnesota Vikings
    BUF Buffalo Bills NE NE New England Patriots
    CAR Carolina Panthers NO New Orleans Saints
    CHI Chicago Bears NYG NYG New York Giants
    CIN Cincinnati Bengals NYJ New York Jets
    CLE Cleveland Browns OAK Oakland Raiders
    DAL Dallas Cowboys PHI Philadelphia Eagles
    DEN Denver Broncos PIT Pittsburgh Steelers
    DET Detroit Lions SD SD San Diego Chargers
    GB Green Bay Packers SEA Seattle Seahawks
    HOU Houston Texans SF San Francisco 49ers
    IND Indianpolis Colts TB Tampa Bay Buccaneers
    JAC Jacksonville Jaguars TEN Tennessee Titans
    KC Kansas City Chiefs WAS Washington Redskins

    Stats

    Example request Stats #1

    {
      "channel":"stats", 
      "statType" : "passing", 
      "gameId" : "2016101604", 
      "playerId" : "00-0027973",
      "uuid": "[uuid]"
     }
    
    

    Example request Stats #2

    {
        "channel":"stats", 
        "lastName" : "Brees", 
        "firstName" : "Drew", 
        "year": 2017, 
        "week" : 1, 
        "seasonPhase" : "Regular", 
        "statType" : "passing",
        "uuid": "4312144f-a0a9-4c23-bfd5-01405813c2c9"
    }
    

    Example of Stats data

    
    {
      "uuid:"4312144f-a0a9-4c23-bfd5-01405813c2c9",
      "data":
        [
          {
            "att":37,
            "cmp":27,
            "cmpAirYds":167,
            "inCmp":10,
            "inCmpAirYds": 75,
            "passingInt":0,
            "sack":1,
            "sackYds":-7,
            "passingTds":1,
            "passingTwoPointAttempt":0,
            "passingTwoPointAttemptMade":0,
            "passingTwoPointAttemptMissed":0,
            "passingYds":291,
           },
           ...
        ]
      }
    
    

    The Stats channel returns data for an individual player or game .

    To query by gameId and playerId :

    Required field for Stats by Id

    Field Type Example
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    channel String stats
    statType String passing, rushing, receiving, defense
    gameId String 2016101604
    playerId String 00-0027973

    To query by name and week :

    Required fields for Stats by Name and Week

    Field Type Example
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    channel String stats
    statType String passing, rushing, receiving, defense
    year Integer 2016, 2017
    week Integer 1, 2 ...
    seasonPhase String Preseason, Regular, Postseason
    firstName String Drew
    lastName String Brees

    NBA Data

    NBA Websocket Endpoint

    wss://test.api.suredbits.com/nba/v0

    Info

    Example request Info

    {
      "channel": "info", 
      "uuid": "123e4567-e89b-12d3-a456-426655440000"
    }
    

    Example of Info data

    {  
       "uuid":"123e4567-e89b-12d3-a456-426655440000",
       "data":{  
          "seasonYear":"2018-2019",
          "seasonPhase":"Regular",
          "version":0,
          "lastUpdated":"2018-11-15T21:58:50.490Z"
    
        }
    }
    

    The Info channel returns high level information of the current status of the NBA endpoint.

    Field Type Example
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000

    Games

    Example request Games

    {
      "channel": "games", 
      "year": 2018, 
      "month": 11, 
      "day": 24, 
      "uuid": "[uuid]"
    }
    

    Example request Games with TeamId

    {
      "channel": "games", 
      "year": 2016, "month": 12, 
      "day": 20, 
      "teamId": "CHI", 
      "uuid": "[3f4f2853-e84f-4a29-b807-8a471e59ca44"
    }
    

    Example Games data

    {  
       "uuid":"3f4f2853-e84f-4a29-b807-8a471e59ca44",
       "data":[  
          {  
             "gameId":21800280,
             "startTime":"2018-11-25T01:00:00.000Z",
             "homeTeam":{  
                "teamID":"WAS",
                "finalScore":0
             },
             "awayTeam":{  
                "teamID":"NOP",
                "finalScore":0
             },
             "finished":false,
             "seasonPhase":"Regular",
             "year":"2018-2019"
          },
          {  
             "gameId":21800282,
             "startTime":"2018-11-25T01:00:00.000Z",
             "homeTeam":{  
                "teamID":"OKC",
                "finalScore":0
             },
             "awayTeam":{  
                "teamID":"DEN",
                "finalScore":0
             },
             "finished":false,
             "seasonPhase":"Regular",
             "year":"2018-2019"
          },
          {  
             "gameId":21800285,
             "startTime":"2018-11-25T01:30:00.000Z",
             "homeTeam":{  
                "teamID":"GSW",
                "finalScore":0
             },
             "awayTeam":{  
                "teamID":"SAC",
                "finalScore":0
             },
             "finished":false,
             "seasonPhase":"Regular",
             "year":"2018-2019"
          },
          {  
             "gameId":21800284,
             "startTime":"2018-11-25T01:30:00.000Z",
             "homeTeam":{  
                "teamID":"MIL",
                "finalScore":0
             },
             "awayTeam":{  
                "teamID":"SAS",
                "finalScore":0
             },
             "finished":false,
             "seasonPhase":"Regular",
             "year":"2018-2019"
          },
          {  
             "gameId":21800279,
             "startTime":"2018-11-25T00:30:00.000Z",
             "homeTeam":{  
                "teamID":"CLE",
                "finalScore":0
             },
             "awayTeam":{  
                "teamID":"HOU",
                "finalScore":0
             },
             "finished":false,
             "seasonPhase":"Regular",
             "year":"2018-2019"
          },
          {  
             "gameId":21800281,
             "startTime":"2018-11-25T01:00:00.000Z",
             "homeTeam":{  
                "teamID":"MIN",
                "finalScore":0
             },
             "awayTeam":{  
                "teamID":"CHI",
                "finalScore":0
             },
             "finished":false,
             "seasonPhase":"Regular",
             "year":"2018-2019"
          }
       ]
    }
    

    The Games channel returns statistics about specific games played.

    Required Fields

    Field Type Example
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    channel String games
    year Integer 2016 , 2017 and 2018
    month Integer 3 , 8 , 12 etc..
    day Integer Follows typical calendar convention: 2 , 17 , 28 , etc...

    Example Request with teamID

    To search for a game by a specific team, add an optional field for teamID

    See Team ID Table

    Players

    Example request Players

    {
      "channel": "players", 
      "lastName": "Durant", 
      "firstName": "Kevin", 
      "uuid": "3f4f2853-e84f-4a29-b807-8a471e59ca44"
    }
    

    Example Players data (Kevin Durant)

    {  
       "uuid":"3f4f2853-e84f-4a29-b807-8a471e59ca44",
       "data":[  
          {  
             "playerId":201142,
             "firstName":"Kevin",
             "lastName":"Durant",
             "fullName":"Kevin Durant",
             "team":"GSW",
             "profileUrl":"",
             "birthDate":"2018-10-19T11:43:30.426Z",
             "status":"Active",
             "rookieYear":2007,
             "lastYear":2018
          }
       ]
    }
    

    The Players channel returns biographical information about specific players. For individual player statistics, see the Stats channel

    Required Fields

    Field Type Example
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    channel String players
    firstName String Kevin
    lastName String Durant

    Teams

    Example request for Roster

    {
      "channel": "team", 
      "retrieve": "roster", 
      "uuid": "[uuid]"
    }
    

    Example request with Year

    {
      "channel": "team", 
      "retrieve": "schedule", 
      "season": "2016-2017", 
      "uuid": "[uuid]"
    }
    

    Example request for Schedule

    {
      "channel": "team", 
      "teamId": "CHI",
      "retrieve": "schedule", 
      "uuid": "3f4f2853-e84f-4a29-b807-8a471e59ca44"
    }
    

    Example of team Schedule (Chicago Bulls)

    {  
       "uuid":"3f4f2853-e84f-4a29-b807-8a471e59ca44",
       "data":[  
          {  
             "gameId":21600073,
             "startTime":"2016-11-05T00:00:00.000Z",
             "homeTeam":{  
                "teamID":"CHI",
                "finalScore":104
             },
             "awayTeam":{  
                "teamID":"NYK",
                "finalScore":117
             },
             "finished":true,
             "seasonPhase":"Regular",
             "year":"2016-2017",
          }
    }
    ...
    
    

    The Teams channel returns information such as rosters or schedules for specific teams.

    Required Fields

    Field Type Example
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    channel String teams
    teamId String CHI , LAC , MIA , etc...
    retrieve String roster or schedule

    Optional Fields

    Field Type Example
    season String 2016-2017

    Team ID Table

    Team ID Team Team ID Team
    ATL Atlanta Hawks PHI Philadelphia 76ers
    MIA Miami Heat DET Detroit Pistons
    BKN Brooklyn Nets PHX Phoenix Suns
    MIL Milwaukee Bucks GSW Golden State Warriors
    BOS Boston Celtics POR Portland Trail Blazers
    MIN Minnesota Timberwolves HOU Houston Rockets
    CHA Charlotte Hornets SAC Sacramento Kings
    NOP New Orleans Pelicans IND Indiana Pacers
    CHI Chicago Bulls SAS San Antonio Spurs
    NYK New York Knicks LAC Los Angeles Clippers
    CLE Cleveland Cavaliers TOR Toronto Raptors
    OKC Oklahoma City Thunder LAL Los Angeles Lakers
    DAL Dallas Mavericks UTA Utah Jazz
    ORL Orlando Magic MEM Memphis Grizzlies
    DEN Denver Broncos WAS Washington Wizards

    Stats

    Example request Stats by ID

    {
      "channel": "stats", 
      "gameId": "21600854", 
      "playerId": "201142", 
      "uuid": "[uuid]"
    }
    

    Example request for Stats by Name

    {
      "channel": "stats", 
      "lastName": "Durant", 
      "firstName": "Kevin", 
      "year": 2017, 
      "month": 12, 
      "day": 12, 
      "uuid": "3f4f2853-e84f-4a29-b807-8a471e59ca44"
    }
    

    Example of player Stats data (Kevin Durant)

    {  
       "uuid":"3f4f2853-e84f-4a29-b807-8a471e59ca44",
       "data":[  
          {  
             "playerId":201142,
             "min":0,
             "fgm":0,
             "fga":0,
             "tpm":0,
             "tpa":0,
             "ftm":0,
             "fta":0,
             "plusminus":0,
             "off":0,
             "deff":0,
             "tot":0,
             "ast":0,
             "pf":0,
             "st":0,
             "to":0,
             "bs":0,
             "pts":0
          }
       ]
    }`
    

    The Stats channel returns data for individual players and allows you to query by gameId , playerId or by specific player name .

    Required Fields for Stats by Id

    Field Type Example
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    channel String stats
    gameId String "21600854"
    playerId String "201142"

    Required Field for Stats by Name

    Field Type Example
    uuid String e.g. 123e4567-e89b-12d3-a456-426655440000
    channel String stats
    Year Integer 2016 , 2017 and 2018
    Month Integer 2 , 6 , 10 etc..
    Day Integer Follows typical calendar convention: 3 , 18 , 25 , etc...
    firstName String Kevin
    lastName String Durant

    Contact Us

    Follow us on twitter @Suredbits

    Join our Slack channel Suredbits Slack

    Email us at [email protected]