jpython
jpython

Reputation: 3

Foursquare - get tips from VENUE_ID

I tried many times the codes below but the error is always the venue id. I am unable to figure out anything wrong with the venue id. 4b564bf1f964a520db0928e3 is a random example here.

My codes:

tips='https://api.foursquare.com/v2/venues/VENUE_ID/tips'

params=dict(client_id=client_id,client_secret=client_secret,v='20170801',VENUE_ID='4b564bf1f964a520db0928e3')

resp_tips=requests.get(url=tips, params=params)

data_tips=json.loads(resp_tips.text)

data_tips

Error message:

{'meta': {'code': 400,
  'errorDetail': 'Value VENUE_ID is invalid for venue id',
  'errorType': 'param_error',
  'requestId': '59e971366a6071382dca9c01'},
 'response': {}}

Upvotes: 0

Views: 859

Answers (1)

Kosuke Ogawa
Kosuke Ogawa

Reputation: 7451

You are using that API in the wrong way. Try the following code:

tips='https://api.foursquare.com/v2/venues/4b564bf1f964a520db0928e3/tips'

params=dict(client_id=client_id,client_secret=client_secret,v='20170801')

resp_tips=requests.get(url=tips, params=params)

data_tips=json.loads(resp_tips.text)

data_tips

Upvotes: 4

Related Questions