首页 > 解决方案 > facebook api图不搜索用户

问题描述

我正在尝试查找用户,但它引发了身份验证错误

import requests
from urllib.parse import urlencode

token = 'my-token'
graph_url = 'https://graph.facebook.com/v3.2/search?'

params = {
    'q':'francisco',
    'type':'user',
    'method':'get',
    'format':'json',
    'access_token':token
}

url = graph_url+urlencode(params)

resp = requests.get(url)
print(resp.json())

错误:

{'error': {'message': 'Unsupported operation', 'type': 'OAuthException', 'code': 100, 'fbtrace_id': 'Dao1UbelGkF'}}

似乎我做得不好或不再允许搜索

标签: facebookfacebook-graph-api

解决方案


https://developers.facebook.com/docs/graph-api/changelog/break-changes#search-4-4

自 2018 年以来,搜索用户不再可用。无论如何,这没有任何意义,您只能获得授权您的应用程序的用户。


推荐阅读