Category Archives: Data

Planet of the API

Several weeks back I was discussing with a co-worker what it means to work in the data field.  The old-school answer, which is still probably the most common, is that you will be in some way involved with databases.  While that is unlikely to change there is a shift towards working with APIs instead of directly with the database (providing a level of abstraction from the underlying database).  I, for one, am a strong fan of this approach since it often makes my life easier.

Of course that means that someone has to build the APIs, which has gotten a whole lot easier.  The question from my co-worker was, “Can you build an API in R?”  Valid question.  My off-the-cuff answer was of course, you can do anything in R, and if you can’t do it in native R you use Rcpp and do it in C++ and call it from R (EDIT: After thinking about this a bit, it is probably not wise to do this in R given the fact that R is an interpreted language and doesn’t really “run” a stand-alone application in the traditional sense.  Using Rcpp is really quite a bit of overkill for something like this).

I think the best answer is probably to use python or java.  Python provides a pretty straightforward framework (flask) to build REST endpoints.