LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-20-2013, 09:23 PM   #1
trscookie
Member
 
Registered: Apr 2004
Location: oxford
Distribution: gentoo
Posts: 463

Rep: Reputation: 30
Google Places API JSon Data


Hello All,

I am trying to retrieve data from Google's Places API but I only seem to receive partial data using the examples provided:

Code:
https://maps.googleapis.com/maps/api/place/radarsearch/json?location=48.859294,2.347589&radius=5000&types=food|cafe&sensor=false&key=MyAPIKey

This is the end part of the result, it does not seem to contain the 'Address' or the 'Name' in the data, what could I be missing?:

Code:
      {
         "geometry" : {
            "location" : {
               "lat" : 48.854067,
               "lng" : 2.336876
            }
         },
         "id" : "cbf69cd8c0c5874e65826804ca32804cc05554a6",
         "reference" : "CnRpAAAASJHvjkWfbiNVXPiSM1LZ9W0bUsNkpNg8MQxSDMnoVcWEpnaTVQQ13ACQe70uARaag9ROrYF7CO64gz2K7l3vAntax4HCQ970DznSz3kRuYC1eMjy8UY6oqyXCjUQA4wdaJNCipmlot4VweOmsdnQzhIQxjGWlwDvtGVV_mryMBpHDBoUjNOjbu4s3beu-RLTfUUAClgNWZU"
      },
      {
         "geometry" : {
            "location" : {
               "lat" : 48.859226,
               "lng" : 2.343194
            }
         },
         "id" : "81043f004b7a10b8aa90b22abf26d7ba9e6ddbd2",
         "reference" : "CnRpAAAAQ1WqarpjVxRV3KzjHLr1leK5tz-biVJKpsubYxdz_2RobMOomm3NdQBGH6rJ-o3SpqEawofy1nHYGfzRKzj22EBB--twS7t8b0pDAHMcRKq84Pt7IhFBlxqw0TJ-k4AEFQOkZKsNJmgC8D9PcdP3mhIQnGEFSKW6XuuY97IhsQsCqRoUUMzTb3hlQALd6lfi551fDNKSeGU"
      },
      {
         "geometry" : {
            "location" : {
               "lat" : 48.865602,
               "lng" : 2.327369
            }
         },
         "id" : "751a05ec173f53ba581d8a32e047a69302c4886c",
         "reference" : "CnRwAAAAY_M2ykIP9uhznSrhX3ZQivZppc2QN-26u42VHLB-sFFuhtKUItpnazRuEYyG2YWlAWAiyh1U-vC8TvnKcIHsAWGJbPnu7JrljZFsE8YUHFuRUXg1DJC-tSBKljE8humdTgpBDXqSK-0cXTo3bpyy5RIQ-1MKJwToG7YgDqIoL6txOhoUjFke09XGZbo5w1wJZgp___6cnwI"
      },
      {
         "geometry" : {
            "location" : {
               "lat" : 48.854614,
               "lng" : 2.332805
            }
         },
         "id" : "ae281cf5bdb180a0724b37969414efe000a705c1",
         "reference" : "CpQBiQAAALaBY5SzqfFSXSVoyyy3w9N0I5xajK7R7jisN23Ll9EBkFnr8XQ7KZsLxsqj0S4DshxGPtEoIi1jvrdB_iZ6Xt9jR4gViQoRV3U8UyrDwzHYUvAhRZj06UNGZL9lkJrZkaIZM9hb6StBnI709UUeWzujDDSvuz2yVtF3IB2TWyDQ21F1ShFMYMyUOCJWnFeEVxIQX8PSx8RVsgYA_4fpyS395BoUWOmPr84ZfZg92isCZRxxpnjdJI0"
      }
   ],
   "status" : "OK"
}

Every example that I see online appears to retrieve information like this:

Code:
{
   "html_attributions" : [],
   "results" : [
      {
         "geometry" : {
            "location" : {
               "lat" : 33.7862590,
               "lng" : -117.8531270
            }
         },
         "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
         "id" : "5be9a13a28635cf8fd2ef3c62c24d51277a4ba58",
         "name" : "Kimmies Coffee Cup",
         "rating" : 3.30,
         "reference" : "CnRpAAAANKLoOHJ1STFaFavIPjm2bpMDneGTv0AXfixyl-koF7KSK-lQSldk3c01RFJu9Gf62zXnRScte-dkPCBU8KuxCo7AMctfuaIhNkPE8RKENF9HeMlkuEg-Scp97--1VWJvjpNQjc6xRvdXsbf7V8NrSRIQnXjZBKbrSeSg2sTwBosKghoUEFlNDIN5cnVbn5n7aNtwycord-E",
         "types" : [ "restaurant", "food", "establishment" ],
         "vicinity" : "190 S Glassell St # B, Orange"
      }
      ]
}
Many thanks for your help.

trscookie

Last edited by trscookie; 11-20-2013 at 09:35 PM.
 
Old 12-08-2013, 03:13 PM   #2
OMouse
LQ Newbie
 
Registered: Aug 2005
Location: Canada
Distribution: Linux Mint, Ubuntu
Posts: 13

Rep: Reputation: 7
I would suggest looking at the updated Google Places API Docs: https://developers.google.com/places...SearchRequests

The examples now show that the results returned include a field called "formatted_address":

"results" : [
{
"formatted_address" : "529 Kent Street, Sydney NSW, Australia",
"geometry" : {
"location" : {
"lat" : -33.8750460,
"lng" : 151.2052720
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"id" : "827f1ac561d72ec25897df088199315f7cbbc8ed",
"name" : "Tetsuya's",
"rating" : 4.30,
"reference" : "CnRmAAAAmmm3dlSVT3E7rIvwQ0lHBA4sayvxWEc4nZaXSSjRtfKRGoYnfr3d5AvQGk4e0u3oOErXsIJwtd3Wck1Onyw6pCzr8sw W4E7dZ6wP4dV6AsXPvodwdVyqHgyGE_K8DqSp5McW_nFcci_-1jXb5Phv-RIQTzv5BjIGS0ufgTslfC6dqBoU7tw8NKUDHg28bPJlL0vGVWVgbTg",
"types" : [ "restaurant", "food", "establishment" ]
},

There's more detail about the results returned here: https://developers.google.com/places...eSearchResults
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Search Image API / WebService mlpa Slackware 5 08-05-2013 03:01 PM
Data gets written to two different places in RAM rp0777 Linux - Hardware 3 02-08-2012 05:00 PM
Official Google API to Search ? Xeratul Linux - General 1 11-22-2011 02:27 PM
Google voice API aarsh Linux - Newbie 2 06-09-2011 07:18 AM
[SOLVED] How to efficiently get & process stuff from JSON encoded serialized data string? GrapefruiTgirl Programming 13 04-03-2010 03:20 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration