gpt4 book ai didi

php - Foursquare - 使用端点 'venues/explore' 比 'venues/search' 更少的 field 响应结果

转载 作者:搜寻专家 更新时间:2023-10-31 22:02:58 26 4
gpt4 key购买 nike

我们已经使用 php foursquare api 检查了两种情况下的 field 结果,

案例 1:端点“venues/search”

            $params = array("ll"=>"34.149087500000000000,77.538450700000000000","intent"=>"browse", "radius"=>"99000","limit"=>"100");
$response = $foursquare->GetPrivate("venues/search",$params);
$recents = json_decode($response);
echo "<pre>";print_r($recents);echo "</pre>";

结果:

    Venue count is 50.      

案例 2:端点“venues/explore”

            $params = array("ll"=>"34.149087500000000000,77.538450700000000000","radius"=>"99000","offset"=>"0","limit"=>"100");
$response = $foursquare->GetPrivate("venues/explore",$params);
$recents = json_decode($response);
echo "<pre>";print_r($recents);echo "</pre>";

结果: field 数为 4。

对于以上两种情况,我们在参数中使用了相同的纬度和经度。当我们使用端点“Venues/Search”时,有 50 个 field 返回,但当我们使用端点“Venues/Explore”时,只有 4 个 field 返回。为什么使用端点“Venues/Explore”时 field 不匹配。

最佳答案

根据我尝试定义这些端点的个人经验,Foursquare API 团队的某个人是这样解释的:

探索模式更像是“现在我周围有哪些有趣的地方?”而搜索对于诸如“我知道附近某处有一家咖啡店,让我找到它”之类的内容更好。

我希望这能让您有更深入的了解。

--编辑--

进一步阅读 API,在没有为探索端点指定部分的情况下,默认回退查询是“咖啡店”,而搜索只会返回您指定半径内所有场所的最多 50 个结果。

关于php - Foursquare - 使用端点 'venues/explore' 比 'venues/search' 更少的 field 响应结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24670810/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com