"You of course need a JSON viewer plugin to do this."
Why not emit your JSON slightly prettier from the server side? http://stackoverflow.com/questions/86653/how-can-i-pretty-fo... "You of course need a JSON viewer plugin to do this."
Why not emit your JSON slightly prettier from the server side? http://stackoverflow.com/questions/86653/how-can-i-pretty-fo...On a couple thousand requests the latency is not so noticeable. But on the long run maybe the API user should have a plugin on the client side to do that kind of beautification.
Which, by the way leads to my single complaint with this API: it only renders JSON.
To call it truly "self-documenting", I should just browse to http://www.heyzap.com/api/v1/ (ok, second complaint: the "v1" also belongs in a header, not the URI) and get an HTML page describing the resource, and links to the other endpoints. Bonus points if this HTML allows me to run the queries with overridden parameters.
About the v1 versioning in the URL, I understand your suggestion. But I see that little characteristic as a "no developer left behind" program for developers with less experience.
Also the format as an extension for your resource serves the same purpose
I may revise if it increases server load significantly but it looks good for now: http://www.heyzap.com/api/v1/activity/android
But if you see application/json in Accept:, then you assume it's an API call from a phone or script and you minify it instead.
Edit: however, that requires cooperation from others, so is prone to failure. Perhaps also take hints from the user agent string?
Edit 2: drat, someone already beat me to this suggestion. However, I'll use this as an excuse to pimp my last weekend hack: adding an Accept: decorator to itty.py http://news.ycombinator.com/item?id=3665743