JSON Parsing Libraries

JSON Parsing Libraries

The Brewing Co. app gets the band’s calendar of events from Google Calendar. Google’s REST-ful web API returns data in the JSON format, so one of our first decisions when making the app was which JSON parser to use.

Google offers a client library for accessing the Google Calendar web APIs. However, their client is in alpha (not even beta!) and is fairly heavy-weight. We wanted something less cumbersome, since we’re only using a small subset of the features provided by the API.

In iOS 5, Apple introduced a built-in JSON parser, NSJSONSerialization. It’s quick and easy to use. However, we couldn’t use it because we think it’s still too early to begin writing iOS 5-only apps.

So after a bit of study, we decided that JSONKit was the best option. It’s the fastest, lightest library we could find. It’s very self-contained (one .m file and its corresponding .h) and very easy to use. We recommend it highly.

One Reply to “JSON Parsing Libraries”

  1. Hi, I am trying your sotiouln to convert JSON to CSV and have one question with 2 parts..1) How could I change the code in your example to retrieve the JSON from a URL, whose output is JSON. Its actually nearly 156 URLS because I have to change the page number argument (?p=1, ?p=2, , ?p=156) since the creator of that web service only outputs 50 records from their server per page.. I’d like to get that automatically and create one large array to be converted to CSV. 2) The URL contains my API key so I must keep this on a local machine does that hinder its operation? Does it have to be hosted out there somewhere?This is ultimately going to populate a database the first time and then refresh the database each day after the initial creation by way of an update routine that checks for changes. So its going from JSON out on the web to CSV on my machine and eventually to a MS Access DB on my network.Sorry for the long question but JSON is foreign to me like XML is. I can deal with CSV and have been importing CSV without issue for a long time. I just got to get the JSON to CSV and I am cool.

Leave a Reply

Your email address will not be published. Required fields are marked *