How to connect Api sports to Codex in 2 mins: No API key needed

You can export a season's results and build the table, build a match stats dataset from a list of fixtures and pull every player's season stats for a league from Codex. Composio runs each call on its own Api sports account, so you don't need a Api sports API key, and your first $2 is free.

Api sportsInstant · No API key

Codex runs Api sports through Composio, and the cost comes out of your free $2.

  • Football fixtures and results$0.000084
  • A prediction for a football match$0.000084
  • Injured and suspended players$0.000084

$2 ≈ 23800 requests

Composio Instant

What you can do with your free $2

What your free $2 gets you with Api sports
When you ask Codex forCodex uses this toolCostWhat $2 gets you
Football fixtures and resultsGet Fixtures$0.000084 per requestAbout 23,800 requests
A prediction for a football matchGet Predictions$0.000084 per requestAbout 23,800 requests
Injured and suspended playersGet Injuries$0.000084 per requestAbout 23,800 requests
Top scorers in a leagueGet Players Top Scorers$0.000084 per requestAbout 23,800 requests
Pre-match odds for a football matchGet Odds$0.000084 per requestAbout 23,800 requests
MMA fight resultsGet MMA Fight Results$0.000044 per requestAbout 45,400 requests

You pay Api sports' price for each call with 0% markup, plus the regular Composio tool call charge. There's no Api sports subscription, and you only pay for what you use.

60 of 73 Api sports tools work without a key. For Get Formula 1 Circuits, Get Formula 1 Competitions, Get Formula 1 Pit Stops, Get Formula 1 Races, Get Formula 1 Starting Grid, Get NFL Standings Conferences and 7 more, connect your own Api sports key. Read how Instant works.

How it works

How to connect Api sports to Codex

Composio adds Api sports to Codex as an Instant toolkit. You connect Composio to Codex once, and then Codex can use Api sports right away. There are two ways to do this:

  • Bring your own key

    You bring your own Api sports API key, set it up, and use it.

  • Use the Composio wallet

    Instant

    Composio runs each call on its own Api sports account, so you don't have to set anything up at Api sports, and your first $2 is free.

You do the setup one time and it takes about a minute. If you build Api sports into your own product, turn on Instant toolkits in your project settings so your agent can call Api sports for each of your users without a Api sports API key, and read Instant tools in the Composio docs for the setup steps and code examples.

Get started

Start to use Api sports in Codex in 3 steps

  1. Turn on Instant

    Open your Composio wallet and turn on Instant. Your free $2 shows up there.

  2. Add Composio to Codex

    Follow the setup below. You only do this once.

  3. Ask Codex for something

    Try a Api sports prompt. The cost comes out of your $2.

Setup

How to install Api sports MCP in Codex

Run the setup command

Run this command in your terminal to add the Composio MCP server to Codex.

Terminal

It will initiate the authentication in a browser window, authorize Codex to access your Composio account.

Composio authentication page

(Optional) Authenticate with OAuth

To authenticate manually, run the login command to open a browser window and authorize Codex to access your Composio account.

bash
codex mcp login composio

Verify the connection

Run codex mcp list to confirm Composio appears as a registered MCP server.

bash
codex mcp list

Codex App

Codex App follows the same approach as VS Code.

  1. Click ⚙️ on the bottom left → MCP Servers → + Add servers → Streamable HTTP:
  2. Fill the header and Key fields with { "x-consumer-api-key" = "ck_*******" }.
  3. The Key is the Composio API key, that you can find on dashboard.composio.dev
  4. Click on Authenticate and authorize Codex to your Composio account and you're all set.
Codex App MCP setup
  1. Restart and verify if it's there in .codex/config.toml
bash
[mcp_servers.composio]
url = "https://connect.composio.dev/mcp"
http_headers = { "x-consumer-api-key" = "ck_*******" }

Try it

Ask Codex for a Api sports task. The first time, Composio asks you to connect your Api sports account.

