# Odczytaj jedną stronę crawla

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

## Parametry ścieżki

- `crawl_id` string: Identyfikator crawla.
- `page_id` integer: Numer strony w crawlu.

## Parametry zapytania

- `include_html` boolean?: Dołącz do odpowiedzi surowy HTML.

## Odpowiedź 200

- `page` object: Te same dane co na liście stron.
  - `id` integer: Numer strony w crawlu.
  - `url` string: Adres strony.
  - `final_url` string | null: Adres po wszystkich przekierowaniach.
  - `status` integer | null: null, gdy strony nie udało się pobrać.
  - `error` string | null: Kod błędu, gdy strony nie udało się pobrać.
  - `depth` integer: Liczba kliknięć od strony startowej.
  - `found_on` string: Strona z pierwszym linkiem do tej strony.
  - `title` string: Treść znacznika title.
  - `meta_description` string: Treść meta description.
  - `canonical` string: Adres kanoniczny.
  - `index` boolean | null: Czy stronę można indeksować.
  - `word_count` integer | null: Liczba słów w treści strony.
  - `duration_ms` integer | null: Czas pobrania w milisekundach.
  - `size_bytes` integer | null: Rozmiar pobranej treści w bajtach.
  - `redirects` integer: Liczba przekierowań.
  - `h1` integer: Liczba nagłówków h1.
  - `links` integer: Liczba linków.
  - `missing_alt` integer: Liczba obrazów bez atrybutu alt.
- `data` object | null: null, gdy strony nie udało się pobrać.
  - `url` string: Adres z zapytania.
  - `final_url` string: Adres po wszystkich przekierowaniach.
  - `path` string: Ścieżka adresu końcowego.
  - `status` integer: Status HTTP strony.
  - `content_type` string: Typ treści podany przez serwer.
  - `redirects` object[]: Kolejne przekierowania z adresem i statusem.
    - `url` string:
    - `status` integer:
  - `headers` object[]: Nagłówki HTTP strony, nazwy małymi literami.
    - `name` string:
    - `value` string:
  - `duration_ms` integer: Czas pobrania w milisekundach.
  - `size_bytes` integer: Rozmiar pobranej treści w bajtach.
  - `truncated` boolean: Czy treść została ucięta na limicie 10 MB.
  - `lang` string: Język z atrybutu lang.
  - `title` string: Treść znacznika title.
  - `meta_description` string: Treść meta description.
  - `canonical` string: Adres kanoniczny.
  - `robots` object: Meta robots i X-Robots-Tag oraz wynikowe index i follow.
    - `meta` string: Treść meta robots.
    - `x_robots_tag` string: Wartość nagłówka X-Robots-Tag.
    - `index` boolean: Czy stronę można indeksować.
    - `follow` boolean: Czy wolno podążać za linkami na stronie.
  - `word_count` integer: Liczba słów w treści strony.
  - `headings` object[]: Nagłówki od h1 do h6 w kolejności na stronie.
    - `level` integer: 1 dla h1, 6 dla h6.
    - `text` string:
  - `links` object[]: Linki: adres, tekst, typ, rel i nofollow.
    - `url` string:
    - `text` string:
    - `type` string (internal, external, other): other: mailto, tel i podobne.
    - `rel` string: Wartość atrybutu rel.
    - `nofollow` boolean:
  - `images` object[]: Obrazy: src, alt, lazy i wymiary.
    - `src` string:
    - `alt` string | null: null: brak atrybutu, pusty tekst: pusty alt.
    - `lazy` boolean: Czy obraz ma loading=lazy.
    - `width` string:
    - `height` string:
  - `html` string | null?: Surowy HTML, jeśli poprosisz o include_html. W innym razie null.

## Błędy

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

## Przykład

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

```json
{
  "page": {
    "id": 1,
    "url": "https://books.toscrape.com",
    "final_url": "https://books.toscrape.com/",
    "status": 200,
    "error": null,
    "depth": 0,
    "found_on": "",
    "title": "All products | Books to Scrape - Sandbox",
    "meta_description": "",
    "canonical": "",
    "index": true,
    "word_count": 315,
    "duration_ms": 198,
    "size_bytes": 51011,
    "redirects": 0,
    "h1": 1,
    "links": 94,
    "missing_alt": 0
  },
  "data": {
    "url": "https://books.toscrape.com",
    "final_url": "https://books.toscrape.com/",
    "path": "/",
    "status": 200,
    "content_type": "text/html",
    "redirects": [],
    "headers": [
      {
        "name": "content-type",
        "value": "text/html"
      }
    ],
    "duration_ms": 826,
    "size_bytes": 51294,
    "truncated": false,
    "lang": "en-us",
    "title": "All products | Books to Scrape - Sandbox",
    "meta_description": "",
    "canonical": "",
    "robots": {
      "meta": "NOARCHIVE,NOCACHE",
      "x_robots_tag": "",
      "index": true,
      "follow": true
    },
    "word_count": 309,
    "headings": [
      {
        "level": 1,
        "text": "All products"
      }
    ],
    "links": [
      {
        "url": "https://books.toscrape.com/catalogue/page-2.html",
        "text": "next",
        "type": "internal",
        "rel": "",
        "nofollow": false
      }
    ],
    "images": [
      {
        "src": "https://books.toscrape.com/media/cache/2c/da/2cdad67c44b002e7ead0cc35693c0e8b.jpg",
        "alt": "A Light in the Attic",
        "lazy": false,
        "width": "",
        "height": ""
      }
    ],
    "html": null
  }
}
```
