Get related interests to an interest using ID - facebook

I use the following link/request to get the related interests to an interest ID however after few request I've got limited!
https://www.facebook.com/ads/audience-insights/query/?fb_dtsg_ag=KEY_HERE&age[0]=18&age[1]=-1&country[0]=US&interests[0]=INTEREST_ID&metrics[0]=2&admarket_id=ID_HERE&logger_session_id=SESSION_Key&__user=USER_ID&__a=1&__dyn=key_HERE&__req=p&__be=1&__pc=PHASED%3Aufi_home_page_pkg&dpr=1&__rev=CODE_HERE&jazoest=CODE_HERE&__spin_r=CODE_HERE&__spin_b=trunk&__spin_t=CODE_HERE
Error :
for (;;);{"__ar":1,"error":1958125,"errorSummary":"API rate
limited","errorDescription":"User has exceeded the API rate limit
for the minute/hour/day, or user has been
blacklisted.","transientError":1,"payload":null,"bootloadable":{},"ixData":{},"bxData":{},"gkxData":{},"qexData":{},"lid":"6659351899596611810"}
NOTE: You can generate the same link by going to Audience insight and search for an interest then switch to Page like tab.
My question : Is there anyway to make the same request via Facebook Graph API?

Related

Searching public profiles using Facebook Graph API

I am looking to search Facebook public profiles using the Graph API with parameters like name, location and age. To accomplish this I created a Facebook app to get an app ID but I am unsure as to how to proceed to make the query to the API.
To try it out I tried using the explorer (https://developers.facebook.com/tools/explorer/) but I am unable to get any results that does not contain "me". I made sure to get a access token and enter a query like the following:
search?q=tobias&type=user&fields=id,name
The only reply is:
{
"data": [
]
}
I feel like I am missing something but I have been unable to figure out what, please advice.
The search endpoint is broken since 2018-04-04 for certain search types, including pages and users.
Search API
You can no longer use the /search endpoint with the following object types:
event
group
page
user
See
https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#search-4-4
Due to what has recently been in the news, searching for users has been deprecated, and is not supported through Facebook APIs.

How to get Facebook page total likes number with the new Graph API (v2.4)

So recently there was a update to the Facebook Graph API and now pretty much everything requires a access_token to retrieve any type of data.
Previously you could get the number of page likes by accessing the graph like so:
http://graph.facebook.com/{page-name}
But now if you try it says you need to have a access token because of a recent update to the API. Now the issue i am having is i cant access the likes even with an access token this is the response i am getting:
Request
http://graph.facebook.com/{page-name}/?access_token={access_token}
Response
array(2) {
["name"] "Page Name"
["id"] "Page Id"
}
Now at first i thought the access token wasn't being generated with the correct scopes but i am 99% sure you only need read_stream to pull that type of data.
Second thought is that they have removed the ability to acces likes of any page and you need a page token to receive that type of data or finally i am missing something incredibly small here and its still achievable?
So my question is can you still get the number of likes of any page using the Facebook Graph API and if the answer is yes how do you do it?
any help appreciated
This can help you! Just add ?fields=likes after the page name/id. You can use any access token for fetching data!
graph.facebook.com/{page_name}?fields=likes&access_token={token}
The Graph API v2.4 reduces the number of fields in default responses.
https://developers.facebook.com/blog/post/2015/07/08/graph-api-v2.4/
Fewer default fields for faster performance: To help improve performance on mobile network connections, we've reduced the number of fields that the API returns by default. You should now use the ?fields=field1,field2 syntax to declare all the fields you want the API to return.
If you do ?fields=likes it should show up.
You can do like this:
https://graph.facebook.com/v2.4/{page_id}/fields=likes

Facebook FQL posts limit issue

Currently i am using following FQL query :-
https://api.facebook.com/method/fql.query?query=select post_id,likes FROM stream WHERE source_id=XXXXXXXX LIMIT 0,10000&access_token=XXXXXXXXXXXXX&format=json
I have two Facebook Accounts / pages & able to download data using above API. Able to retrieve posts & post likes count.
But, from last three days, for one Facebook account above FQL query is not working. it is returning message :- "error": "Request failed" . For other account it is working fine.
For each facebook Account / pages i have generated separate Access Tokens.
But, if i update limit from : -
Limit 0,50
Limit 50,100
then it is working & returning posts from page but not returning all post which i have previously getting from Limit 0,10000
Please help me, if any one have idea about this issue ?
Thanks
Facebook will cancel queries which take too long or too many resources to execute. In general, I would never use LIMITs which are that high. There's a high probability that they will fail, and you can't really incfuence the query execution "load" other than setting the LIMIT to a reasonable number (which means implementing a paging mechanism).

How to get information from page facebook api graph

I have two examples:
Example 1:
https://www.facebook.com/cocacola
I get "likes","description" at https://graph.facebook.com/cocacola/
It work.
Example 2:
https://www.facebook.com/selectivefitness
I get errors at https://graph.facebook.com/selectivefitness/
Why example 2 does not working? How i can get "likes" "description" of https://www.facebook.com/selectivefitness
It's because of restrictions on the page (either country restrictions or age restriction). You just need a valid Access Token to fix it.
Try making a request to the URL using that Access Token. Something like:
https://graph.facebook.com/selectivefitness?access_token={Access_Token}
You can always make use of Graph API Explorer to test your requests and queries.

Facebook Places API 500 result limit

Facebook OpenGrap API limit results of [id]/checkins to 500. Is there are way to retrieve more than 500. Example if I want to retirve all the place someone has checkin for year 2011. What are possible available methods. Is there a premium service provided by Facebook.
Regards,
Waruna.
As the open grpah documentation describes, there should be a "paging" object at the end of the api response if there is more content than you could load at one time. You can test this by clicking the example links inthe documentation. So, the solution is: Loop your requests until there is no "next" property in the "paging" object of the response.
Also there are possibilites to batch your requests, maybe this is also useful for you.