Calling foursquare userless api from the command line

牧云@^-^@ 提交于 2019-12-11 07:24:45

问题


I have been successfully using foursquare's API with the oauth_token from the command line using wget. E.g.,

wget https://api.foursquare.com/v2/venues/4510e899f964a52089391fe3?oauth_token=MY_TOKEN&v=20120327

With this command, I was able to obtain the response and parse the results. However, since using the authentication token has a limit of 500 requests per hour (etc.) and since I am interested in userless access, I thought of using the client_id and client_secret. However, whenever I am trying to call

wget https://api.foursquare.com/v2/venues/4510e899f964a52089391fe3?client_id=MY_CLIENT_ID&client_secret=MY_CLIENT_SECRET&v=20120327" 

I get a Bad request. Is it possible to do what I am trying ?


回答1:


First, remember that the userless access also have limits (5000 per hour), more info here

The request you listed above should work, I just tested it, replacing the MY_CLIENT_ID with my real id and the secret as well. I know that foursquare is case-sensitive to the request, the client_id/secret should be uppercase.

The only thing I can think of that is creating your problem is a typo, check your data :)



来源:https://stackoverflow.com/questions/9883896/calling-foursquare-userless-api-from-the-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!