foursquare API get filtered list of restaurants - foursquare

I was checking docs https://developer.foursquare.com/docs/
And can see information how to get some data about the venues, but there no description how to get the list of venues. For example I need to get list of all restaurant in Los Angeles, how can I do it? if it's possible.
Thanks!

You can use v2/venues/search endpoint.
https://developer.foursquare.com/docs/venues/search
e.g.
https://api.foursquare.com/v2/venues/search?
categoryId=4d4b7105d754a06374d81259 // food category
&near=Los+Angeles
&limit=50 // up to 50
&oauth_token=(YOUR_OAUTH_TOKEN)
&v=20170901
It's difficult to get list of ALL restaurant in Los Angeles because limit parameter is up to 50.
Use v2/venues/categories endpoint to get categoryId list.
https://developer.foursquare.com/docs/venues/categories
- Food (4d4b7105d754a06374d81259)
- Afghan Restaurant (503288ae91d4c4b30a586d67)
- American Restaurant (4bf58dd8d48988d14e941735)
- Chinese Breakfast Place (52af3a903cf9994f4e043bee)
...

Related

Managed Metadata and a hierarchy

I'm looking at using Managed Metadata for a project, and I'm trying to make sure I set this up correctly, and whether or not it can do what I want it to do.
Let's say I have a set of buildings and in each building there are tenants. So I was going to set this up as a hierarchy in the Term Store:
TermGroup: Real Estate
TermSet: Buildings
Real Estate
Buildings
123 Main Street
345 West Avenue
567 North Blvd
This works great, I can create a field in my document library called "Building" as a Managed Metadata field and point it at "Buildings" and it will let me set it to one of the Buildings above.
Now I want to add the tenants to the Buildings because I want the metadata on a file to include both the building that it relates to and the tenant it relates to. Because some files relate only to the entire building, while some relate to a specific tenant. And I want to be able to look at the document in the document library and see the tenant it relates to (not Building\Tenant - that's too long).
So now it looks like this:
Real Estate
Buildings
123 Main Street
John Smith
Mary Jones
345 West Avenue
Bill Johnson
XYZ Company
Sue Stein
567 North Blvd
Fred Fulton
Mary Jones
Andy Dufrane
So now I add a Tenant field as a Managed Metadata field on the library - but I have to point it to the Buildings TermSet because that's how it finds the tenants when I enter a value in the field. But there's nothing to stop the end user from picking a Building instead of a Tenant in the Tenant field, right?
I could create a second TermSet that has all the Tenants in it at the first level - but as you can see above, there is a Mary Jones (two different people) in two different Buildings.
So I suppose my question is - is there a way to have a hierarchy like this in the Term Store, but require that a field use the second level values only?
Or another way to structure this so I do keep the relation of Building:Tenant but make sure that only Buildings go in the Building field and only Tenants go in the Tenant field?

Tweepy-Twitter Python : Get trends where no WOEID available

I've reading docs about twitter api's and I know how to get the trends for available countrys with Woeid (where on the world id).
Twitter has a list of countrys for which they can show the trends. When you list the availables places for trends you may notice that not all cities are supported.
My problem is that I need the trends for a country that has not support for its API. The country I need is El Salvador. This country has no support on the API, neither Woeid. But you can go to homepage and you will see the local trends to the right of window.
There is an option: get the latitude, longitude of El salvador and search trough twitter geo API for trends, but it will return you the trends for other country (Guatemala).
So, as far as I searched, using the api is not an option. Is there another way to get the twitter trends from El Salvador?
Ok, I’ve been doing what you need today.
Without being able to do an api call, which yahoo don’t support, go here;
https://www.yahoo.com/news/weather/el-salvador/apopa/apopa-76867
When you search a city, the woeid is added to the address bar.
Eg Apopa, El Salvador is 76867
Type in city names in yahoo weather and get the ones you need.
Not the best solution but should work for what you need.

Azure search relevance

Need help, I have an azure index called customer and have two fields in it customers & contacts, I have applied boost function for both the fields with boost 100 & 90, the problem is when I search any text it returns customer related relevance first and then contacts relevance.
Eg: If I search for "Johnson"
It will return all the customer details with Johnson first and then contact details even if the contact name matches "Johnson"
List of records displayed.
Record 1: This is customer
Johnson & tyson
Segment: Enterprise | Vertical: Healthcare | Country: US
Record 2: This is contact however it is associated with customer "Johnson and tyson"
Michael Walton
Customer:Johnson and tyson | Segment: Enterprise | Vertical: Pharmaceutical
Record 3: This is contact however it is associated with customer "Johnson and tyson"
Henri Vliegen
Customer:Johnson and tyson | Segment: Ent | Vertical: Pharmaceutical
Record 4: This is contact it is associated with customer "WST"
Henri Johnson
Customer:WST | Segment: Enterprise | Vertical: Pharmaceutical
So in this way records are displayed its most probably on scoring however I want the relevance name
to be displayed first like record 4 is contact and it should have been in place of record 2 since Johnson is the last name
I believe that it's because you're boosting with the same values, so it's like this:
if(Customer.Contains("Johnson") || (Contact.Contais("Johnson"))
{
//display
}
//PS: this statement is just to clarify that Contact and Customer name have the same importance.
Try to boost with different values, and I believe it will work. (100 for Customer and 90 for Details).
UPDATE
It seems that you are indexing first and last name separately. If you have a field "fullname" and boost through it, probably you'll get the expected result. Another option is create a scoring profile using those fields:
https://azure.microsoft.com/en-us/documentation/articles/search-get-started-scoring-profiles/
I read the question several times. While the question mentions that you have one index, the records displayed imply that you actually have two search indexes. Is this correct? I've been working on a training course for Azure Search, which discusses indexes and scoring in-depth.
At this time, Azure Search does not support cross-index queries. For that reason, if my understanding of your problem is correct, you'd have to run two queries: The first on the Customer index and the second on the Contacts index. Part of the reason that Azure Search is able to execute searches so quickly is because its a flattened out data structure, which allows for fast look-ups and queries. However, you're scenario implies something relational.
Am I misunderstanding your question?

how to add new category to foursquare

I see that there is no very useful category in the foursquare category list provided by API.
This category is "Car services".
And what's more important for me in RU locale is that it should be "Автосервис" or "Станция технического обслуживания авто".
Now many venues are marked with the wrong category because of the absence of these categories.
For example, car service venues are marked as "Automotive Shops" or in Russian "Магазин автотоваров". This is completely the wrong meaning.
So the question is how can I request for the addition of a new category?
Unfortunately there's no way to add venue categories via the Foursquare API, but please feel free to reach out to Foursquare support directly with your feedback: http://support.foursquare.com/requests/new

FourSquare venue search using categories

I am seeing some weird behaviors when I use the search API from FourSquare. The site I am building lists all the nightclub spots (www.nationalvip.com)
When I search using 5 categories:
// 4bf58dd8d48988d121941735 - lounge
// 4bf58dd8d48988d11f941735 - nightclub
// 4bf58dd8d48988d1e7931735 - jazz club
// 4bf58dd8d48988d1e9931735 - rock club
// 4bf58dd8d48988d1d8941735 - gay clubs
Some of the nightclubs that are in category: 4bf58dd8d48988d1d8941735 do no show up.
So query like this:
/v2/venues/search?categoryId=4bf58dd8d48988d121941735,4bf58dd8d48988d11f941735,4bf58dd8d48988d1d8941735,4bf58dd8d48988d1e9931735,4bf58dd8d48988d1e7931735&ll=47.6097,-122.3331&radius=10000&intent=browse&v=20120801
Omits this venue:
https://foursquare.com/v/last-supper-club/40b13b00f964a520a7f61ee3
When I just use that category on it's own they do.
...?categoryId=4bf58dd8d48988d1d8941735&ll=47.6097,-122.3331&radius=10000&intent=browse&v=20120801
I have tried re-arranging the categories. I'd really like to avoid having to call the API many times with various categories.
Has anyone else seen this happen?
Your problem is with the location. The ll param you provided is for a location in San Francisco, but the venue you expect to appear is located in Seattle.
you can increase limit upto 100
I have done that and radius upto 100000meters(100km)

Resources