Just wondering if there's any out of the box solution for this, I am not too familiar with the analytics api maybe I can write some simple js that updates analytics before going to my service etc. -- otherwise I am going to have to stick to the good old 'store records in the database'.
Any help appreciated!
I think this solution might be a really good choice if you're interested in specifically tracking REST calls: http://apianalytics.com It looks like it has everything you'd need. A bit like the Mixpanel of APIs.
Disclaimer: A good friend of mine has built this
What information are you looking for specifically? You might be able to get what you need from http access logs.
You could do this now with GA using the new Measurement Protocol the is currently in public beta.
I think Keen IO would be a great fit here. It's an API-only analytics platform (meaning that you both send data and consume analysis via a REST API).
Full disclosure: I'm the CEO. I'm not writing this answer to self-promote, but because honestly, our product was purpose-built for use cases like yours.
Several Keen IO users are API companies who use it to do analytics on how their users are using their APIs.
At the risk of being a bit too meta: We use the Keen IO API internally to collect events and perform analysis of how our customers use the Keen IO API externally, and by way of example, our two-event data model looks something like this:*
*We actually use a lot more properties than this, I've stripped them out to make this more clear
I don't think google analytics can track rest calls, because it's activated by a snippet of JavaScript that you embed in your HTML.
To view the logs, you can go to the appengine console, choose your application and select Logs.
To access your logs programmatically, you've to download them (with Java, with Python), but it seems that up to now you can't do it within your app engine, so you've to do it either on your workstation or maybe on an Amazon EC2 (maybe micro) instance.
On the other hand, if you decide to store records in the DataStore, do the update within a task queue, so you don't slow down your API (Task Queues with Java, Task Queues with Python).
There seem to be a few solutions out there, though they mostly seem to involve changing your API architecture.
You could potentially use one of the Google Analytics server-side tracking libraries.
I see you're using AppEngine; I also run an API using AppEngine, and recently have been playing with using a Google Analytics Library for App Engine. It's not a perfect solution, but there's a decent amount of quality data.
Be warned that Google Analytics data modeling really isn't that analagous to that of an API; depending on your API, the notion of a "visit" is somewhat meaningless.