# Website crawling and crawl management

> Choose a page audit, a bounded linked crawl, a fixed URL list, or a resumable snapshot. Understand crawl scope, pacing, and coverage.

Canonical documentation: <https://sajaddehshiri.ir/sonjoo-seo-audit/features/crawling/>

Sonjoo can measure one HTTP(S) page, discover linked pages on a site, or audit a list you supply. Choose the input based on which URLs you need to verify and whether you need to resume fetching later. Run crawls only where you have authorization.

## Choose the crawl input

| Mode                 | What Sonjoo measures                                                                                                                                              | How to use it                                                                                                                                                  |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Single page          | The entry page, with the network evidence required by enabled rules. Use this to check a known URL or a representative template.                                  | In the dashboard, select **Website** and clear **Crawl linked pages**. In the CLI, run `sonjoo audit https://example.com/`.                                    |
| Linked website crawl | Eligible pages discovered from the entry page, up to the crawl limits. Use this for internal links, duplicate content, and other site-wide checks.                | Keep **Crawl linked pages** enabled in the dashboard, or pass `--crawl` with `sonjoo audit`.                                                                   |
| Fixed URL list       | Only the supplied page candidates. Use it for release test URLs, a migration sample, or a prepared inventory.                                                     | Select **URL list** in the dashboard and paste URLs or import a CSV. With the HTTP API, send `urlList` and optionally `listFormat: "csv"` to `POST /api/runs`. |
| Stored crawl         | Fetched snapshots that can be resumed or analyzed in a separate run. Use this when collection can be interrupted or the same content needs to be evaluated again. | Run `sonjoo crawl <url>`; then use `sonjoo crawl --resume <crawl-id>` or `sonjoo analyze <crawl-id>`.                                                          |

List mode accepts up to 1,000 input rows. In plain text, put one URL on each nonblank line. In CSV, supply a column titled `url` or put URLs in the first column. Sonjoo reports invalid rows, strips URL fragments, and deduplicates inputs. The crawler can also merge seeds that differ only by dropped query parameters. The first valid URL is the entry URL. For a list spanning multiple origins, the default crawl policy checks `robots.txt` for each submitted origin, and sitemap evidence is collected for the entry origin. Only successful HTML pages are eligible for rules in list mode. HTTP errors and non-HTML responses can still appear in the [crawl inventory](https://sajaddehshiri.ir/sonjoo-seo-audit/api/runs-and-findings/). The run returns an error if none of the supplied URLs yields an eligible HTML page. In website mode, the entry URL needs to return usable HTML before a report can be scored.

## Control link discovery and URL scope

A linked crawl queues eligible internal links and same-host HTML canonical targets. Discovery uses the effective entry hostname after a successful entry redirect. Sonjoo records crawl depth, link, canonical, and redirect discovery where available. It does not queue links marked `nofollow` or URLs excluded by the crawl policy. Common image, document, archive, script, or stylesheet URLs are not queued as pages; individual rules can still inspect relevant resources.

An XML sitemap is collected as a separate source of evidence. A URL can appear in the inventory as a sitemap candidate even if it was never fetched as an audit page. To audit a specific set of sitemap entries directly, supply them as a fixed URL list. See [sitemap checks](https://sajaddehshiri.ir/sonjoo-seo-audit/features/technical-seo/#robotstxt-and-xml-sitemaps).

Set CLI discovery options in the `[crawler]` block of `sonjoo.toml`.

* Set `include` and `exclude` to restrict newly discovered paths. Use a suitable starting URL because path filters govern discovery from that URL. Excludes take precedence over includes.
* Use `*` to match within a path segment and `**` to match across segments. `?` matches a single character. For example, `/docs/**` matches `/docs` and paths below it.
* Configure `allow_query_params` to retain only the named query parameters, or `drop_query_prefixes` to remove tracking parameters without an allowlist. Crawl URL normalization also removes fragments and sorts query parameters by name. Preserve any parameters that select genuinely different content.

## Set budgets and respect site directives

For example, set a limit of 50 pages and a 120-second collection budget.

```sh
sonjoo audit 'https://example.com/' --crawl --max-pages 50 --max-duration 120 \
  --concurrency 2 --no-save --format json --output audit.json
```

The default page budget is 10. The `audit --crawl --max-pages` flag and HTTP API allow up to 1,000 pages per run. A CLI audit can use up to 10,000 through `crawler.max_pages` when that flag is omitted. `sonjoo crawl --max-pages` accepts up to 10,000 explicitly. Dashboard and API options, including duration, follow the [HTTP limits](https://sajaddehshiri.ir/sonjoo-seo-audit/api/reference/#start-request-options). The CLI also supports explicit request timeouts and a crawl collection time budget. A collection deadline can leave URLs unfetched, and reporting work can continue afterward. Additional requests can occur for robots files, redirects, link probes, or assets during a page audit.

By default, the crawler follows its user agent's `robots.txt` rules for discovered URLs and fixed list seeds. A single-page audit or the explicit entry URL of a linked crawl is fetched for analysis even if a robots rule would block crawl discovery. Project configuration controls the user agent, global and per-host pacing, and per-host concurrency. HTTP 429 and 503 responses can pause requests to the affected host and can trigger up to three retries, subject to the crawl deadline and `Retry-After` policy. The inventory and coverage distinguish measured pages from errors, rate limits, and URLs that were not fetched.

For an authorized staging crawl, `--staging` disables robots-based crawl exclusions and the robots crawl delay, and waives the corresponding indexability score caps. `--ignore-crawl-delay` bypasses the delay specified by robots policy and keeps the normal crawl exclusions and configured pacing. See [score caps](https://sajaddehshiri.ir/sonjoo-seo-audit/features/dashboard-reports/#understand-scores-and-score-caps).

## Resume collection or reevaluate a snapshot

`sonjoo crawl` stores a crawl ID, fetched snapshots, and the discovered queue. Resume using that ID from the original directory or supply the same output directory. A resumed run keeps the original start URL and saved crawl settings. You may keep or increase the page limit. Completed fetches are reused, so a resumed crawl can contain pages fetched at different times.

Run `sonjoo analyze <crawl-id>` or `sonjoo analyze --latest` from the storage directory to reevaluate saved pages using the current analysis configuration. Analysis reuses the saved HTML and does not run Chromium. Enabled rules can still make auxiliary requests, such as external link probes. Some crawl-wide evidence is specific to a live audit. Use a fresh `sonjoo audit` for new page content, rendering, or a new crawl graph. `analyze --no-save` controls history for the generated audit and leaves the stored crawl available.

When evaluating a crawl, check attempted and measured pages, completion state, and rule coverage before calling a pattern site-wide. Inspect [findings and coverage](https://sajaddehshiri.ir/sonjoo-seo-audit/guides/reports-and-coverage/) and follow the [resumable crawl walkthrough](https://sajaddehshiri.ir/sonjoo-seo-audit/guides/audit-and-crawl/#resume-a-crawl) for an end-to-end example.
