NAV Navbar
json
  • Lightning API v0 Documentation
  • Crypto Exchange API (Coming Soon)
  • NFL Data
  • NBA
  • Contact Us
  • Lightning API v0 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 data, including teams, players, games, scores, and statistics.

    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 request will show up on the invoice, response, and any error message that are returned. If no uuid is specified in a websocket request then this field will be omitted from that request's response.

    Format

    Example Data Returned

    {  
      "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:

    Example requests

    {"channel":"players", "lastName" : "Moss", "firstName" : "Randy"}

    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 :)

    Sample Lightning Invoice

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

    lnbcrt10n1pd5v2mwpp5ulxpj8ht4gvtqnyl8zuykfk4wcv6sz455ce5dy0e0lqt2wvhthpsdqqxqrrssn39f5saxgtqmzs...

    Crypto Exchange API (Coming Soon)

    Info

    Coming soon...

    Subscribe

    Payment

    Refill

    Unsubscribe

    Tickers

    Coming soon...

    Trades

    Coming soon...

    Order Books

    Coming soon...

    NFL Data

    NFL Websocket Endpoint

    Here is the websocket url for our NFL API wss://test.api.suredbits.com/nfl/v0

    Info

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

    Example Request

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

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

    Games

    Example of Games data

    
     {
       "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",
         },
         ...
        ]
     }
    

    Example Request

    {"channel":"games", "week":1, "seasonPhase" : "Regular", "year" : 2017, "uuid": "[uuid]"}

    There are two required fields to query NFL Games data:

    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 of Players data

    
    {
      "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",:
           }
        ]
      }
    

    This request implements a websocket channel called players . It returns a NFL player given a websocket request.

    Example Requests

    {"channel":"players", "lastName" : "Moss", "firstName" : "Randy", "uuid": "[uuid]"}

    Required fields to request NFL Player data:

    Required Fields

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

    Team

    Example of Roster data

    
    {
      "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 of Schedule data

    
     {
       "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",
        },
        ...
       ]
     }
    

    This request implements a websocket channel called team . It returns the Roster or Schedule for a given NFL Team given a websocket request.

    Example Requests

    For Rosters: {"channel": "team", "teamId": "MIN", "retrieve": "roster", "uuid": "[uuid]"}

    For Schedules: {"channel": "team", "teamId": "CHI", "retrieve": "schedule", "uuid": "[uuid]"}

    For Rosters in Year: {"channel": "team", "teamId": "CHI", "retrieve": "schedule", "year": 2018, "uuid": "[uuid]"}

    There are two required Fields to request NFL Team & Roster data:

    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 of Stats data

    
    
    {
      "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,
           },
           ...
        ]
      }
    
    

    This request implements a websocket channel called stats . It returns the data for an individual player or game .

    Example Data Requests

    Example 1 { "channel":"stats", "statType" : "passing", "gameId" : "2016101604", "playerId" : "00-0027973" }

    Example 2 { "channel":"stats", "lastName" : "Brees", "firstName" : "Drew", "year": 2017, "week" : 1, "seasonPhase" : "Regular", "statType" : "passing" }

    To query by gameId and playerId :

    Required fields

    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

    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

    NBA Websocket Endpoint

    Here is the websocket url for our NBA API wss://test.api.suredbits.com/nba/v0

    Info

    Example Request

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

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

    Games

    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"
          }
       ]
    }
    

    Example Request

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

    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

    {"channel": "games", "year": 2016, "month": 12, "day": 20, "teamId": "CHI", "uuid": "[uuid]"}

    See Team ID Table

    Players

    Example Player 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
          }
       ]
    }
    

    Example Requests

    {"channel": "players", "lastName": "Durant", "firstName": "Kevin", "uuid": "[uuid]"}

    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 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",
          }
    }
    ...
    
    

    Example Requests

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

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

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

    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 of Player Stats (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
          }
       ]
    }`
    

    Example Requests for Stats by ID

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

    Required Fields

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

    Example Requests for Stats by Name

    {"channel": "stats", "lastName": "Durant", "firstName": "Kevin", "year": 2017, "month": 12, "day": 12, "uuid": "[uuid]"}

    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]