Learning Resources for building a RESTful API with Rails

I am interested in building an API for an existing Rails App I have up and running - primarily because I want to build native mobile clients that use this API.

What are the most complete/comprehensive books/video-series (free and/or paid is fine) that you know of that can help me with this process.

I own the Thoughtbot iOS on Rails ebook, and it is a good start…but they don’t tackle things like generating API tokens. It is relatively lightweight at just 139 pages with half of it dedicated to iOS.

I would love a comprehensive ebook that thoroughly covers all aspects of building a robust, production-ready RESTful API.

Does any such thing exist?

1 Like

CodeSchool’s Surviving APIs With Rails is pretty good.


I have spent more time than I would like to admit researching this very subject. Here are a few additional resources you may find useful:

Build APIs You Won’t Hate

Great book, covers common API related topics. Most examples are in PHP but with some Google Fu you can find relevant Ruby examples.

APIs on Rails

Another great book on the subject, specific to Rails, but I found it to be too opinionated as I was looking for more of a pros / cons write up of API development. Still worth a read.


A specification for writing APIs in JSON. Checkout the implementations page for links.

jsonapi-resources seems to be the leading Rails implementation of the specification, although others exist. Has a demo app linked to in the readme.

I also have the iOS on Rails thoughtbot book and found it to be lacking. It was a great intro to API and iOS development but it glossed over some of the most difficult API topics.

Would I recommend it? Absolutely. Will it be the only resource you need to pickup API skills, no.

The rest of my API knowledge comes from reading code and Github issues.

Checkout rails-api, keep in mind it will be obsolete come Rails 5.

jsonapi-resources has some good conversations going on.

http://discuss.jsonapi.org/ is a good place to ask some questions. They are trying to get more people involved on their forums.

Versionist is a great gem to read through. Possibly even a great gem to use on your project.



@mrlee_io Wow…thanks very much for such a detailed response.

I would love for there to be the equivalent of a Michael Hartl’s Intro to Rails book, for an Intro to API in Rails. Alas…there doesn’t seem to be one.

@andyw8 I came across that in my research…just wasn’t sure how current it is and all that. I will look into it further though.


I have taken the course and it is pretty up to date. It doesn’t cover the pros and cons of different implementations but if you want working code for versioning and auth its a good intro.

Like anything else on codeshool it’s very much a getting started guide.

YES, I would sell my first born child for a really solid API book.

There is an O’Reilly book coming out on this topic.

I bought it, but I will advise you to wait for the official release since it desperately needs editing.

1 Like

I found a good example of an app that’s using an API from Rails;

I have a safari membership and they have the book, thanks for the suggestion