foursquare venues.json structure - foursquare

Might be missing something but, how can I get the structure of a Foursquare response for a request like https://api.foursquare.com/v2/venues/search?ll=...
I want to put the response into a data structure, but most venues aren't fully populated with data. For example, many venues data have contact info so the contact field is just and empty dict.
I want to know all the fields Foursquare could possibly send back to me for a given venue.

The complete venue description is listed here https://developer.foursquare.com/docs/responses/venue
usually there is a link to the datatypes returned at the bottom of the API endpoint description.

Related

how to get destination info(bank and card details) on stripe

Let's say I'm getting payouts information https://stripe.com/docs/api/payouts/list
I want to get the destination info, so if we take the example from the docs:
I want the details from that destination, I don't mean the specific details like the exact credit card number, but the info when going on the page itself, this one:
It's not working listing the banks accounts https://stripe.com/docs/api/customer_bank_accounts/list , I'm getting zero results when list them all
I'm using Golang library but I think this solution can be solved by others programming languages
I'm also using expandable fields but I get blank results on bank_account and card details
what is interesting however, is when debugging the page, they make request to v1/payouts/{id} with expand[]: balance_transaction and the returned data contains the bank information, but when I do it with their API, that info is not returned back
The Payout destination is expandable, meaning you can have it replaced with the full object by sending you request with expand[]=destination or for a list command data.destination.

Foursquare venue score/rating

Does anyone know how I can get a venue's score/rating (e.g. 9.0/10) using the Foursquare API?
I am connecting via Userless Access.
https://developer.foursquare.com/overview/auth#userless
The JSON blob that I get when I request venue details does not seem to include the score/rating.
https://developer.foursquare.com/docs/venues/venues
It is worth noting, first of all, that not all venues have ratings. A rating is only calculated in certain situations, like if there is enough sentiment data about a venue to start calculating a rating and if the venue is not a user's home.
However, if a venue does have a rating calculated and you're making a request with a recent version of the API (make sure you have a v param set from within the last few months), it will be returned in the JSON from the API as follows, when you make a call to /venues/<ID>:
{
response: {
venue: {
... // Other data about the venue will surround this, of course
rating: 7.18
}
}
... // The response's metadata will also be here
}
So, basically you want to check response.venue.rating.

Foursquare API: Venues visited by a user sort

For the Foursquare api
Venues visited by a user
https://api.foursquare.com/v2/users/USER_ID/venuehistory
I was wondering if we can change the sort of the venues coming back? It appears to be sorted by alpha. It would be helpful to sort by most recent checkin. Or in addition to the beenHere field add a last_checkin_id: or just date would be fine.
Is there a sort query string parameter that i am missing?
The venuehistory endpoint simply returns all the venues that a user has been to. If you're looking to sort venues by most recent check-in, consider using the user/checkins endpoint instead.

Foursquare get venue details

We are planning to use foursquare api to get venue in a particular city. I want data of all the food outlets in a particular city. I have managed to get the categories list but not sure how to get venues from that particular category in a particular city or area.
Please share some tutorials or document which i can check out.
One way of doing what you want will be using the Venues Platform for browsing according to a category ID.
Look at venue search API reference.
Example of using it:
I know that 4bf58dd8d48988d11f941735 is nightlife (just picked the first one I saw)
So I will call the API (the ll is someplace in New York):
https://api.foursquare.com/v2/venues/search?ll=40.7268,-73.9972&categoryId=4bf58dd8d48988d11f941735&limit=50&intent=browse&radius=1500&your ids/oauth
Or use the explorer to see results right away.
Important, read the search API and the parameters used here to alter behavior to your needs.
Another very important thing, the API parameters are case sensitive!! (so if they want categoryId, categoryid will not work :) )

Foursquare API - Has there been a change to the core venue field specials?

Has there been a change to the core venue field specials?
I'm using Venue Detail request (https://developer.foursquare.com/docs/venues/venues) to retrieve Venue Detail. As usual this request returns a "venue" for a response field.
What seems to have changed is the core venue field "specials". This now appears to be returning the same response fields as Specials/list ( https://developer.foursquare.com/docs/specials/list).
This requires iteration on specials.items as opposed to specials.
Looking at https://developer.foursquare.com/docs/responses/venue the Core venue field "specials" still should be returned as an array.
I'm trying to find in the change log where this may have changed?
The venues specials object is now using the standard count and items format that other lists in the api use.
The new format is only for clientversion 20120120 and later. Older versions get the old format.
We'll be updating the docs/changelog shortly.

Resources