For example, ask it to:

  • "Show today's football fixtures for La Liga"
  • "Get head-to-head record for Chelsea vs Arsenal"
  • "List injured players in Premier League this week"
Try it

Ask Codex for something with Api sports

Start a new chat and try this prompt:

Get every finished [league] match of the [season] season from API-Sports and write results.csv with the date, round, home team, away team and final score. Then print a table of each team's wins, draws, losses and goal difference, worked out from the file.

Codex runs it on Instant and shows you the result. It doesn't ask you for a Api sports key, and the cost comes out of your $2. You can see each call in your wallet.

Optional: connect your own Api sports key

If you want Get Formula 1 Circuits, Get Formula 1 Competitions, Get Formula 1 Pit Stops, Get Formula 1 Races, Get Formula 1 Starting Grid, Get NFL Standings Conferences and 7 more, you need your own key. Ask Codex to connect your Api sports account, and it gives you a Composio link:

Connect my Api sports account using Composio.

Open the link, paste your Api sports API key and click Connect Account. You can get a key from API-Sports dashboard. After that, Composio uses your key first and doesn't charge Instant for those calls.

Starter prompts

Use your first $2: copy a prompt into Codex

Each prompt runs on Instant, and the cost next to it is about what it takes from your $2.

  • Export a season's results and build the table

    Less than $0.01

    Writes every finished match of a league season to a CSV and works out each team's record from it.

    Get every finished [league] match of the [season] season from API-Sports and write results.csv with the date, round, home team, away team and final score. Then print a table of each team's wins, draws, losses and goal difference, worked out from the file.

  • Build a match stats dataset from a list of fixtures

    Less than $0.01

    Fetches team statistics for every fixture ID in a file and writes one clean row per team per match.

    Read the fixture IDs in fixtures.txt (one per line, up to 100). For each one, get the team statistics from API-Sports and write match-stats.csv with one row per team per match: shots, shots on goal, possession, corners, fouls and cards. List the IDs that returned nothing at the end.

  • Pull every player's season stats for a league

    Less than $0.01

    Pages through all the players of a league season and writes their stats to one CSV, keeping the raw pages for reruns.

    Get the season statistics of every player in [league] for the [season] season from API-Sports, going through all the pages. Write players.csv with the player, team, position, appearances, minutes, goals, assists and cards. Save the raw pages to raw/players/ so I can rebuild the CSV without calling the API again.

  • Compare bookmaker odds for a day of matches

    Less than $0.01

    Writes every bookmaker's match winner odds for a day's fixtures to a CSV and shows the best price for each outcome.

    Get the pre-match odds for every [league] fixture on [date] from API-Sports, for the match winner bet. Write odds.csv with one row per fixture per bookmaker and the home, draw and away prices. Then print the best price for each outcome of each match and which bookmaker has it.

  • Look up career records for a list of fighters

    Less than $0.01

    Finds each MMA fighter named in a file and writes their career record to a CSV.

    For each name in fighters.txt (up to 30), find the fighter in API-Sports and get their career record. Write records.csv with the name, weight class, wins, losses, draws, knockouts and submissions. List any name that matched no fighter or more than one.

  • Export AFL quarter scores for games

    Less than $0.01

    Write a CSV with quarter scores for a list of AFL games.

    I have AFL game IDs in games.txt, up to 20. Get quarter scores for each and write quarters.csv with game ID, team, first, second, third, fourth and final score. List any IDs with missing scores.

  • Export basketball player box scores

    Less than $0.01

    Build a player stats CSV for several basketball games.

    I have up to 20 basketball game IDs in games.txt. Get player statistics for each and write box-scores.csv with game ID, player, team, minutes, points, rebounds, assists and turnovers. Mark games with no player data.

  • Compare football discipline across teams

    Less than $0.01

    Write a season report of club yellow and red cards.

    I want a discipline report for [league] in [season]. Look up its league ID and the teams, get each team's season statistics, and write discipline.csv with team, games, yellow cards and red cards. Sort by red cards.

  • Export MMA fight statistics

    Less than $0.01

    Create a fighter stats CSV for supplied fight IDs.

    I have up to 20 MMA fight IDs in fights.txt. Get fighter statistics for each and write mma-fight-stats.csv with fight ID, fighter, opponent, strikes and takedowns where returned. List any fights without statistics.

