> ## Documentation Index
> Fetch the complete documentation index at: https://guides.affiliate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Find merchants by name or domain on Affiliate.com

> Use the search query parameter to find merchants by name fragment or domain. Combine with network_ids to narrow results to specific affiliate networks.

The `?search=` query parameter on `GET /v1/merchants` lets you find merchants by matching against their name or their registered domain. You can use a partial name, a full name with spaces URL-encoded, or a bare domain string — the API handles both formats.

## How search matching works

* **Name search** — pass any part of the merchant's name, URL-encoded. For example, `?search=best+buy` matches "Best Buy US", "Best Buy Canada", and any other merchant whose name contains that phrase.
* **Domain search** — pass a bare domain such as `bestbuy.com`. The API matches against the merchant's `domains` array.

<Note>
  Search is case-insensitive. You do not need to pass the full name or include `https://` for domain searches.
</Note>

## Endpoint

```
GET /v1/merchants?search={query}
```

## Examples

### Search by merchant name

```bash theme={null}
curl --request GET \
  'https://api.affiliate.com/v1/merchants?search=best+buy&page=1&per_page=10' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

### Search by domain

```bash theme={null}
curl --request GET \
  'https://api.affiliate.com/v1/merchants?search=bestbuy.com&page=1&per_page=10' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

### Find merchants with commissionable URLs

```bash theme={null}
curl --request GET \
  'https://api.affiliate.com/v1/merchants?has_commissionable_url=1&countries=US&per_page=50' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

### Narrow results to a specific network

Combine `search` with `network_ids` to limit results to one or more networks. This is useful when the same brand is available on multiple networks and you want a specific one.

```bash theme={null}
curl --request GET \
  'https://api.affiliate.com/v1/merchants?search=food&network_ids=10&has_description=1&product_count_min=300&product_count_max=1000&page=1&per_page=10' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

## Response

Search responses use the same structure as the standard list endpoint — a `meta` pagination object and a `data` array of matching merchant objects.

```json theme={null}
{
  "meta": {
    "total": 1,
    "from": 1,
    "to": 1,
    "current_page": 1,
    "last_page": 1,
    "per_page": 100,
    "fields": [
      "id",
      "name",
      "description",
      "domains",
      "icon_url",
      "logo_url",
      "product_count",
      "network"
    ],
    "trace_id": "0194fffe-9a3b-71aa-ada0-8686ff2715dd"
  },
  "data": [
    {
      "id": 71655,
      "name": "Real Food Hub",
      "description": "Real Food Hub is for people who love Real Good Food from farmers markets and enjoy the convenience of online ordering. We believe it has more taste, more nutrition and is more ethically produced.",
      "domains": ["https://www.realfoodhub.co.uk"],
      "icon_url": "https://img.affiliate.com/logos/merchants/71655/icon.png",
      "logo_url": "https://img.affiliate.com/logos/merchants/71655/logo.png",
      "product_count": 1301,
      "network": {
        "id": 10,
        "name": "Awin UK",
        "url": "https://www.awin.com",
        "logo_url": "https://img.affiliate.com/logos/groups/10006/128x128.png"
      }
    }
  ]
}
```

## Tips

<Tip>
  Add `network_ids` alongside `search` to filter results to merchants you're actually affiliated with. This eliminates noise when a common brand name appears across dozens of networks.
</Tip>

<Tip>
  Copy the `id` value from a search result and use it in `GET /v1/merchants/{id}` to fetch that merchant directly in future requests — no need to search again.
</Tip>

## Error responses

| Status | Meaning                                                          |
| ------ | ---------------------------------------------------------------- |
| `400`  | Invalid input — check your parameter values                      |
| `401`  | Unauthenticated — include a valid `Authorization: Bearer` header |
| `404`  | No merchants found matching the search query                     |
| `429`  | Rate limit exceeded — slow down your request rate                |
