简体   繁体   English

使用 Python 在 Yelp 上检索特定用户的评论

[英]Retrieve the reviews of a particular user on Yelp using Python

Given a user ID on YELP.com, how can I fetch the reviews written by that person?给定 YELP.com 上的用户 ID,我如何获取该人撰写的评论? PS, I'm using yelpapi package in Python. PS,我在 Python 中使用 yelpapi 包。 My code is simple and as an example to search for a specific term I have it is something like the following.我的代码很简单,作为搜索特定术语的示例,我的代码如下所示。 But I need to search based on a "user_id" instead of "term" or "location" in my example.但是在我的示例中,我需要根据“user_id”而不是“term”或“location”进行搜索。 Apparently search_query doesn't have any argument for user ID.显然 search_query 没有任何用户 ID 参数。

from yelpapi import YelpAPI
from pprint import pprint


CONSUMER_KEY = ''
CONSUMER_SECRET = ''
TOKEN = ''
TOKEN_SECRET = ''


yelp_api = YelpAPI(CONSUMER_KEY, CONSUMER_SECRET, TOKEN, TOKEN_SECRET)

response = yelp_api.search_query(term = 'Restaurant', location = 'Prodidence, RI',
                                 sort = 2, limit = 1)
pprint(response)

You aren't able to.你没办法。 The Yelp API is intentionally limited to a few types of queries, and grabbing user data is not available. Yelp API 有意限制为几种类型的查询,并且无法获取用户数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM