Wanted! Simple APIs Without Authentication
As some of you may know, I'm writing a series of short stories to help young people learn how to code.
One of the things I wanted to do was introduce the concept of using RESTful APIs. It's so powerful to show people that they can retrieve information from the Internet and then manipulate it in software.
Originally, I had wanted to use Twitter and Flickr as examples - they're both fairly well known and have interesting content. The only problem is that both require authentication. I'm an adult with two decades of programming experience and I still find OAuth-dances tricky! I've no idea how to create a foolproof guide for a child to get authentication tokens. Added to the fact that under-13 year-olds often can't legally enter into agreements with these companies.
So, after posting the question on Twitter, I've decided to make a list of fun and useful APIs which can be accessed without any form of authentication.
Wikipedia
Why didn't I think of this first!? The Wikipedia API is self documenting - although a little intense for a first time programmer. It will also pretty-print the information in a browser - which makes it much more readable to a novice.
Radio 1
The BBC offers a bunch of developer APIs for Radio 1.
Sadly, lots of the data returned is out of date, or simply broken. It is possible to get the latest Radio 1 playlist
http://www.bbc.co.uk/radio1/playlist.json
But it's not wonderfully informative and links to XML documents if you want to actually play MP3 snippets.
Police UK
Not great for international audiences - but a fantastic resource for students in the UK. All sorts of crime statistics.
Google Books
Google provides a free book search API which is simple to use.
https://www.googleapis.com/books/v1/volumes?q=isbn:0747532699
And you get pretty-printed JSON back with information about the book.
Google Location
Google has a pretty good location API which doesn't require a login.
https://maps.googleapis.com/maps/api/geocode/json?address=Oxford%20University,%20uk&sensor=false
Again, with some pretty printed JSON.
Twitter URL Count
Twitter's APIs are usually heavily locked down - but there is one which is open. It allows you to enter any URL and see how often it has been shared.
http://urls.api.twitter.com/1/urls/count.json?url=http://www.bbc.co.uk/news/technology-26879185
The response is pretty simple.
{"count":685,"url":"http://www.bbc.co.uk/news/technology-26879185/"}
Apple
Apple are surprisingly friendly. They have a simple API for looking up iTunes content.
Here, for example is all of Beyoncé's music videos.
https://itunes.apple.com/search?term=beyonce&entity=musicVideo
What Else?
I'm sure I've missed loads. If you know of any, please drop a link in the comments.
Remember, the criteria are...
- No authentication needed.
- Well structured output.
- Interesting data.
- Child friendly.
- Current.
- Preferably free (libre and gratis).
GUIDs and XML make it slightly less nice, but otherwise it fulfills the criteria.
Bonus points if your students end up adding data to OSM!
Joe Dowdell says:
Pokéapi.co is a RESTful API exposing all the information you could ever want about Pokémon. Information on Pokémon moves, types, abilities and more are all publicly available and consumable easily and without limitation.
http://phalt.co/p/pokeapi/
milosh says:
* Spotify search https://developer.spotify.com/technologies/web-api/search/
* Everything in Iceland from buses to lottery including earthquake http://docs.apis.is/
* Football data (european football results, rankings...) http://www.football-data.org/
Also, similarly to Iceland, some cities open some of their data through APIs as part of an opendata initiative. Not all do require an API key, and some present interesting data in a nice way.
Perhaps a bit limited, but I think good for a quick introduction and enough of the basic concepts to be interesting.
(this particular workshop was for staff at the British Library and is based on a previous workshop I did documented at http://www.meanboyfriend.com/overdue_ideas/2013/02/introduction-to-apis/ - but unfortunately the original API I used in that example no longer works and I haven't had time to write up the exercise modified to use the Flickr API yet)
Julian Bond says:
Sarah Jaine Szekeresh says:
Fermín says:
Chris says:
Found http://restcountries.eu/
megan says: