Yelp Search API
With a GET request to our /api/getter/?platform="yelp_search"
endpoint you can scrape search results from Yelp in real-time.
Example
To scrape Yelp's search results for the keyword "pizza" in the location "San Francisco, CA, United States", we can use the following command:
1 |
|
Note
When using curl
, it is necessary to add the option -L to get the data back. This is because in some cases our server responds with a 301 and curl does not follow the redirect by default.
Query Parameters
As you can see in the example above, our endpoint needs the following query parameters:
Search Query
search
Required
Parameter defines the query you want to search. You can use anything that you would in a regular Yelp search. For e.g. Pizza 90210 or Bi-Rite.
location
Required
Parameter defines the location you want to perform the search query in. This is usually the city name, followed by the state and/or country. But can be anything used on a regular Yelp search. For e.g. San Francisco, CA, United Status or Mitte, Berlin, Germany.
page
Optional
The page number for which you want the results. Default value is 1.
Other Required Parameters
platform
Required
Specifies the scraping engine you wish to invoke. In this case, the value should be yelp_search.
api_key
Required
Your account's token—which can be obtained by signing up here.
Note
The value of the query parameter url
must be URL or percent encoded. If you're using Python, this can be done with the function urlencode
.
Results
Up to 10 business can be expected in the search results. The response will include the following attirbutes for each business present in the results:
Attributes Returned | Data Type | Information Represented |
---|---|---|
id | string | Yelp's biz id for the lisitng |
rank | int | Search rank of the business sorted by Yelp's "Recommended" sort. |
name | string | Name of business listing on Yelp |
url | string | Link to Yelp listing |
categories | list | Categories in which the business is listed on Yelp |
price_range | string | Price range as represented on Yelp |
rating | int | Average rating of the business on Yelp |
total_reviews | int | Number of reviews the business has |
neighborhoods | list | Neighborhoods serviced by business |
phone | string | Business listing's telephone number |
thumbnail | string | Link to business listing's thumbnail image |
service_offerings | list | Services offered by the business. For e.g. Outdoor dining or Delivery |
Response Example
Here's the response you can expect for the request showcased above:
{
"success": true,
"search": "pizza",
"location": "San Francisco, CA, United States",
"page": 1,
"total_results": 240,
"no_of_pages": 24,
"result_count": 10,
"results": [
{
"id": "PTFxtXS47ZVRCdZIrEWvGw",
"rank": 1,
"name": "Golden Boy Pizza",
"url": "https://www.yelp.com/biz/golden-boy-pizza-san-francisco",
"categories": [
{
"name": "Pizza",
"url": "https://www.yelp.com/search?cflt=pizza&find_loc=San+Francisco%2C+CA%2C+United+States"
},
{
"name": "Italian",
"url": "https://www.yelp.com/search?cflt=italian&find_loc=San+Francisco%2C+CA%2C+United+States"
}
],
"price_range": "$",
"rating": 4.5,
"total_reviews": 3932,
"neighborhoods": [
"North Beach/Telegraph Hill"
],
"phone": "(415) 982-9738",
"thumbnail": "https://s3-media0.fl.yelpcdn.com/bphoto/SfosPh2iWkVTMC4LLVIL8g/348s.jpg",
"servie_offerings": [
"Outdoor dining",
"Delivery",
"Takeout"
]
},
...
{
"id": "GNzoAOXPxP0UzW7fb51dNg",
"rank": 10,
"name": "Giorgio’s Pizzeria",
"url": "https://www.yelp.com/biz/giorgios-pizzeria-san-francisco-5",
"categories": [
{
"name": "Pizza",
"url": "https://www.yelp.com/search?cflt=pizza&find_loc=San+Francisco%2C+CA%2C+United+States"
},
{
"name": "Italian",
"url": "https://www.yelp.com/search?cflt=italian&find_loc=San+Francisco%2C+CA%2C+United+States"
},
{
"name": "Sandwiches",
"url": "https://www.yelp.com/search?cflt=sandwiches&find_loc=San+Francisco%2C+CA%2C+United+States"
}
],
"price_range": "$$",
"rating": 4.0,
"total_reviews": 1082,
"neighborhoods": [
"Inner Richmond"
],
"phone": "(415) 668-1266",
"thumbnail": "https://s3-media0.fl.yelpcdn.com/bphoto/vU47fe1g2ikvJnntxcaA5w/348s.jpg",
"servie_offerings": [
"Delivery",
"Takeout"
]
}
],
"meta_data": {}
}
Request Cost
Each request returns up to 10 results and costs 10 credits.
Support
If you want to add a parameter to our response, or have any question or feedback, please write to us at support@unwrangle.com