Igor Jakovljevic
Igor Jakovljevic

Reputation: 84

How to get geolocation of facebook status using facebook graph API

So I'm trying to get latitude and longitude of facebook statuses to map them, can someone give me some idea on how to do that.

Thanks ...

Upvotes: 1

Views: 5919

Answers (1)

Sahil Mittal
Sahil Mittal

Reputation: 20753

Firs make the API call - /me/statuses to get all the status of the user.
Permission required: user_status
Demo

You'll get the response as-

{
   "data":[
     {
       "id": "10152044171758611", 
       "updated_time": "2014-02-15T12:12:59+0000"
     }, 
     {
        "place": {
            "id": "XXXXXXXXXXXXX", 
            "name": "XXXXXXX", 
            "location": {
               "city": "XXXXXXX", 
               "country": "XXXXXX", 
               "latitude": 28.573024614741, 
               "longitude": 77.230443565217, 
               "street": "XXXXXXXXXX", 
               "zip": "XXXXXXXX"
             }
        }, 
        "id": "XXXXXXXXX", 
        "updated_time": "2014-02-10T18:13:36+0000"
     }, 
     ... 
  ]
}

Check if the element has place field, that means this status has some place with it. Fetch the place details. That's it!

Upvotes: 1

Related Questions