# Yelp Business Search API Documentation

Find public Yelp businesses by name or keyword near a free-text location: position, id, alias, name, public url, rating, review count, price level, categories, street address, city and photo. This is a business name match as Yelp suggests it, not Yelp ranked search: it has no sort or filters, pages hold up to 25 results in total, and results can include loosely related businesses. Use the business endpoint with a returned alias for full details.

- **Documentation:** [https://scrappa.co/docs/yelp-api/yelp_search](https://scrappa.co/docs/yelp-api/yelp_search)
- **API group:** Yelp API
- **Endpoint:** `GET https://scrappa.co/api/yelp/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | Business name or keyword, 1 to 100 characters. Example: gary danko. |
| `location` | string | Yes | Free-text location, 2 to 100 characters. Example: San Francisco, CA. |
| `limit` | integer | No | Results to return, 1 to 10. Defaults to 10. |
| `page` | integer | No | Page number, starting at 1. Yelp answers at most 25 results per search, so later pages run out. Follow has_more and next_page. Defaults to 1. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/yelp/search?query=gary+danko&location=San+Francisco%2C+CA"
```

## Example response

```json
{
    "success": true,
    "data": {
        "query": "gary danko",
        "location": "San Francisco, CA",
        "results": [
            {
                "position": 1,
                "encid": "WavvLdfdP6g8aZTtbBQHTw",
                "alias": "gary-danko-san-francisco",
                "name": "Gary Danko",
                "url": "https://www.yelp.com/biz/gary-danko-san-francisco",
                "rating": 4.5,
                "review_count": 6148,
                "price": "$$$$",
                "categories": [
                    {
                        "alias": "newamerican",
                        "title": "New American"
                    }
                ],
                "address": {
                    "line1": "800 N Point St",
                    "city": "San Francisco"
                },
                "photo": "https://s3-media0.fl.yelpcdn.com/bphoto/5dbjkeTld05HumeToIAhRQ/1000s.jpg"
            }
        ],
        "page": 1,
        "has_more": false
    },
    "meta": {
        "endpoint_family": "business_search",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required query parameter is missing or invalid. This response is not billable. |
| 502 | Invalid Source Response | The upstream answered with a shape that no longer matches the documented contract. This response is not billable. |
| 503 | Service Unavailable | The upstream service is temporarily unavailable. Please retry shortly. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
