STAT-API

Hello, NBA

Every stat-api client reads its key from the STAT_API_KEY environment variable, so a first program is just: construct the client, call a list endpoint, and look at the rows.

  1. 1. List a few teams

    list() returns one bounded page wrapped in the list envelope; the rows come back under the table's name.

    curl -sS --compressed \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      'https://api.stat-api.com/api/v1/nba/teams?limit=3'
  2. 2. Print what came back

    Dump the rows as JSON to see the shape of a team record.

    console.log(JSON.stringify(teams, null, 2))