foursquare API上的categoryId参数是否有任何限制?

时间:2012-08-21 18:29:54

标签: foursquare

使用Foursquare API时,如果我在categoryId参数中最多传递6个类别的ID,则可以正常工作。但是,如果我通过7或更多,Foursquare返回500内部服务器错误,说他们的服务器已关闭(见下文)。事实是服务器已启动,API文档没有说明类别限制。我正在使用的具体查询是:

https://api.foursquare.com/v2/venues/search?v=20120321&ll=-19.879190%2C-43.927068&limit=50&intent=checkin&radius=500&categoryId=4d4b7105d754a06374d81259%2C4d4b7104d754a06370d81259%2C4d4b7105d754a06377d81259%2C4d4b7105d754a06375d81259%2C4d4b7105d754a06378d81259%2C4d4b7105d754a06379d81259&client_id=[MY_CLIENT_ID]&client_secret=[MY_CLIENT_SECRET]

如果我添加4d4b7105d754a06372d812594d4b7105d754a06376d81259等类别(所有有效类别),服务器将开始返回500 Internal Server Error。这是一个错误,还是我错过了什么?

我不认为这是一个URL大小限制,因为在传递6个类别ID时,带有转义的整个URL正好是410个字符。

错误回复如下:

HTTP/1.1 500 Internal Server Error
Date: Tue, 21 Aug 2012 18:19:48 GMT
Content-Length: 183
Content-Type: application/json
Connection: close
Server: nginx/1.2.1

{
  "meta":  {
    "code": 500,
    "errorType": "server_error",
    "errorDetail": "Foursquare servers are experiencing problems. Please retry and check status.foursquare.com for updates."
  },
  "response":  {}
}

1 个答案:

答案 0 :(得分:1)

我认为这已经修复了 - 我尝试了只搜索30个类别的搜索,它似乎有效。没有服务器错误,我从大多数类别中得到了很好的场地样本。