In my thesis i am analyzing social activity of users in specific location defined by longitude and latitude. I have managed to get desired tweets using tweets API but Facebook API (and instagram also), especially after lately circumstances is very unclear.
My question is: Is it still possible to query users tweets or status updates from geographic locations? (just text and hashtags from locations - i am not interested in any information related to user personals).
If yes then which access token should i use and which endpoint?
Related
I'm using Facebook graph Api to search users and data that i get is kinda different from that i get from Facebook UI. For example search response of User interface is friends, mutual friends and other related data in first. How can i query to get related data for current user ( i.e friends and mutual friends in first place).
Here is query that i'm using to search users.
https://graph.facebook.com/v2.5/search?fields=id,name,picture.type(normal)&limit=50&q={q}&type=user&access_token={token}
and data that i get is kinda different from that i get from Facebook UI
That’s because those are two completely different things.
The search functionality offered via the UI is called Graph Search. But the powerful possibilities that offers are not exposed via API. (To protect user privacy, and keep apps from doing extended user profiling via that data.)
Searching via API is limited to what is listed here: https://developers.facebook.com/docs/graph-api/using-graph-api/#search
That’s not much – but it’s all you get.
I'm using Facebook graph Api to search users and data that i get is kinda different from that i get from Facebook UI. For example search response of User interface is friends, mutual friends and other related data in first. How can i query to get related data for current user ( i.e friends and mutual friends in first place).
Here is query that i'm using to search users.
https://graph.facebook.com/v2.5/search?fields=id,name,picture.type(normal)&limit=50&q={q}&type=user&access_token={token}
and data that i get is kinda different from that i get from Facebook UI
That’s because those are two completely different things.
The search functionality offered via the UI is called Graph Search. But the powerful possibilities that offers are not exposed via API. (To protect user privacy, and keep apps from doing extended user profiling via that data.)
Searching via API is limited to what is listed here: https://developers.facebook.com/docs/graph-api/using-graph-api/#search
That’s not much – but it’s all you get.
How can I obtain user location information such as state/region and country from the Facebook Graph API without using FQL? According to Facebook documentation, FQL is deprecated after v2.1 so that will not be a solution for much longer. With the Facebook Graph API, if I use a get request to retrieve '/v2.2/me', I can obtain a location object containing a page ID of 112747725406609 and a location name containing a city and region. If I use a GET request to retrieve the page object from '/v2.2/112747725406609', that page object has a location object with a NULL state and country value; however, it does have a latitude and longitude value.
I know from my website I can turn an IP address into a location using a MaxMind IP Location Database. I know that I could use the latitude and longitude to query the Google Map API to get a more precise location. However, I am looking for a solution that does not require an external database or external API other than the Facebook Graph API.
Anybody have any suggestions or recommendations?
It there a way to query Facebook API for users connection near a location ( long/lat) , I was not able to find in their documentation any way to achieve that.
No there is no api from facebook where you can find users connection near by.
But you can get your friends location by using friends_location permission and users location by using users_location.
Once you get users location you can try to find the friends location nearby by using google or yahoo apis.
User location (i.e current_location) is returned in form of (id,state,city,country) which you can use to generate the lat/lng.
You can use this FQL to get more location info : http://developers.facebook.com/docs/reference/fql/place/
or you can use yahoo or google apis.
Facebook doesn't keeps track of your location down to latitude and longitude. That would require knowledge of physical ip addressing schemes of..the world. If you can find a database that has cities listed in lat/long then you can approximate who is closest. If their full address is listed in their personal information then you may be able to cross reference with Google Maps or some other service for more accurate information. I'm not sure how the check-in service works with Facebook and if that holds lat/long information though, so that would be something to look into.
Users can add "Lived places", "Trips" and "Life Events" on a Map on the new Timeline.
As you can get user's checkins via Graph API, I was wondering if it's possible to retrieve those locations as well?
According to the Facebook's Graph API Explorer and documentation this is not currently implemented as a GET possibility in the Graph API.
However, with the appropriate access token, you can retrieve certain aspects of a profile that include a Location ID that can be used to find the Location on Facebook, which you can then retrieve the Address, City, State, Coordinates, etc.
So, all around, the answer is no, at this time, you cannot retrieve Map information with Graph API. Hopefully, Facebook will make this available in the future.
ETA: I just just reviewed the Facebook OAuth Scope List and did some trial and error with the Graph API Explorer. I discovered the following...
While there is a permission scope for "user_location_posts" that must be included in the access token in order to get the location posts (i.e. statuses with a "Place" section) to show up in the feed/posts return from the appropriate GET call, there is no way to only retrieve the posts defined as "user_location_posts." In order to retrieve posts at all, you must first have the "read_stream" or "export_stream" permission which returns everything, not just the location posts.
You're going to need permissions to get the rest of the profile to find the locations on their photos, videos, and any other components that could potentially have a location attached.
There is a strong possibility that there is a Facebook component called "locations". Currently, it returns the GET error "(#100) Subject must be a part of the whitelist" rather than the typical error of "component does not exist". Therefore, it's possible that it's there and that the public does not have access to it at this time. It's also possible that this is just a bug I found.