Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to API-Sports

Scalekit connector
Open markdown

The API-Sports connector lets your AI agent act in each user's API-Sports account. Each user connects their own API-Sports API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 38 tools.

Tools
38
What they doRead · write · destructive
38 · 0 · 038 read0 write0 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the API-Sports connection

    In AgentKit > Connections, create an API-Sports connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'apisports'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize API-Sports:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'apisports_basketball_get_status',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their API-Sports credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • apisports_basketball_get_standingsGet the basketball standings of a league season, optionally for one team, stage or group.Read-only

    Basketball: Get Standings

    Get the basketball standings of a league season, optionally for one team, stage or group. Returns rows with position, stage, group, team, games played, won and lost (with percentages), points for and against, form and description. Bad or missing parameters come back as HTTP 200 with an empty `response` and the reason in `errors`. Use it for the league table. Use apisports_basketball_list_games for individual results.

    Inputs

    leagueintegerrequired
    League or cup ID, from apisports_basketball_list_leagues. League IDs stay the same across seasons. Example: 12 (NBA).
    seasonstringrequired
    Season. Leagues that span two years use 'YYYY-YYYY' (NBA: '2023-2024'); single-year leagues use 'YYYY' (e.g. '2024'). Use a value listed in the league's seasons from apisports_basketball_list_leagues.
    groupstring
    Group name as it appears in standings results. Example: 'Western Conference'.
    stagestring
    Stage name as it appears in standings results. Example: 'Regular Season'.
    teaminteger
    Team ID, from apisports_basketball_list_teams. Example: 145.
  • apisports_basketball_get_statusGet the API-Basketball subscription status of the connected API-Sports key.Read-only

    Basketball: Get Account Status

    Get the API-Basketball subscription status of the connected API-Sports key. Returns the account name and email, the current plan, its end date and active flag, and today's request count against the daily limit. Use it to check the remaining daily basketball quota. Each sport has its own quota; use apisports_football_get_status or apisports_hockey_get_status for the others. This call does not count against the quota.

    Inputs

    This tool takes no inputs.

  • apisports_basketball_list_gamesList basketball games (scheduled, live or finished) by game ID, date, league and season, or team.Read-only

    Basketball: List Games

    List basketball games (scheduled, live or finished) by game ID, date, league and season, or team. At least one filter is required. Returns each game's ID, date, time and timestamp, timezone, stage, week, status (codes: NS, Q1, Q2, Q3, Q4, OT, BT, HT, FT, AOT, POST, CANC), league, country, home and away teams and scores (per quarter, overtime and total). Games update every 15 seconds. Bad or missing parameters come back as HTTP 200 with an empty `response` and the reason in `errors`. Use it for basketball schedules, results and live scores. Use apisports_basketball_get_standings for the league table.

    Inputs

    datestring
    Date in YYYY-MM-DD format. Returns games on that day.
    idinteger
    Game ID. Example: 1912.
    leagueinteger
    League or cup ID, from apisports_basketball_list_leagues. League IDs stay the same across seasons. Example: 12 (NBA). Use with season.
    seasonstring
    Season. Leagues that span two years use 'YYYY-YYYY' (NBA: '2023-2024'); single-year leagues use 'YYYY' (e.g. '2024'). Use a value listed in the league's seasons from apisports_basketball_list_leagues. Use with league or team.
    teaminteger
    Team ID, from apisports_basketball_list_teams. Example: 145.
    timezonestring
    IANA time zone for the dates and times in the response, e.g. 'America/New_York'. Unknown values fall back to UTC.
  • apisports_basketball_list_leaguesList basketball leagues and cups, filtered by ID, name, country, type, season or text search.Read-only

    Basketball: List Leagues

    List basketball leagues and cups, filtered by ID, name, country, type, season or text search. Returns each league's ID, name, type, logo, country and its seasons with start and end dates and data coverage. Bad or missing parameters come back as HTTP 200 with an empty `response` and the reason in `errors`. Use it to find a league ID and its valid season values before calling apisports_basketball_list_games, apisports_basketball_list_teams or apisports_basketball_get_standings.

    Inputs

    countrystring
    Country name. Example: 'USA'.
    country_idinteger
    Country ID as returned in league results (the country object's id). Example: 5.
    idinteger
    League ID. Example: 12 (NBA).
    namestring
    Exact league name. Example: 'NBA'.
    searchstring
    Free-text search on the league or country name, at least 3 characters. Example: 'nba'.
    seasonstring
    Season. Leagues that span two years use 'YYYY-YYYY' (NBA: '2023-2024'); single-year leagues use 'YYYY' (e.g. '2024'). Use a value listed in the league's seasons from apisports_basketball_list_leagues.
    typestring
    Competition type: 'league' or 'cup'.one of leaguecup
  • apisports_basketball_list_teamsList basketball teams by ID, name, league and season, or text search.Read-only

    Basketball: List Teams

    List basketball teams by ID, name, league and season, or text search. At least one filter is required. Returns each team's ID, name, logo, national-team flag and country. Bad or missing parameters come back as HTTP 200 with an empty `response` and the reason in `errors`. Use it to find a team ID for apisports_basketball_list_games or apisports_basketball_get_standings.

    Inputs

    idinteger
    Team ID. Example: 145.
    leagueinteger
    League or cup ID, from apisports_basketball_list_leagues. League IDs stay the same across seasons. Example: 12 (NBA). Use with season.
    namestring
    Exact team name. Example: 'Los Angeles Lakers'.
    searchstring
    Free-text search on the team name, at least 3 characters. Example: 'lakers'.
    seasonstring
    Season. Leagues that span two years use 'YYYY-YYYY' (NBA: '2023-2024'); single-year leagues use 'YYYY' (e.g. '2024'). Use a value listed in the league's seasons from apisports_basketball_list_leagues. Use with league.
  • apisports_football_get_fixture_eventsGet the event timeline of one fixture: goals, cards, substitutions and VAR decisions, optionally for one team, one player or one event type.Read-only

    Football: Get Fixture Events

    Get the event timeline of one fixture: goals, cards, substitutions and VAR decisions, optionally for one team, one player or one event type. Returns events with the minute (and extra minutes), team, player, assisting player, type (Goal, Card, subst, Var) and detail (e.g. 'Normal Goal', 'Penalty', 'Yellow Card', 'Substitution 1', 'Goal cancelled') plus any comment. Bad or missing parameters come back as HTTP 200 with an empty `response` and the reason in `errors`. Use it for who scored or was booked and when. Use apisports_football_get_fixture_statistics for team totals.

    Inputs

    fixtureintegerrequired
    Fixture (match) ID, from apisports_football_list_fixtures. Example: 215662.
    playerinteger
    Player ID, from apisports_football_list_players or apisports_football_get_squad. Example: 276.
    teaminteger
    Team ID, from apisports_football_list_teams. Example: 33 (Manchester United).
    typestring
    Event type: 'Goal', 'Card', 'subst' or 'Var'.
  • apisports_football_get_fixture_lineupsGet the lineups of one fixture, for both teams or one team.Read-only

    Football: Get Fixture Lineups

    Get the lineups of one fixture, for both teams or one team. Returns, per team, the formation, coach, starting XI and substitutes, with each player's ID, name, shirt number, position (G, D, M, F) and grid position on the pitch. Bad or missing parameters come back as HTTP 200 with an empty `response` and the reason in `errors`. Use it for who started and the formation. Lineups usually appear 20 to 40 minutes before kickoff. Use apisports_football_get_fixture_player_stats for how each player performed.

    Inputs

    fixtureintegerrequired
    Fixture (match) ID, from apisports_football_list_fixtures. Example: 215662.
    playerinteger
    Player ID, from apisports_football_list_players or apisports_football_get_squad. Example: 276.
    teaminteger
    Team ID, from apisports_football_list_teams. Example: 33 (Manchester United).
    typestring
    Lineup section to return. Example: 'startXI'.
  • apisports_football_get_fixture_player_statsGet every player's statistics for one fixture, for both teams or one team.Read-only

    Football: Get Fixture Player Statistics

    Get every player's statistics for one fixture, for both teams or one team. Returns, per team, each player's minutes, shirt number, position, rating, captain and substitute flags, offsides, shots, goals and assists, saves, passes, tackles, duels, dribbles, fouls, cards and penalties. Bad or missing parameters come back as HTTP 200 with an empty `response` and the reason in `errors`. Use it for individual performances in a match. Use apisports_football_list_players for a player's season totals.

    Inputs

    fixtureintegerrequired
    Fixture (match) ID, from apisports_football_list_fixtures. Example: 215662.
    teaminteger
    Team ID, from apisports_football_list_teams. Example: 33 (Manchester United).