What it can do

What Codex can do with Api sports

Works without a key

  • Football fixtures and results
  • A prediction for a football match
  • Injured and suspended players
  • Top scorers in a league
  • Pre-match odds for a football match
  • MMA fight results

Needs your own Api sports key

  • Get Formula 1 Circuits
  • Get Formula 1 Competitions
  • Get Formula 1 Pit Stops
  • Get Formula 1 Races
  • Get Formula 1 Starting Grid
  • Get NFL Standings Conferences
  • Get Formula 1 Driver Rankings
  • Get Fastest Laps Rankings
  • and 5 more
Tools and prices

Supported tools (73)

Api sports tools and their Instant prices
ToolWhat it doesWorks without a keyCost on Instant
Get AFL GamesTool to retrieve AFL games and matches.Yes$0.067 per 1,000 API requests.
Get AFL Game Player StatisticsTool to retrieve player statistics from AFL (Australian Football League) game(s).Yes$0.067 per 1,000 API requests.
Get AFL SeasonsTool to get the list of available seasons for AFL.Yes$0.067 per 1,000 API requests.
Get AFL StandingsTool to retrieve AFL standings for a league.Yes$0.067 per 1,000 API requests.
Get Baseball Games Head-to-HeadTool to get head-to-head baseball games between two teams.Yes$0.067 per 1,000 API requests.
Get Basketball BetsTool to get all available basketball bet types.Yes$0.067 per 1,000 API requests.
Get Basketball BookmakersTool to get all available basketball bookmakers.Yes$0.067 per 1,000 API requests.
Get Basketball GamesRetrieve Basketball games for a league and season, optionally by team.Yes$0.067 per 1,000 API requests.
Get Basketball Game Player StatisticsRetrieve player-level performance statistics for a Basketball game.Yes$0.067 per 1,000 API requests.
Get Basketball StandingsRetrieve ranked Basketball teams for a league season.Yes$0.067 per 1,000 API requests.
Get basketball statisticsTool to get basketball statistics for a team in a given league and season.Yes$0.067 per 1,000 API requests.
Get CoachesTool to fetch coaches and their career history.Yes$0.084 per 1,000 API requests.
Get CountriesTool to fetch available countries for league queries.Yes$0.084 per 1,000 API requests.
Get Fighters RecordsTool to get fighter career statistics.Yes$0.044 per 1,000 API requests.
Get FixturesRetrieve football fixtures and matches by ID, live status, date, league, season, team, or date range, including upcoming, past, or live matches.Yes$0.084 per 1,000 API requests.
Get fixtures eventsTool to get events (goals, cards, substitutions, VAR, etc.) from a fixture.Yes$0.084 per 1,000 API requests.
Get Head-to-Head FixturesTool to get head-to-head fixtures between two teams.Yes$0.084 per 1,000 API requests.
Get Fixture LineupsTool to retrieve starting XI and substitutes for a fixture.Yes$0.084 per 1,000 API requests.
Get fixtures playersTool to get player statistics from a fixture.Yes$0.084 per 1,000 API requests.
Get Fixtures RoundsTool to get the rounds for a league or cup.Yes$0.084 per 1,000 API requests.
Show all 73 tools
More Api sports tools and their Instant prices
ToolWhat it doesWorks without a keyCost on Instant
Get fixture statisticsTool to get statistics for a fixture.Yes$0.084 per 1,000 API requests.
Get games eventsGet events such as goals and penalties for a hockey game by game ID.Yes$0.067 per 1,000 API requests.
Get AFL Games QuartersTool to retrieve AFL game quarter scores.Yes$0.067 per 1,000 API requests.
Get game statistics by teamsGet basketball team statistics for one or multiple games by ID, including assists, blocks, field goals, rebounds, steals, and turnovers.Yes$0.067 per 1,000 API requests.
Get InjuriesTool to get injured or suspended players.Yes$0.084 per 1,000 API requests.
Get LeaguesTool to retrieve leagues and cups.Yes$0.084 per 1,000 API requests.
Get League SeasonsTool to get the list of available seasons for all leagues.Yes$0.084 per 1,000 API requests.
Get MMA CategoriesTool to fetch the list of all available MMA categories.Yes$0.044 per 1,000 API requests.
Get MMA FightersTool to fetch MMA fighters data.Yes$0.044 per 1,000 API requests.
Get MMA FightsTool to retrieve the list of MMA fights according to given parameters.Yes$0.044 per 1,000 API requests.
Get MMA Fight ResultsTool to retrieve results from one or several MMA fights.Yes$0.044 per 1,000 API requests.
Get MMA Fighter StatisticsTool to get fighter statistics from MMA fights.Yes$0.044 per 1,000 API requests.
Get NBA game statisticsRetrieve aggregate NBA statistics for each team that played a game.Yes$0.067 per 1,000 API requests.
Get NBA Player StatisticsReturn NBA player box scores.Yes$0.067 per 1,000 API requests.
Get OddsTool to fetch pre-match odds.Yes$0.084 per 1,000 API requests.
Get Odds BetsTool to get all available pre-match bet types.Yes$0.084 per 1,000 API requests.
Get Odds BookmakersTool to list all available pre-match bookmakers.Yes$0.084 per 1,000 API requests.
Get In-Play OddsTool to fetch in-play odds for fixtures in progress.Yes$0.084 per 1,000 API requests.
Get Live Odds BetsTool to fetch all available bet types for in-play odds.Yes$0.084 per 1,000 API requests.
Get Odds MappingTool to get the list of available fixture IDs for the odds endpoint.Yes$0.084 per 1,000 API requests.
Get PlayersRetrieve football player profiles and statistics, with filters for player ID, team, league, season, and name search, and pagination.Yes$0.084 per 1,000 API requests.
Get Players ProfilesTool to get the list of all available players.Yes$0.084 per 1,000 API requests.
Get Players SeasonsTool to list all available seasons for player statistics.Yes$0.084 per 1,000 API requests.
Get Players SquadsTool to get player squads.Yes$0.084 per 1,000 API requests.
Get player statisticsTool to get player statistics for a specific basketball game.Yes$0.067 per 1,000 API requests.
Get Players TeamsTool to get the list of teams and seasons in which a player played during his career.Yes$0.084 per 1,000 API requests.
Get Players Top AssistsTool to get the 20 best players (top assists) for a league or cup.Yes$0.084 per 1,000 API requests.
Get Players Top Red CardsTool to get the 20 players with the most red cards for a league or cup.Yes$0.084 per 1,000 API requests.
Get Players Top ScorersTool to get the 20 best players (top scorers) for a league or cup.Yes$0.084 per 1,000 API requests.
Get Players Top Yellow CardsTool to get the 20 players with the most yellow cards for a league or cup.Yes$0.084 per 1,000 API requests.
Get PredictionsGet calculated predictions for a fixture by fixture ID.Yes$0.084 per 1,000 API requests.
Get SidelinedTool to get sidelined information (injuries, suspensions, etc.).Yes$0.084 per 1,000 API requests.
Get Standings StagesRetrieve available basketball standings stages for a specific league and season, for use when fetching standings.Yes$0.067 per 1,000 API requests.
Get TeamsTool to retrieve available teams.Yes$0.084 per 1,000 API requests.
Get Team SeasonsTool to get the list of seasons available for a team.Yes$0.084 per 1,000 API requests.
Get team statisticsTool to get detailed statistics of a team for a given league and season.Yes$0.084 per 1,000 API requests.
Get TimezoneTool to fetch the complete list of available timezones for fixture queries.Yes$0.084 per 1,000 API requests.
Get TransfersTool to get all available transfers for players and teams.Yes$0.084 per 1,000 API requests.
Get TrophiesTool to get trophies for a player or coach.Yes$0.084 per 1,000 API requests.
Get VenuesTool to retrieve available venues.Yes$0.084 per 1,000 API requests.
Get Formula 1 CircuitsTool to get the list of available Formula 1 circuits.Needs your own keyBilled to your own Api sports key
Get Formula 1 CompetitionsTool to retrieve Formula 1 competitions (Grand Prix races).Needs your own keyBilled to your own Api sports key
Get Formula 1 Pit StopsRetrieve pit stops for a Formula 1 race, optionally filtered by team or driver.Needs your own keyBilled to your own Api sports key
Get Formula 1 RacesRetrieve Formula 1 race schedules and event details for a given season, optionally filtered by competition, circuit, date, race type, or other criteria.Needs your own keyBilled to your own Api sports key
Get Formula 1 Starting GridTool to retrieve the starting grid for a Formula 1 race.Needs your own keyBilled to your own Api sports key
Get NFL Standings ConferencesTool to retrieve the list of available conferences for the NFL to be used in the standings endpoint.Needs your own keyBilled to your own Api sports key
Get Formula 1 Driver RankingsTool to retrieve Formula 1 driver rankings for a season.Needs your own keyBilled to your own Api sports key
Get Fastest Laps RankingsTool to get the ranking of the fastest laps for a Formula 1 race.Needs your own keyBilled to your own Api sports key
Get Race RankingsRetrieve rankings for a specific Formula 1 race, including finishing positions, completion times or gaps, and laps completed.Needs your own keyBilled to your own Api sports key
Get Formula 1 Team RankingsTool to retrieve Formula 1 team rankings for a specific season.Needs your own keyBilled to your own Api sports key
Get Standings DivisionsTool to retrieve the list of available divisions for an NFL competition to be used in the standings endpoint.Needs your own keyBilled to your own Api sports key
Get Standings GroupsTool to retrieve the list of available groups for a league to be used in the standings endpoint.Needs your own keyBilled to your own Api sports key
Get API StatusReturn connected account identity, subscription status, and daily request usage.Needs your own keyBilled to your own Api sports key
Pricing

