# Search errors and warnings

The few ways a search fails, which to retry, and the warnings that are not failures.

A search that fails answers with the one [error shape](https://millionshort.com/docs/errors#the-error-shape) every endpoint uses, and is never charged.

## The errors of a search

| Status and code | When | Do |
|---|---|---|
| `400 INVALID_PARAM` | A field the API does not take, a value out of range, or two fields that cannot go together | Fix the request. `error.message` names the field |
| `400 UNSUPPORTED_OPTION` | An option this API version does not offer | Leave it out |
| `401 AUTH_MISSING_KEY`, `401 AUTH_INVALID_KEY` | No `Authorization` header, or a key that is malformed, revoked or expired | Send a valid key |
| `403 QUOTA_EXCEEDED` | The key has spent its monthly cap, or the call could cost more than the key has left | Raise the cap in the [dashboard](https://millionshort.com/docs/dashboard#monthly-cap-per-key), or use another key |
| `404 SPACE_NOT_FOUND` | [Spaces](https://millionshort.com/docs/spaces): `space` names no Space you can use, because it does not exist or belongs to another team | Check the id or slug; a curated Space takes `curated:` before its slug |
| `429 RATE_LIMITED` | Over one of the plan's per-minute limits | Wait `Retry-After` seconds, then retry |
| `429 CAPACITY` | The service has no room at this moment, whatever your plan | Wait `Retry-After` seconds, then retry |
| `429 INSUFFICIENT_CREDITS` | The balance does not cover the most the call could cost | Do not retry. Add credits |
| `500 INTERNAL` | Something failed on our side | Retry with a growing pause; send us the `request_id` if it persists |
| `502 SEARCH_UNAVAILABLE` | Search could not answer | Wait `Retry-After` seconds, then retry |

The rules between fields that make an `INVALID_PARAM` are listed under [Parameters](https://millionshort.com/docs/search/parameters#rules-between-fields). [Errors](https://millionshort.com/docs/errors) has every code of the API, a retry loop in three languages, and the error classes of the SDKs.

## Warnings are not errors

A search that worked can still have something to tell you. It answers `200`, and `warnings` lists what happened:

- `source_unavailable`: a source you asked did not answer. The others did, and the missing one is not charged.
- `filter_not_applied`: a source could not apply a filter you sent. Its results came back as if the filter had not been sent, and the warning names the filter and the sources. A filter is never ignored silently.
- `content_partial`: with `include_content`, some results have no page text. They are not charged for it.
- `language_detected`: a `language` filter on `web` was applied by reading each result's text.

These are the ones met most often; [Parameters](https://millionshort.com/docs/search/parameters#warnings) lists every warning.

Read `warnings` before trusting that a filter held. [Warnings are not errors](https://millionshort.com/docs/errors#warnings-are-not-errors) has the shape.

## Over MCP and in the SDKs

The `search` tool of the [MCP server](https://millionshort.com/docs/mcp) reports the same codes in its answer. The [Python](https://millionshort.com/docs/sdks/python) and [TypeScript](https://millionshort.com/docs/sdks/typescript) clients raise one error class per kind of failure and retry the ones worth retrying.
