Foursquare explore API returning different result than in foursquare app - foursquare

this is sample explore url :
https://api.foursquare.com/v2/venues/explore?ll=31.4658656,74.3844226&radius=800&limit=30&sortByDistance=1&client_id=CLIENT_ID&client_secret=CLIENT_SECRET&v=20130911&locale=en
venue return from this api is different from venues in foursquare app for same coordinates.

Your URL is Userless access. foursquare app uses oauth_token instead of client_id/client_secret.
ex)
https://api.foursquare.com/v2/venues/explore?ll=40.7,-74&oauth_token=USER_ACCESS_TOKEN&v=20150824
This is why your URL return different result than in foursquare app.
To use oauth_token, you need to authenticate the user.
Document:
https://developer.foursquare.com/overview/auth#access

Related

How to access Instagram Graph API and use Instagram webhooks?

I'm trying to create an app in which I would like to display user feeds from social media apps like Instagram. I want the data to be as live as possible so I tried to integrate Instagram Webhooks. I have created a server side application with Instagram's authentication and a callback url for webhooks through which I want to fetch data from Instagram and then store it in a database.
I have been going through the Official documentation. I was able to get User id, name, comments through Instagram API and I have also subscribed Instagram's webhooks in my meta developer's application. It didn't throw any error but when I like or comment on my post I couldn't get any object in the callback URL. I'm completely new to this so It would be great if someone could explain me how to do this?

Instagram Graph API - get IgMedia likes ie. liked_by

When working with Facebook's API fro Facebook, one can retrieve an object likes like documented on Facebook Graph API
I'm trying to do the same for Instagram's Graph API, ie. get list of likes on a IgMedia object. Seeing no documentation on this, I tried using the /likes endpoint, but it didn't work.
endpoint = "/" + mediaId + "/likes"
Intuitively, comments can be fetched from
endpoint = "/" + mediaId + "/comments"
I tried inspecting the Instagram web app, and I saw it fetches a list of likes via another (internal (?)) endpoint e.g. /query/ but I couldn't re-engineer this and fetch this endpoint myself from the API.
Is there any documentation on this, or is the likes endpoint still not exposed via the Instagram Graph API? Can this be done?

Foursquare API : Retrieve principal Venue Photo

I'm using search Foursquare API to get list of venues but in result I don't have principal picture of venue (like profile picture in a facebook page).
Is there a way to retrieve it, using an other API ?
This API give me all photos and I can't retrieve only profile picture (https://api.foursquare.com/v2/venues/VENUE_ID/photos)
I want for example url of photo with logo Mcdonald here : https://fr.foursquare.com/v/mcdonalds/4b24227df964a520ea6124e3
Are you using the venues/explore endpoint? There is a boolean parameter venuePhotos=1 that will include the venue profile photo in the response.

How to get simulated API response for foursquare managed venues during development

I am trying to make use of the managed venues API on Foursquare. As I am managing no venues a call to https://api.foursquare.com/v2/venues/managed always returns an empty list of venues.
Other answers suggest there is a /simulate/venues/managed endpoint (which is not documented in the API docs). This endpoint seems to exist, but also returns an empty list.
Is there another way to develop a tool using the managed venues endpoint or do I have to register a managed venue?
Send an email to api#foursquare.com, with your userid and OAuth client ID. We can set you up with a test venue that you manage to test out these endpoints.

FourSquare Venues API

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.
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
you can use https://developer.foursquare.com/docs/explore#req=/venues/categories and in the view box use /venues/categories to see a list of all of the venue codes to use. then simply use:
https://api.foursquare.com/v2/venues/search?ll="+ ll+"&radius=10000&limit=50&categoryId="+catID+"&client_secret=xxx&client_id=xxx
in your call to load the url based upon ll which is long and lat and it will create a response of json object to parse. The App/Web site does not need to be authorized for such a search, and the limit goes to 5000 calls per hour, and you can increase this by emailing Foursquare with the application information and screen image of the app showing you credit Foursquare with the info, like a Foursquare button, etc. - Hope this helps.
Visit https://foursquare.com/developers/apps to get your API keys. Once you click "Create A New App", your Client ID and Client Secret should be visible.
Once you have your keys, try plugging them into this search:
https://api.foursquare.com/v2/venues/search?near=seattle,wa&query=coffee&v=20150214&m=foursquare&client_secret=xxx&client_id=xxx

Resources