sport.db JSON(P) API Demo

Examples

List all teams for an event (league+season) /api/event/:key/teams

/api/event/en.2012_13/teams English Premier League 2012/2013
/api/event/de.2012_13/teams Deutsche Bundesliga 2012/2013
/api/event/euro.2012/teams Euro (European Championship) Cup 2012
/api/event/wm.2010/teams World Cup 2010

List all rounds for an event (league+season) /api/event/:key/rounds

/api/event/en.2012_13/rounds English Premier League 2012/2013
/api/event/de.2012_13/rounds Deutsche Bundesliga 2012/2013
/api/event/euro.2012/rounds Euro (European Championship) Cup 2012
/api/event/wm.2010/rounds World Cup 2010

List all games in a round for an event (league+season) /api/event/:key/round/:pos

/api/event/en.2012_13/round/2 English Premier League 2012/2013 - 2nd Round
/api/event/de.2012_13/round/5 Deutsche Bundesliga 2012/2013 - 5th Round
/api/event/euro.2012/round/1 Euro (European Championship) Cup 2012 - 1st Round
/api/event/wm.2010/round/20 World Cup 2010 - 20th Round (=> Final)

Usage

In your hypertext (HTML) document using a plain vanilla cross-domain JavaScript request (using the JSONP technique):

<script>
  function handleGames( json ) {
     // Do something with the returned data
  }
</script>

<script src="http://sportdbapi.herokuapp.com/api/event/en.2012_13/round/2?callback=handleGames"></script>

Or using the jQuery library using the getJSON function:

$.getJSON('http://sportdbapi.herokuapp.com/api/event/en.2012_13/round/2?callback=?', function(json) {
  // Do something with the returned data
});

Note: Add the callback=? query parameter to tell jQuery to use a cross-domain JSONP request.

That’s it.

Live Usage Sample

English Premier League 2012/2013 1. Runde2. Runde3. Runde4. Runde5. Runde6. Runde7. Runde8. Runde9. Runde10. Runde11. Runde12. Runde13. Runde14. Runde15. Runde16. Runde17. Runde18. Runde19. Runde20. Runde
Deutsche Bundesliga 2012/2013 1. Runde2. Runde3. Runde4. Runde5. Runde6. Runde7. Runde8. Runde9. Runde10. Runde11. Runde12. Runde13. Runde14. Runde15. Runde16. Runde17. Runde
Euro Cup 2012 Vorrunde 1. SpieltagVorrunde 2. SpieltagVorrunde 3. SpieltagViertelfinaleHalbfinaleFinale
World Cup 2010 1. Runde2. Runde3. Runde4. Runde5. Runde6. Runde7. Runde8. Runde9. Runde10. Runde11. Runde12. Runde13. Runde14. Runde15. Runde16. Runde17. Runde18. Runde19. Runde20. Runde

About

What's sport.db?

A free open sports database & schema. More »

What's sport.db.api?

A free open source sample web service in Ruby w/ Sinatra. More »

Questions? Comments? | world.db/0.2.0, sport.db/0.7.1, sport.db.api/1 - Ruby/1.9.2 (2011-07-09/x86_64-linux) on Sinatra/1.3.3 (production)