How you pay for Api sports

  • Your first $2 is freeIt's added to your Composio wallet when you turn on Instant.
  • You pay for each callYou pay Api sports' price with 0% markup, plus the regular Composio tool call charge.
  • Your own key comes firstIf you connect your own Api sports key, Composio uses it and doesn't charge Instant for those calls.
  • You control the costYou can ask your agent to check with you before each paid call, and you can turn Instant off at any time.
  • You can see each callYour wallet shows each call and what it cost.
  • When your balance runs outYou can add funds to your wallet on a Pro plan or connect your own key.
Help

Troubleshooting

  1. 1. Codex asks me for a Api sports API key

    You may have asked for something that needs your own key, like Get Formula 1 Circuits, Get Formula 1 Competitions, Get Formula 1 Pit Stops, Get Formula 1 Races, Get Formula 1 Starting Grid, Get NFL Standings Conferences and 7 more. Those tools don't run on Instant. For everything else, check that Instant is turned on in your Composio wallet, then ask again.

  2. 2. I can't see my free $2

    Open your wallet in the Composio dashboard and check that Instant is turned on. If the $2 still isn't there, email support@composio.dev from the address you signed up with.

  3. 3. A Api sports call failed with a balance error

    Your balance is empty. Add funds to your wallet on a Pro plan, or connect your own Api sports key, then try again.

FAQ

Frequently asked questions

Start with Api sports.It takes 30 seconds.

New accounts get a one-time $2 starter credit for Instant calls.Run Api sports from your agent with no Api sports key.

Get $2 starter credit