1
这是我第一次使用Facebook凭证登录。我希望能够通过我的账户查询Airbnb中的房源。我在Airbnb的原始帐户是通过Facebook登录。以下是airbnb页面上的示例请求:http://airbnbapi.org/#login-by-facebook。使用Airbnb登录或API登录
我不知道在哪里可以得到我的client_id和Facebook的访问令牌。虽然它指向https://developers.facebook.com/docs/facebook-login/access-tokens以获取用户访问令牌,但如果我理解正确,它需要我创建一个应用程序。我不确定我需要使用哪种认证流程才能使用Airbnb API。
我已经看过Airbnb文档来搜索client_id,但没用。
这是我到目前为止有:
import requests
import json
API_URL = "https://api.airbnb.com"
LISTING_ENDPOINT= "https://api.airbnb.com/v2/search_results"
post_query = {
"client_id": "I HAVE NO IDEA WHERE TO GET IT",
"locale": "en-US",
"currency":"USD",
"assertion_type":"https://graph.facebook.com/me"
"assertion":"HOW SHOULD I GET THIS ONE?",
"prevent_account_creation":True
}
# I think this should be able to log me in and I should be able to query listings
_ = requests.post(API_URL, post_query).json()
query = {
"client_id":"FROM ABOVE",
"user_lat": "40.00",
"user_long":"-54.31"
}
listings = requests.get(LISTING_ENDPOINT, json=query).json()
似乎没有公开的API,但访问私有的似乎微不足道 –
我如何得到我的客户端ID? – mousecoder