Facebook graph api search results depends on location?

后端 未结 2 1244
萌比男神i
萌比男神i 2021-01-02 20:51

I\'ve tried to fetch results using Graph search API and I\'ve notice that the results when executed in my computer (Argentina) are different from the results when I run it i

相关标签:
2条回答
  • 2021-01-02 21:16

    Thanks @Sascha Galley. I also find another easy way.

    Just add &locale=en_US in Facebook Graph search API query URL.

    This is languages and locales list refrence

    0 讨论(0)
  • 2021-01-02 21:23

    I don't know exactly which results are different and which skd version you are using, but one possible approach is to send the accept-language header with the cURL request. In the facebook api php file add the following line in the function makeRequest() below $opts = self::$CURL_OPTS;

    $opts[CURLOPT_HTTPHEADER] = array('Accept-Language: en-us,en;');
    

    This post is almost two years old: Get Facebook Graph API results in English

    Actually, this issue should have already been solved: Return values from the graph-api depend on geographic server location

    0 讨论(0)
提交回复
热议问题