Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FourSquare Venues API

Tags:

foursquare

I am a bit shaky on how to use the venues API in forusquare. My main question is related to OAuth. I want to be able to do venue searches on the server side of the system, and i need the server to login into foursquare automatically. It says on the website that foursquare doesn't require user authentication to use some of the venue functions, however whenever i try to do a call to: venues/categories without specifying an oath_token I get a permission error.

How can i do venue calls without having to use a user login?

Thanks in advance.

like image 216
user1103881 Avatar asked Dec 17 '11 20:12

user1103881


People also ask

What is Foursquare Places API?

The Places API lets you bring location context into your applications with the speed and reliability you need to scale by providing rich, accurate, point of interest (POI) data that you can trust to meet your needs at any scale. Provide search results that have meaning.

Is Foursquare API free?

To build this application we take the help of FourSquare API, so you need to have a developer account in the FourSquare Developer portal, don't worry it's free to use.

How do you add a location to Foursquare?

To claim your listing on Foursquare as a single-location business, follow these steps: Step 1: Visit https://foursquare.com/venue/claim and search for your business. Enter your business' name and location, and Foursquare will pull up any existing listings that could be a match.


1 Answers

It would help if you had given the exact url you are trying to call, but in general:

The userless requests to Foursquare still require the client id and client secret that you get when you register the OAuth Consumer in foursquare.

Using the id + secret you can access Venue API endpoints without authenticating with a user.

So if I got to the Venues Categories endpoint you can see that it does not require and acting user and thus accessing:

https://api.foursquare.com/v2/venues/categories?client_id={0}&client_secret={1}&v={2}

Will get the categories list.
In that example, replace {0} with your client id, {1} with your client secret and {2} with whatever version date you feel comfortable with, today would be 20111218

More can be found here https://developer.foursquare.com/overview/auth#userless

like image 154
Jonathan Levison Avatar answered Oct 10 '22 19:10

Jonathan Levison