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.
— Alf Eaton (@invisiblecomma) January 23, 2014
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.
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
But it's not wonderfully informative and links to XML documents if you want to actually play MP3 snippets.
— Amanda ? (@ayymanduh) January 23, 2014
Not great for international audiences - but a fantastic resource for students in the UK. All sorts of crime statistics.
Google provides a free book search API which is simple to use.
And you get pretty-printed JSON back with information about the book.
Google has a pretty good location API which doesn't require a login.
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.
The response is pretty simple.
Apple are surprisingly friendly. They have a simple API for looking up iTunes content.
Here, for example is all of Beyoncé's music videos.
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.
- Preferably free (libre and gratis).