hownowstephen/php-foursquare

venues/explore missing information

Closed this issue · 3 comments

Calling the venues/explore endpoint seems to be missing fields such as contact, url despite them showing up on the foursquare website:

https://foursquare.com/developers/explore#req=venues%2Fexplore%3Fnear%3DLondon%2C%20UK

could you please provide a code sample & some example JSON showing what you're expecting vs what you're getting? This library acts as a thin wrapper over the API, so it is heavily dependent on how the base request is formed

@hownowstephen if I query the following endpoint via the foursquare API explorer:

https://api.foursquare.com/v2/venues/explore?near=London

it includes fields for url and contact. I've included an example for regents park below. When making the same call via your package, these fields seem to be missing, I'm not sure why. There may be other fields that don't match, but these are the two I'm interested in at the moment.

Thanks!

"venue": {
"id": "4b233922f964a520785424e3"
"name": "Regent's Park"
"contact": {                                                              // this is missing when called from php-foursquare
"twitter": "theroyalparks"
"instagram": "theroyalparks"
"facebook": "45265977565"
"facebookUsername": "RegentsParkandPrimroseHill"
"facebookName": "The Regent's Park and Primrose Hill"
}
"location": {
"address": "Chester Rd"
"lat": 51.53047945949403
"lng": -0.15376567840576172
"labeledLatLngs": [
"0": {
"label": "display"
"lat": 51.53047945949403
"lng": -0.15376567840576172
}
]
"postalCode": "NW1 4NR"
"cc": "GB"
"city": "London"
"state": "Greater London"
"country": "United Kingdom"
"formattedAddress": [
"0": "Chester Rd"
"1": "London"
"2": "Greater London"
"3": "NW1 4NR"
]
}
"categories": [
"0": {
"id": "4bf58dd8d48988d163941735"
"name": "Park"
"pluralName": "Parks"
"shortName": "Park"
"icon": {
"prefix": "https://ss3.4sqi.net/img/categories_v2/parks_outdoors/park_"
"suffix": ".png"
}
"primary": true
}
]
"verified": true
"stats": {
"tipCount": 344
"usersCount": 27723
"checkinsCount": 53445
}
"url": "https://www.royalparks.org.uk/parks/the-regents-park"                   // this is also missing
"rating": 9.7
"ratingColor": "00B551"
"ratingSignals": 3515
"beenHere": {
"count": 0
"marked": false
"lastCheckinExpiredAt": 0
}
"hours": {
"status": "Likely open"
"richStatus": {
"entities": [
]
"text": "Likely open"
}
"isOpen": true
"isLocalHoliday": false
}
"photos": {
"count": 0
"groups": [
]
}
"venuePage": {
"id": "42154907"
}
"hereNow": {
"count": 2
"summary": "2 people are here"
"groups": [
"0": {
"type": "others"
"name": "Other people here"
"count": 2
"items": [
]
}
]
}
}

I'm seeing the same result, it appears to be a mismatch in how foursquare shows their data in their browser-based explorer. If you look at the documentation https://developer.foursquare.com/docs/api/venues/explore#response-fields for that endpoint's response, it only guarantees warning, groups, suggestedRadius, headerLocation, headerFullLocation, headerMessage, id, name, location, categories as response values.

I was able to get the contact portion by doing a separate request to the venue detail page https://api.foursquare.com/v2/venues/4b233922f964a520785424e3 - I'd suggest raising this question with Foursquare as to why their browser explorer is returning data differently from their API. Since I originally wrote the library, it appears they've added tiers of access to their resources, it could be that they show more complete data to paid accounts?