title: Parsing JSON from Google API on iPhone
body: <p><strong>EDITED CODE</strong></p>
  
  <p>I had done in this way:</p>
  
  <pre><code>// Create new SBJSON parser object
      SBJsonParser *parser = [[SBJsonParser alloc] init];
  
      // Prepare URL request to download statuses from Twitter
      NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com/maps?q=restaurant&amp;sll=23.00,72.00&amp;radius=2000&amp;output=json"]];
  
      // Perform request and get JSON back as a NSData object
      NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
  
      // Get JSON as a NSString from NSData response
      NSString *json_string = [[NSString alloc] initWithData:response encoding:NSASCIIStringEncoding];
      [json_string stringByReplacingOccurrencesOfString:@"while(1);" withString:@""];
  
      NSDictionary *json_dict = [json_string JSONValue];
      NSLog(@"%@",json_dict);
  </code></pre>
  
  <p>But then also I'm getting <code>null</code> in <code>json_dict</code></p>
  
  <p>I want to parse the data which I get from Google Webservice.</p>
  
  <p><a href="http://www.google.com/maps?q=restaurant&amp;sll=23.00,72.00&amp;radius=2000&amp;output=json" rel="nofollow">http://www.google.com/maps?q=restaurant&amp;sll=23.00,72.00&amp;radius=2000&amp;output=json</a></p>
  
  <p>I have used the below code:</p>
  
  <pre><code>// Create new SBJSON parser object
  SBJsonParser *parser = [[SBJsonParser alloc] init];
  
  // Prepare URL request for Getting the Restaurent at particular coordinate.
  NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com/maps?q=restaurant&amp;sll=23.00,72.00&amp;radius=2000&amp;output=json"]];
  
  // Perform request and get JSON back as a NSData object
  NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
  
  // Get JSON as a NSString from NSData response
  NSString *json_string = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
  
  // parse the JSON response into an object
  // Here we're using NSArray since we're parsing an array of JSON status objects
  NSArray *statuses = [parser objectWithString:json_string error:nil];
  </code></pre>
  
  <p>But I am not getting the response. If I use some other API like: <a href="http://twitter.com/statuses/public_timeline.json" rel="nofollow">http://twitter.com/statuses/public_timeline.json</a>, it will parse properly, but this does not work for Google APIs</p>
  
  <p>I had checked the response string in JSON version. The response which we get is forming a proper tree. It is not showing any error but the array in response which I get is null.</p>