We’re currently planning a new API for an application and debating the various data formats we should use for interchange. There’s a fairly intense discussion going on about the relative merits of CSV, JSON and XML.
Basically, the crux of the argument is whether we should support CSV at all because of the lack of recursion (i.e. having a document which has multiple authors and multiple references would require multiple API calls to obtain all the information).
In the experiences you may have had when working with information from Web APIs and things we can do to make the lives easier for the developers working with our API.
Our decision:
We’ve decided to provide
XMLandJSONdue to the difficulty in recursion inCSVneeding multiple calls for a single logical operation.JSONdoesn’t have a parser inQtandProtocol Buffersdoesn’t seem to have anon-alpha PHPimplementation so they are out for the moment too but will probably be supported eventually.
CSV is right out. JSON is a more compact object notation than XML, so if you’re looking for high volumes it has the advantage. XML has wider market penetration (I love that phrase) and is supported by all programming languages and their core frameworks. JSON is getting there (if not already there).
Personally, I like the brackets. I would bet more devs are comfortable with working with xml data than with json.