Querying remote APIs with RethinkDB

The latest version of RethinkDB has a pretty nifty new feature that allows you to make requests to remote APIs and query the result directly from the database server:

r.http('https://api.github.com/repos/rethinkdb/rethinkdb/stargazers')
    .pluck('login', 'id')
    .orderBy('id')

It includes parameters for authentication and pagination as well. This is really handy for ad-hoc analysis of API data, something I’ve used it for previously. I wrote a simple app that would request some data, insert it into the DB, then pull it back out according to my query. With this new method there would be a lot less back and forth.

You can learn more about r.http in the RethinkDB docs.