Get JSON response from facebook api restserver

I want to get the same number of pages. I tried using the PHP SDK, but I refused it because my site always stops loading after the line of code where the FQL query is executed, so I wanted to try to get the same score manually.

I tried using file_get_contents () on https://api.facebook.com/restserver.php?method=fql.query&query=QUERY&format=json , but it shows nothing.

Do you know how I can get a JSON string from the above url where I can use json_decode (), or even a better way to get the count value ?

Any help is appreciated.

PS If this means something, QUERY - SELECT like_count FROM link_stat WHERE url = "page_url_here"

+3
source share
1 answer

Your FQL must be encoded and you can use the new URL:

https://api.facebook.com/method/fql.query?query=SELECT%20like_count%20FROM%20link_stat%20WHERE%20url%3D%22http%3A%2F%2Fsample.com%22&format=json&access_token=<ACCESS_TOKEN>
0
source

Source: https://habr.com/ru/post/1761570/


All Articles