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).
Tom Parker says:
Musicbrainz? http://musicbrainz.org/doc/Development/XML_Web_Service/Version_2
GUIDs and XML make it slightly less nice, but otherwise it fulfills the criteria.
Andy Mabbett says:
The Overpass API returns data from OpenStreetMap. Better still, Overpass turbo offers a human-readable front end to it, so you can see and discuss the results before coding for them.
Bonus points if your students end up adding data to OSM!
Nathan Chantrell says:
Open APIs From Space: Current location of the ISS, overhead pass predictions and the number of humans currently in space. http://open-notify.org/
Joe Dowdell says:
How about this?
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:
I use the following 3 APIs for teaching purpose:
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.
ostephens says:
I've done some workshops for non-programmers recently and I've been using the Flickr feeds (https://www.flickr.com/services/feeds/) as a simple demonstration of APIs - the workshop uses a Google Spreadsheet to interact with the feeds - modifying parameters in the call and extracting information from the results.
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)
Katie Cunningham (@kcunning) says:
If I could reach through the internet and give you a beer for this post, I would. I'm currently doing something similar (writing something for kids), and finding an API that didn't require a key was driving me insane!
Julian Bond says:
A note of praise here for Atom and RSS as the simplest possible non-Auth API. And of course, a big thumbs down for the major social sites who have turned off most or all of their Atom/RSS feeds.
Sarah Jaine Szekeresh says:
This is such an old post- but just in case anyone reads it: http://www.omdbapi.com/ gives returns movie data (imdb style.) Also the Bechdel Test API http://bechdeltest.com/api/v1/doc gives some movie data along with the Bechdel rating (1pt=if there are two women in the movie, 2pt=they talk to each other, 3pt=they talk to each other about something besides a man.)
SAjay (@ajoys123) says:
Even though it's an old post, it's exactly what I was looking for. Thanks!
Fermín says:
I was looking exactly for this to introduce my students basic RESTful APIs. This is an impressive list! Thank you very much! Greetings from Spain.
Chris says:
Nice list. If you want to extract API data in general into a CSV, https://json-csv.com will convert it for you.
Roman Krejčík (@farincz) says:
I faced same problem. Found http://restcountries.eu/
megan says:
Yes, thanks for this list. I am teaching my university students (multiple different courses and levels) about API usage and free, unauthenticated restful APIs are just what I need to create interesting, relevant labs for them! Thank you for this list!
Sabrina says:
Thank you!! I'm excited to present APIs to the kids in my class, this list is a great starting point.