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

# Business Search error handling

> Handle Business Search errors. Read the HTTP status first, fix HTTP 400 validation messages and retry only the 3 transient failure classes.

A Business Search error is a JSON body with an `error` message, never a successful search with zero matches. HTTP 200 with an empty `documents` array means the search ran and found nothing; every other status names what went wrong.

## Which status codes does Business Search return?

| Status | Meaning                                    | What causes it                                                                                                                                                                                                                                                                                                                                    |
| ------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200`  | The search ran                             | `documents` can still be empty                                                                                                                                                                                                                                                                                                                    |
| `400`  | The request body is invalid                | An unknown category, an invalid `mode`, `query`, `view`, `offset` or `limit`, an unknown view profile name, unknown field names in `view`, a natural-language query longer than 200 characters, an operator the field type does not support, such as `equals` on a text field, or a debug property such as `explain` that the account cannot send |
| `401`  | The API key is missing, invalid or expired | A wrong key returns `{"error":"Invalid token"}` and an expired one returns `Token expired`                                                                                                                                                                                                                                                        |
| `403`  | The account cannot use Business Search     | No customer account exists for the key, the account is inactive, or the account is not on the API allowlist                                                                                                                                                                                                                                       |
| `404`  | Unknown API version                        | The version segment in the path is not recognised                                                                                                                                                                                                                                                                                                 |
| `500`  | Server-side configuration or backend error | Retry with bounded backoff                                                                                                                                                                                                                                                                                                                        |
| `429`  | The rate limit was exceeded                | Too many requests for this category and mode. The request was not searched and was not billed                                                                                                                                                                                                                                                     |
| `501`  | The request is valid but unsupported       | The source is disabled or unavailable, or natural-language planning or ranking is not available for that source                                                                                                                                                                                                                                   |
| `502`  | The natural-language step failed           | The planner or the ranking step returned an invalid or empty response. Applies to `instant` and `smart`                                                                                                                                                                                                                                           |
| `504`  | The search timed out                       | Retry with bounded backoff                                                                                                                                                                                                                                                                                                                        |

Retry `429` after the delay in its `Retry-After` header. Retry `500`, `502` and `504` with bounded backoff. Never retry `400`, `401`, `403`, `404` or `501`, because the same request fails every time. A `500` with `error_code` `backend_search_failed` that repeats for the same request is caused by the request itself, so change the request rather than retrying it.

## Why was a request rejected?

Business Search rejects an invalid request body with HTTP 400 and names what it rejected. Selecting an unknown output field returns:

```json theme={null}
{
  "error": "view: unknown field(s): not_a_released_field"
}
```

An operator the field type does not support is rejected the same way. The message names the field, the operator and the types that operator accepts:

```json theme={null}
{
  "error": "Invalid query: In operator 'equals', field 'industry': Operator does not support field type 'text'. Supported types: bool, byte, double, float, int, language, long, string."
}
```

Text fields such as `industry` and `current_title` accept only the `text` operator. See [Business Search query syntax](/products/business-search/query-syntax).

Some rejections also carry an `error_code`, a machine-readable class such as `invalid_query` or `backend_search_failed`. Branch on `error_code` when it is present, and fall back to the HTTP status when it is not, because generic errors omit it.

Correct the request when validation fails. Rate-limit checks run after validation, so a rejected request does not consume rate-limit budget, but repeating an invalid body still cannot succeed.

## What is the rate limit?

The default limit is 60 requests per minute, counted per account, per category and per mode. Company and people searches therefore have separate budgets, as do Ludicrous, Instant and Smart within each category.

When you exceed the limit, Business Search returns HTTP 429 with a `Retry-After` header giving the seconds to wait. Wait that long before retrying. A rate-limited request is not searched and not billed.

## How should you handle each failure class?

| Failure                                  | What it means                                                          | What to do                                                                                                       |
| ---------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| HTTP 400                                 | The request body is invalid                                            | Fix the field, operator, mode or pagination value named in `error`                                               |
| HTTP 401 or 403                          | The key is wrong or expired, or the account cannot use Business Search | Check the key in the [Control Panel](https://brightdata.com/cp/setting/users) and confirm Business Search access |
| HTTP 429                                 | The rate limit was exceeded                                            | Wait the seconds given in `Retry-After`, then send the request again                                             |
| HTTP 500, 502 or 504                     | The request could succeed later                                        | Retry with bounded backoff, never in an unlimited loop                                                           |
| HTTP 200 with an empty `documents` array | The search ran and matched nothing                                     | Treat it as no matches, not as an error and not as proof the entity does not exist                               |

Distinguish these four cases in your own logging. Collapsing them into one "search failed" branch hides the difference between a bug in your query and an outage.

## What should you send to Bright Data support?

Include the endpoint, the HTTP status, the request time, the error message and `req_id` if one was returned. Include a redacted request body when it helps.

<Warning>
  Never send your API key or your `Authorization` header to support, in a ticket, a log export or a screenshot. Rotate the key immediately if one leaks.
</Warning>

## Frequently asked questions

### Does a 200 response mean the query was understood?

No. A 200 means the search ran. In Instant and Smart modes, natural-language intent and result relevance are not guaranteed by a successful HTTP response, so review the records before acting on them.

### Should I retry an HTTP 400?

No. HTTP 400 means the request itself is invalid, so the same body fails every time. Retry only HTTP 500, 502 and 504, with bounded backoff.

### Do rejected requests count against the rate limit?

No. Business Search validates the request before it checks the rate limit, so a malformed query does not consume budget. Correct the request rather than retrying it, because an invalid body cannot succeed however many times you send it.

### How do I tell a missing field from an empty result?

A missing field inside a returned record means the source has no stored value for that record. An empty `documents` array means no record matched the conditions. Handle absent values per record and empty pages per request.
