Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在python中从Yelp API请求中获得3条评论?_Python_Api_Yelp - Fatal编程技术网

如何在python中从Yelp API请求中获得3条评论?

如何在python中从Yelp API请求中获得3条评论?,python,api,yelp,Python,Api,Yelp,嗨,我正试图为我已经拥有企业ID的企业列表提取3条评论。到目前为止,我已经写了这么多的代码。我需要一个功能,将专门检索业务审查从YelpAPI。 请让我知道可以创建什么函数来添加到该函数,以检索相同的函数。谢谢 “”“ 你在找这样的东西吗 def get_three(id1, id2, id3): return [get_business(API_KEY, id) for id in [id1, id2, id3]] Yelp Reviews API端点最多返回3条评论。无需过滤任何内

嗨,我正试图为我已经拥有企业ID的企业列表提取3条评论。到目前为止,我已经写了这么多的代码。我需要一个功能,将专门检索业务审查从YelpAPI。 请让我知道可以创建什么函数来添加到该函数,以检索相同的函数。谢谢

“”“


你在找这样的东西吗

def get_three(id1, id2, id3):
    return [get_business(API_KEY, id) for id in [id1, id2, id3]]

Yelp Reviews API端点最多返回3条评论。无需过滤任何内容,只需使用它,它将返回最多3条结果。

不完全正确。我正在寻找一个函数,该函数将命中我为某人创建的业务评论端点,但它可能会有所帮助,将url参数与您所需的业务交换,看看它是否提供了所需的内容ed@Ilan P我在寻找代码而不是输出。感谢您的回复。
def get_three(id1, id2, id3):
    return [get_business(API_KEY, id) for id in [id1, id2, id3]]