Search for Specific Restaurants
Use the Datafiniti restaurant data API to find restaurants by cuisine, category or restaurant operating hours — and see how restaurant menus, cuisines and hours of operation are stored on each record.
Introduction
Datafiniti's business data can be used to enrich, search, or verify almost any business you want. In this example we will show you how to use Datafiniti business search API to query for specific restaurants by the cuisine or category of food they offer.
Search Businesses via Categories
For this example we are looking for vegan restaurant in the state of California. You can use the following example to get these business records:
{
"query": "country:US AND province:CA AND categories:(vegan)",
"num_records":10
}
Utilizing Datafiniti's categories field we can search for restaurant that advertise with vegan as a keyword for their menu items.
Categories
Categories is a list of category keywords used for the business that has been scraped from descriptions and menu items across multiple sources.
Search Businesses via Cuisines
For this example we are going to search for the same California based vegan restaurants but we will use Datafiniti's cuisines field as the main search parameter.
{
"query": "country:US AND province:CA AND cuisines:(vegan)",
"num_records":10
}
Utilizing Datafiniti's cuisines field is based on list of cuisines offered by this business location. Typically data obtain from online order menus.
Combining Fields to Optimize Results
Since the fields we have used so far (categories & cuisines) are typically pulling from different data source, we can combine the query from the previous example to create a catch all for vegan restaurant in California.
{
"query": "country:US AND province:CA AND (categories:vegan OR cuisines:vegan)",
"num_records":10
}
Search for Restaurants by Operating Hours
Restaurant operating hours live in the hours field of the business schema. Each entry describes one block of opening times with the sub-fields day, hour, dept and meal, so you can find restaurants that publish their hours and read what those hours are.
Only return restaurants that publish hours
Adding an existence filter on hours.day keeps the vegan California results from the earlier examples but only returns locations with hours on file.
{
"query": "country:US AND province:CA AND cuisines:(vegan) AND hours.day:*",
"num_records": 10
}
Hours come back as a list on each business:
{
"name": "Green Fork Kitchen",
"city": "Santa Monica",
"province": "CA",
"hours": [
{
"day": "Mon - Fri",
"hour": "11:00 am - 9:00 pm"
},
{
"day": "Sat - Sun",
"meal": "Brunch",
"hour": "10:00 am - 10:00 pm"
}
]
}
Find restaurants open for a specific meal period
Where a source lists meal periods, they appear in hours.meal and can be searched directly, e.g. brunch.
{
"query": "country:US AND province:CA AND cuisines:(vegan) AND hours.meal:(Brunch OR Breakfast)",
"num_records": 10
}
Meal periods are only present where a source publishes them, so combine this with the hours.day:* existence filter when you need every record to have hours.
hours.hour is stored as text such as "11:00 am - 9:00 pm" and hours.day as a day or day range such as "Mon - Fri". Use the query fields to find and filter restaurants by presence of hours, then parse the returned strings in your own code if you need open/closed times as machine-readable values.
See the business data schema for every hours sub-field.
Example Files
Here are example bulk download files of our previous query: