Sports Data for Developers: SportdataAPI (Sponsored)

Publikováno: 12.10.2020

Most of the side projects I consider starting revolve around sports, since I’m a huge sports fan. I spend my Saturdays watching soccer, Sundays spent watching soccer and NFL, and of course the mid-week Champions League and Europa League matches. One problem I’ve always had is not being able to find a reliable, feature-packed API […]

The post Sports Data for Developers: SportdataAPI (Sponsored) appeared first on David Walsh Blog.

Celý článek

Most of the side projects I consider starting revolve around sports, since I’m a huge sports fan. I spend my Saturdays watching soccer, Sundays spent watching soccer and NFL, and of course the mid-week Champions League and Europa League matches. One problem I’ve always had is not being able to find a reliable, feature-packed API to get the data I want. Consider that problem fixed: SportdataAPI!

Quick Hits

  • Free to start!
  • Supports all major sports and leagues from around the world
  • Get real-time data to get live game statistics
  • Retrieve data by sport, country, league, match, team, odds, and more
  • Excellent documentation with plenty of sample code

A good first step is getting the ID of the league and/or country you’re looking for; in my case, I’ll hunt down the Arsenal:

# Get England's country ID
https://app.sportdataapi.com/api/v1/soccer/countries?apikey=23551d60-059e-11eb-8df3-4b95d90d6207&continent=Europe

{"country_id":42,"name":"England","country_code":"en","continent":"Europe"}

# Query England teams to learn Arsenal's ID
https://app.sportdataapi.com/api/v1/soccer/teams?apikey=23551d60-059e-11eb-8df3-4b95d90d6207&country_id=42

{"team_id":2522,"name":"Arsenal FC","short_code":"ARS", ...}

Once I have the league I’m looking for, I can use SportdataAPI to get their match data, including live matches:

# Get the Premier League's ID
https://app.sportdataapi.com/api/v1/soccer/leagues?apikey=23551d60-059e-11eb-8df3-4b95d90d6207&country_id=42

data":{"236":{"league_id":237,"country_id":42,"name":"Premier League"},

# Get the season ID for this year's English Premier League
https://app.sportdataapi.com/api/v1/soccer/seasons?apikey=23551d60-059e-11eb-8df3-4b95d90d6207&league_id=237

{"season_id":352,"name":"20\/21","is_current":1,"country_id":42,"league_id":237,"start_date":"2020-09-11", ...

# Get matches
https://app.sportdataapi.com/api/v1/soccer/matches?apikey=23551d60-059e-11eb-8df3-4b95d90d6207&season_id=352&date_from=2020-09-12&date_to=2020-09-13

{"match_id":136906,"status_code":3,"status":"finished","match_start":"2020-09-12 11:30:00","league_id":237,"season_id":352,"home_team":{"team_id":2534,"name":"Fulham FC","short_code":"FUL","logo":"\/soccer\/teams\/100\/262.png","country":{"country_id":42,"name":"England","country_code":"en","continent":"Europe"}},"away_team":{"team_id":2522,"name":"Arsenal FC","short_code":"ARS","logo":"\/soccer\/teams\/100\/18.png","country":{"country_id":42,"name":"England","country_code":"en","continent":"Europe"}},"stats":{"home_score":0,"away_score":3,"ht_score":"0-1","ft_score":"0-3","et_score":null,"ps_score":null},"venue":{"venue_id":1232,"name":"Craven Cottage","capacity":25700,"city":"London","country_id":42}}

I can also get the league table at any given time:

https://app.sportdataapi.com/api/v1/soccer/standings?apikey=23551d60-059e-11eb-8df3-4b95d90d6207&season_id=352

{"team_id":850,"points":6,"status":"same","result":null,"overall":{"games_played":4,"won":2,"draw":0,

On top of the country, league, match, and player data that you would expect, SportdataAPI also provides information about venues, bookmakers, odds, rounds, and more. SportsdataApi makes it possible to create any host of apps, from a small team tracker to a full-featured sporting website!

SportsdataAPI is really, really slick. I love how absolutely complete the dataset is — they thought of just about everything. Best of all? It’s free to try — go make your dream sports site!

The post Sports Data for Developers: SportdataAPI (Sponsored) appeared first on David Walsh Blog.

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace