0

I'm working on a social hub page which aggregates info from all social networks. Currently I'm trying to fetch infos from one specific foursquare venue.

To get the information I want, I have to use an access token and therefore authenticate my user. In my case this would always be the same (my own) user.

Is there a way to get an access token with my username/password without having to redirect to the authentication page?

I couldn't find any answers here so far, thanks for your help!

Update: I just discovered exactly what I want to implement on http://de.puma.com/creativefactory - if you scroll down you can see foursquare information on the bottom right corner, that's exactly what I want: Display how many users checked into my venue and the last persons who checked in. How did they do that, there is no auth dialog required? Thanks again!

Hannes
  • 3,752
  • 2
  • 37
  • 47

3 Answers3

1

Unfortunately, this is explicitly not allowed for security reasons. Although it may seem safe in your case, we don't generally want to support 3rd-party applications handling our users' passwords when OAuth makes it unnecessary. This is the same policy that many other large social networks have.

smehmood
  • 1,906
  • 12
  • 9
  • i just discovered exactly what i want to implement on http://de.puma.com/creativefactory - if you scroll down you can see foursquare information on the bottom right corner, that's exactly what i want: display how many users checked into my venue and the last persons who checked in. how did they do that, there is no auth dialog required? thanks again! – Hannes Jun 01 '12 at 11:49
1

If you're just looking for venue information (e.g. just information about a venue and NOT any user information) then you don't need to have an authorized user. The venues API can be accessed with only your client ID and client secret. See the Foursquare API documentation..

Some of our endpoints that don’t pertain to specific user information, such as venues search are enabled for userless access (meaning you don’t need to have a user auth your app for access). To make a userless request, specify your consumer key's Client ID and Secret instead of an auth token in the request URL.

Mark S.
  • 3,849
  • 4
  • 20
  • 22
1

You should be able to get the required information without user authorisation.

Just create an app and you will be provided with a client id and client secret, you can then use these to access the API.

Here is the required venue API string format:

https://api.foursquare.com/v2/venues/[VENUE_ID]?client_id=[CLIENT_ID]&client_secret=[CLIENT_SECRET]&v=20120101

In the returned json you should find:

"hereNow":{"count":x,"summary":"x people here","groups":[]}
Keith
  • 1,136
  • 2
  • 13
  • 30