# Yelp Search Ads

> **Beta:** the parser for this endpoint has not yet been checked against a live response. Field shapes may change.

`POST /v1/ads/yelp`

Yelp search results with sponsored rows flagged (`isAd`), plus name, rating, reviews, price range, categories and position, as Apify-style dataset items.

Family: Ads API · Mode: Live

## Price

Unit: result

| Mode | Price (USD) |
|---|---|
| Live | $0.00045 |

Per result returned.

## Description

POST the input as one JSON object. Every term in `searchTerms` runs in every place in `locations`, plus one search per `directUrls` entry, up to 50 searches per request. Results are read page by page until `searchLimit` is reached.

The response body is a JSON array of items, with no wrapper. Every item carries `receipt_id`, and the same id is in the `X-Receipt-Id` response header.

**Billing.** Per result returned, sponsored rows included, whatever fetch level was needed. An input that finds nothing costs $0. Results are cached for 6 h.

**Beta.** The parser behind this route was written from public documentation and hasn't been checked against live pages yet. Item field names are fixed; some values may be null more often than they should be until that check is done.

## Authentication

HTTP Basic auth: any login, with your `dg_` API key as the password. A `Bearer` token header with the key also works.

## Request

Send a JSON object.

| Field | Type | Required | Description |
|---|---|---|---|
| `searchTerms` | array<string>\|string | no | What to search for. Each term runs in each of `locations`. `search_terms` and `searchTerm` are accepted too. Send this with `locations`, or `directUrls`, or both. |
| `search_terms` | array<string>\|string | no | Same as `searchTerms`. |
| `searchTerm` | string | no | Same as `searchTerms`, for a single term. |
| `locations` | array<string>\|string | no | Where to search, for example `Boulder, CO`. Required with `searchTerms`. `location` is accepted too. |
| `location` | string | no | Same as `locations`, for a single place. |
| `directUrls` | array<string\|object> | no | Yelp search URLs (`yelp.com/search?find_desc=…&find_loc=…`). Business page URLs aren't supported. `startUrls` is accepted too. |
| `startUrls` | array<string\|object> | no | Same as `directUrls`. |
| `searchLimit` | integer | no | Results per search, sponsored rows included. default `10`; min 1; max 240 |
| `auto_upgrade` | boolean | no | Lets the request move to a higher fetch level when the included level can't get the data, billed at the level that delivered it. `false` stops at the Standard level and returns the failure at $0. Also accepts `"true"`, `"false"`, `1` and `0`. default `true` |
| `max_level` | string | no | The highest fetch level Auto-upgrade may use. `rendered` never uses the Protected level. default `protected`; one of `standard`, `rendered`, `protected` |
| `max_cost` | number | no | The most this task may cost, in USD. The wallet check reserves this amount instead of the worst-case price, the request never upgrades past it, and the charge never exceeds it. Results stop at the number this amount pays for. min 0 |
| `max_age` | integer | no | Accept a cached result up to this many seconds old, 0 to 86,400. `0` always fetches fresh. Default window: 6 h. min 0; max 86400 |

### Example request

```bash
curl -X POST "https://api.dataforgaio.com/v1/ads/yelp" \
  -u "api:$DATAFORGAIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "searchTerms": [
    "running store"
  ],
  "locations": [
    "Boulder, CO"
  ],
  "searchLimit": 3
}'
```

## Response

| Field | Type | Description |
|---|---|---|
| `name` | string | Business name. |
| `bizId` | string\|null | Yelp business id. |
| `directUrl` | string | The business's Yelp page, without tracking parameters. |
| `alternateNames` | array<string> | Other names. Always empty for now. |
| `address` | object | Address. Only `addressLine1` is filled from search results. |
| `address.addressLine1` | string\|null | Address as shown in the result. |
| `address.addressLine2` | null | Always null. |
| `address.addressLine3` | null | Always null. |
| `address.city` | null | Always null. |
| `address.regionCode` | null | Always null. |
| `address.postalCode` | null | Always null. |
| `address.country` | null | Always null. |
| `neighborhoods` | array<string> | Neighborhoods shown in the result. |
| `phone` | string\|null | Phone number. |
| `website` | null | Not in search results. Always null. |
| `aggregatedRating` | number\|null | Star rating, 1 to 5. |
| `reviewCount` | integer\|null | Number of reviews. |
| `priceRange` | string\|null | Price range, for example `$$`. |
| `type` | null | Always null. |
| `cuisine` | null | Always null. |
| `categories` | array<string> | Yelp categories. |
| `primaryPhoto` | string\|null | Main photo URL. |
| `images` | array<string> | Always empty for now. |
| `claimed` | null | Not in search results. Always null. |
| `verified` | null | Not in search results. Always null. |
| `advertiser` | boolean | True for a sponsored row. |
| `isAd` | boolean | True for a sponsored row. |
| `sponsored` | boolean | True for a sponsored row. |
| `position` | integer | Position in this search, sponsored rows included, starting at 1. |
| `searchTerm` | string | The term this row came from. |
| `location` | string | The location this row came from. |
| `scrapeStartedAt` | string | When this search started, ISO 8601. |
| `scrapeFinishedAt` | string | When this search finished, ISO 8601. |
| `receipt_id` | string\|null | Id of the ledger receipt for this request. Same on every item. |

### Item types

#### result

