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

# Timeouts

> The deadline each Stophy endpoint accepts, what happens when it runs out, how long jobs and results live, and the client timeout to set.

Set an API deadline for the work, and a longer client timeout for the response. If your client gives up first, the call may still be running.

## Deadlines

`timeout` is in milliseconds unless the table says seconds. A call that times out costs nothing.

| Endpoint | Default | Range | When it runs out |
| - | - | - | - |
| [Scrape](https://docs.stophy.dev/scrape/overview#timeouts-warnings-and-errors) | 60,000 | 1,000 to 300,000 | The read is an error |
| [Batches](https://docs.stophy.dev/batches/overview#fields) | 60,000 | 1,000 to 300,000 | That page is an error |
| [Search](https://docs.stophy.dev/search/overview) | 3,000, or 60,000 with `scrapeOptions.formats` | 1,000 to 120,000. More is read as 120,000. | A source that has not answered is left out with a warning. If none has, the call fails. |
| [Extract](https://docs.stophy.dev/extract/overview) | 30,000 | 1,000 to 300,000 | A page not read is skipped and named in `warning` |
| [Map](https://docs.stophy.dev/map/overview) | None | 1,000 and up | Map returns the pages it found |
| [Parse](https://docs.stophy.dev/parse/overview) | None | None | Accepted and ignored |
| [Browser execute](https://docs.stophy.dev/browser/execute.md) and [interact](https://docs.stophy.dev/scrape/interact.md), in seconds | 30 for code, 120 for a prompt | 1 to 300 | The step fails. Set it to your longest step. |

A short scrape `timeout` that runs out answers `504 sourceTimeout` with `retryAfterSeconds: 5`. Retry with a longer `timeout`.

## Background jobs

Crawl, batches, extract and agent answer at once with an `id`. Read the result with their status calls, so your client never waits for the work. A browser task works the same way: read it with `POST /v1/browser/task/status`.

| Call | Bound |
| - | - |
| [Browser session](https://docs.stophy.dev/browser/overview) | `ttl`, the most it can live: 600 seconds by default, 30 to 21,600. `activityTtl`, how long it waits with no call before it closes: 300 by default, 10 to 21,600. |
| [Browser task](https://docs.stophy.dev/browser/tasks.md) | `maxSteps` 50 by default and at most 50. `maxCost` stops the task at that spend. Without it, a task runs at most 10 minutes. |

Results are kept for 24 hours: a scrape you read again with `GET /v1/scrape/{id}`, a crawl, a batch and an extract. After that the `id` answers `notFound`. [Zero data retention](https://docs.stophy.dev/production/zero-data-retention.md) shortens this.

## Your client timeout

Most calls answer within 15 seconds. A slow page, a long PDF or a transcript can take a minute, and a scrape with the default `timeout` can take 60 seconds. Set your client timeout to at least 65 seconds, or longer than the `timeout` you send plus a few seconds.

The [SDKs](https://docs.stophy.dev/sdks.md) wait 70 seconds for each attempt. If a write may have run and cannot be replayed safely, the SDK stops and marks the outcome unknown. Before you resend after a timeout, check whether the first call finished. If the error carries an idempotency key, resend with the same key and body to recover the original result. Retry rules are in [Troubleshooting](https://docs.stophy.dev/production/troubleshooting.md#retry).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.