Hi,
I just started playing with foursquare api for my new app. My ultimate aim is to get the venue details by the category and radius. Ffirst i queried fq to get the available categories. for ex category id for the train station is
"id": "4bf58dd8d48988d129951735",
"name": "Train Station",
"pluralName": "Train Stations",
To get the nearby railway stations in the area i tried
https://api.foursquare.com/v2/venues/search?ll=13.0454044,80.22167450000006&categoryid=4bf58dd8d48988d129951735&radius=1000
it returns tottally relevant results,
"items": [
{
"id": "4e54f28022710ebb5a90151f",
"name": "Shobana Kalyana Mandapam",
"contact": {},
"location": {
"lat": 13.046005,
"lng": 80.2227668,
"distance": 136
},
"categories": [
{
"id": "4bf58dd8d48988d171941735",
"name": "Event Space",
"pluralName": "Event Spaces",
"shortName": "Event Space",
"icon": "https://foursquare.com/img/categories/building/default.png",
"parents": [
"Professional & Other Places"
],
"primary": true
}
],
"verified": false,
"stats": {
"checkinsCount": 4,
"usersCount": 4,
"tipCount": 0
},
"hereNow": {
"count": 0
}
},
{
"id": "4e7eafeb9a52cf249eb70578",
"name": "Bharat Petroleum Station",
"contact": {},
"location": {
"address": "Arcot Road",
"lat": 13.047295,
"lng": 80.22062818181818,
"distance": 239,
"postalCode": "600034",
"city": "Chennai",
"state": "Tamil Nadu"
},
"categories": [
{
"id": "4bf58dd8d48988d113951735",
"name": "Gas Station or Garage",
"pluralName": "Gas Stations or Garages",
see here category id 4bf58dd8d48988d171941735 & 4e7eafeb9a52cf249eb70578 is assigned to different categories like Gas Station or Garage & Event Space and so on but not railway station
but when i use query param instead categoryid
https://api.foursquare.com/v2/venues/search?ll=13.0454044,80.22167450000006&query=train_station&radius=1000
{
"id": "4e69de1d227162c38e2aaf51",
"name": "Mambalam Station",
"contact": {},
"location": {
"lat": 13.038308684210525,
"lng": 80.22245289473685,
"distance": 794
},
"categories": [
{
"id": "4bf58dd8d48988d129951735",
"name": "Train Station",
"pluralName": "Train Stations",
"shortName": "Train Station",
..........
"id": "4bbfd9b0f8219c7438ccb010",
"name": "Kodambakkam Railway Station",
"contact": {},
"location": {
"address": "Kodambakkam",
"lat": 13.05123746395111,
"lng": 80.2295708656311,
"distance": 1074,
"postalCode": "India",
"city": "Chennai",
"state": "Tamilnadu"
},
"categories": [
{
"id": "4bf58dd8d48988d12a951735",
"name": "Train",
"pluralName": "Trains",
i got the perfect results. here category id
4bf58dd8d48988d12a951735 correctly matches the train stations.
i dont know what messes this up? can someone clarify me..
Cheers