| Field | Type | Description |
|---|---|---|
| `name` | string | Business name. |
| `bizId` | string\|null | Yelp business id. |
| `directUrl` | string | The business's Yelp page, without tracking parameters. |
| `alternateNames` | array<string> | Other names. Always empty for now. |
| `address` | object | Address. Only `addressLine1` is filled from search results. |
| `address.addressLine1` | string\|null | Address as shown in the result. |
| `address.addressLine2` | null | Always null. |
| `address.addressLine3` | null | Always null. |
| `address.city` | null | Always null. |
| `address.regionCode` | null | Always null. |
| `address.postalCode` | null | Always null. |
| `address.country` | null | Always null. |
| `neighborhoods` | array<string> | Neighborhoods shown in the result. |
| `phone` | string\|null | Phone number. |
| `website` | null | Not in search results. Always null. |
| `aggregatedRating` | number\|null | Star rating, 1 to 5. |
| `reviewCount` | integer\|null | Number of reviews. |
| `priceRange` | string\|null | Price range, for example `$$`. |
| `type` | null | Always null. |
| `cuisine` | null | Always null. |
| `categories` | array<string> | Yelp categories. |
| `primaryPhoto` | string\|null | Main photo URL. |
| `images` | array<string> | Always empty for now. |
| `claimed` | null | Not in search results. Always null. |
| `verified` | null | Not in search results. Always null. |
| `advertiser` | boolean | True for a sponsored row. |
| `isAd` | boolean | True for a sponsored row. |
| `sponsored` | boolean | True for a sponsored row. |
| `position` | integer | Position in this search, sponsored rows included, starting at 1. |
| `searchTerm` | string | The term this row came from. |
| `location` | string | The location this row came from. |
| `scrapeStartedAt` | string | When this search started, ISO 8601. |
| `scrapeFinishedAt` | string | When this search finished, ISO 8601. |
| `receipt_id` | string\|null | Id of the ledger receipt for this request. Same on every item. |

### Example response

```json
[
  {
    "name": "Summit Running Co.",
    "bizId": "sRc0001",
    "directUrl": "https://www.yelp.com/biz/summit-running-co",
    "alternateNames": [],
    "address": {
      "addressLine1": "120 Main St",
      "addressLine2": null,
      "addressLine3": null,
      "city": null,
      "regionCode": null,
      "postalCode": null,
      "country": null
    },
    "neighborhoods": [
      "Downtown"
    ],
    "phone": "(303) 555-0142",
    "website": null,
    "aggregatedRating": 4.5,
    "reviewCount": 211,
    "priceRange": "$$",
    "type": null,
    "cuisine": null,
    "categories": [
      "Shoe Stores",
      "Sporting Goods"
    ],
    "primaryPhoto": null,
    "images": [],
    "claimed": null,
    "verified": null,
    "advertiser": true,
    "isAd": true,
    "sponsored": true,
    "position": 1,
    "searchTerm": "running store",
    "location": "Boulder, CO",
    "scrapeStartedAt": "2026-12-03T10:42:18.000000+00:00",
    "scrapeFinishedAt": "2026-12-03T10:42:18.000000+00:00",
    "receipt_id": "8cbb5b5c-8e15-5c82-9959-45f93cdad009"
  },
  {
    "name": "Trailhead Outfitters",
    "bizId": "tHo0002",
    "directUrl": "https://www.yelp.com/biz/trailhead-outfitters",
    "alternateNames": [],
    "address": {
      "addressLine1": "455 Pearl St",
      "addressLine2": null,
      "addressLine3": null,
      "city": null,
      "regionCode": null,
      "postalCode": null,
      "country": null
    },
    "neighborhoods": [
      "Downtown"
    ],
    "phone": "(303) 555-0142",
    "website": null,
    "aggregatedRating": 4,
    "reviewCount": 88,
    "priceRange": "$$",
    "type": null,
    "cuisine": null,
    "categories": [
      "Shoe Stores",
      "Sporting Goods"
    ],
    "primaryPhoto": null,
    "images": [],
    "claimed": null,
    "verified": null,
    "advertiser": false,
    "isAd": false,
    "sponsored": false,
    "position": 2,
    "searchTerm": "running store",
    "location": "Boulder, CO",
    "scrapeStartedAt": "2026-12-03T10:42:18.000000+00:00",
    "scrapeFinishedAt": "2026-12-03T10:42:18.000000+00:00",
    "receipt_id": "8cbb5b5c-8e15-5c82-9959-45f93cdad009"
  }
]
```

## Errors

| Code | When |
|---|---|
| 400 | Invalid input (no terms or URLs, `searchTerms` without `locations`, a non-search URL, or more than 50 searches), or `max_cost` below the price of one item. Body: `{"error": {"type": "invalid-input", "message": ..., "receipt_id": null}}`. |
| 400 | Nothing found for the input (`type: invalid-input`). $0. |
| 401 | No valid API key (`type: user-or-token-not-found`). |
| 402 | Wallet balance below the worst case for this request (`type: not-enough-usage-to-run-paid-actor`). |
| 429 | Too many requests (`type: rate-limit-exceeded`). |
| 500 | No allowed fetch level got the page (`type: internal-error`). $0. |

## Migrating

Replaces Apify `Yelp scraper actor input and dataset items`. Same request body and response envelope; change the base URL and the key.
