# Sprawdź status crawla

`GET https://api.seoscraper.io/v1/crawls/{crawl_id}`

## Parametry ścieżki

- `crawl_id` string: Identyfikator crawla.

## Odpowiedź 200

- `id` string: Identyfikator crawla.
- `status` string (queued, running, completed, canceled, failed):
- `url` string: Adres startowy.
- `options` object: Opcje, z którymi crawl został uruchomiony.
  - `url` string: Adres startowy. Gdy nie ma protokołu, dopisujemy https://.
  - `source` string? (auto, sitemap, links): auto: adresy z sitemapy, a gdy jej nie ma, linki. sitemap: tylko sitemapa. links: tylko linki.
  - `max_pages` integer?: Limit stron.
  - `max_depth` integer?: Liczba kliknięć od strony startowej. Nie dotyczy sitemapy.
  - `concurrency` integer?: Ile stron pobierać jednocześnie.
  - `delay_ms` integer?: Przerwa między zapytaniami w milisekundach.
  - `include_subdomains` boolean?: Odwiedzaj też subdomeny.
  - `respect_robots` boolean?: Przestrzegaj robots.txt, także Crawl-delay.
  - `follow_nofollow` boolean?: Podążaj też za linkami nofollow.
  - `ignore_query` boolean?: Traktuj /a?x=1 i /a jako tę samą stronę.
  - `include_html` boolean?: Zapisz surowy HTML w pliku z wynikiem.
  - `include_paths` string[]?: Odwiedzaj tylko te ścieżki. Wzorzec pasuje do początku ścieżki, jak w robots.txt. `*` to dowolny tekst, `$` to koniec.
  - `exclude_paths` string[]?: Pomijaj te ścieżki. Wzorzec pasuje do początku ścieżki, jak w robots.txt. `*` to dowolny tekst, `$` to koniec.
- `mode` string | null (sitemap, links): Skąd pochodzą adresy. null, dopóki crawl się nie zacznie.
- `pages_done` integer: Odwiedzone strony.
- `pages_failed` integer: Strony bez odpowiedzi, wliczone w pages_done.
- `pages_found` integer: Strony odwiedzone i czekające w kolejce.
- `recent` object[]: Ostatnio odwiedzone strony.
  - `url` string:
  - `status` integer | null: null, gdy strony nie udało się pobrać.
  - `error` string | null: Kod błędu, gdy strony nie udało się pobrać.
- `stop_reason` string | null (finished, max_pages, no_tokens, max_time, throttled, canceled, interrupted): Dlaczego crawl się skończył. Do tego czasu null.
- `error` string | null: Kod błędu nieudanego crawla.
- `summary` object | null: Gotowe, gdy crawl się skończy.
  - `avg_duration_ms` integer | null: Średni czas pobrania w milisekundach.
  - `issues` object: Liczba stron z każdym problemem. Klucze to wartości parametru issue.
- `file_size` integer | null: Rozmiar skompresowanego pliku SQLite w bajtach.
- `page_limit` integer: Zarezerwowane tokeny. Mniej niż max_pages, jeśli tyle tokenów zostało.
- `throttle` object | null: Wypełnione, gdy witryna odpowiedziała 429 i crawl zwolnił.
  - `count` integer: Liczba przerw.
  - `delay_ms` integer: Odstęp między zapytaniami po zwolnieniu, w milisekundach.
  - `resume_at` string: Koniec ostatniej przerwy. Gdy jest w przyszłości, crawl czeka.
- `retry_of` string | null: Crawl, którego strony są tu pobierane ponownie. null w zwykłym crawlu.
- `created_at` string: Kiedy crawl trafił do kolejki.
- `started_at` string | null: Kiedy crawl wyszedł z kolejki.
- `finished_at` string | null: Kiedy crawl się skończył.

## Błędy

- 401: unauthorized
- 404: not_found
- 422: invalid_request

## Przykład

```bash
curl "https://api.seoscraper.io/v1/crawls/CRAWL_ID" \
  -H "Authorization: Bearer ssk_YOUR_KEY"
```

```json
{
  "id": "7c1f0a52-3f0e-4f0b-9c53-2f6f1f1d7a10",
  "status": "completed",
  "url": "https://books.toscrape.com",
  "options": {
    "url": "https://books.toscrape.com",
    "source": "auto",
    "max_pages": 50,
    "max_depth": 5,
    "concurrency": 5,
    "delay_ms": 0,
    "include_subdomains": false,
    "respect_robots": true,
    "follow_nofollow": false,
    "ignore_query": false,
    "include_html": true,
    "include_paths": [],
    "exclude_paths": []
  },
  "mode": "links",
  "pages_done": 50,
  "pages_failed": 0,
  "pages_found": 312,
  "recent": [
    {
      "url": "https://books.toscrape.com/catalogue/page-2.html",
      "status": 200,
      "error": null
    }
  ],
  "stop_reason": "max_pages",
  "error": null,
  "summary": {
    "avg_duration_ms": 214,
    "issues": {
      "ok": 50,
      "client_error": 0,
      "missing_description": 50,
      "missing_title": 0
    }
  },
  "file_size": 412338,
  "page_limit": 50,
  "throttle": null,
  "retry_of": null,
  "created_at": "2026-11-25T08:00:00Z",
  "started_at": "2026-11-25T08:00:01Z",
  "finished_at": "2026-11-25T08:00:09Z"
}
```
