# Pobierz jedną stronę

Kosztuje jeden token. Gdy strony nie uda się pobrać, token wraca.

`POST https://api.seoscraper.io/v1/scrape`

## Treść zapytania

- `url` string: Adres strony. Gdy nie ma protokołu, dopisujemy https://.
- `include_html` boolean?: Dołącz do odpowiedzi surowy HTML.

## Odpowiedź 200

- `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.
- `id` string: Identyfikator wyniku.
- `created_at` string: Data i godzina pobrania.
- `saved` boolean: Czy wynik został zapisany w Twoim zespole.

## Błędy

- 401: unauthorized
- 403: forbidden
- 422: invalid_request, invalid_url, url_not_allowed, unsupported_content, too_many_redirects, dns_error
- 429: rate_limited, no_tokens
- 502: fetch_failed
- 503: busy, scraper_unavailable, unavailable
- 504: timeout

## Przykład

```bash
curl -X POST "https://api.seoscraper.io/v1/scrape" \
  -H "Authorization: Bearer ssk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://books.toscrape.com"}'
```

```json
{
  "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,
  "id": "0f5a8f5e-6d7c-4b1e-a8a1-8f5f0d3c2b11",
  "created_at": "2026-11-25T08:00:00Z",
  "saved": true
}
```
