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

# Przykłady zastosowań Web Unlocker

Web Unlocker to Scraping API — wysyłasz adres URL, a w odpowiedzi otrzymujesz w pełni wyrenderowany kod HTML. Na tej stronie znajdziesz najczęstsze sposoby wykorzystania tego narzędzia.

***

## Samodzielne pobieranie strony

Najprostszy przypadek: potrzebujesz treści strony internetowej, która blokuje zwykłe żądania HTTP.

### Python

```python theme={null}
import requests

response = requests.get(
    "https://parsing.webunlocker.gologin.com/v1/scrape",
    params={"url": "https://example.com/product/123"},
    headers={"apikey": "YOUR_API_KEY"}
)

html = response.text
print(html)
```

### JavaScript

```javascript theme={null}
const html = await fetch(
  "https://parsing.webunlocker.gologin.com/v1/scrape?url=" +
    encodeURIComponent("https://example.com/product/123"),
  { headers: { apikey: "YOUR_API_KEY" } }
).then((r) => r.text());

console.log(html);
```

Nie musisz uruchamiać przeglądarki, konfigurować proxy ani walczyć z Cloudflare. Jedno wywołanie i masz stronę.

**Sprawdza się w przypadku:**

* Sprawdzania cen w sklepie konkurencji
* Pobierania ofert pracy, opinii lub danych o produktach
* Monitorowania zmian na stronach
* Jednorazowych skryptów do zbierania danych

***

## Przekazywanie treści do AI

Web Unlocker zwraca surowy kod HTML. Przekaż go do modelu LLM, aby wyodrębnić ustrukturyzowane dane, streścić treść lub odpowiedzieć na pytania dotyczące strony — bez pisania logiki parsowania.

### Python + OpenAI

```python theme={null}
import requests
from openai import OpenAI

html = requests.get(
    "https://parsing.webunlocker.gologin.com/v1/scrape",
    params={"url": "https://news.ycombinator.com"},
    headers={"apikey": "YOUR_API_KEY"}
).text

client = OpenAI()
response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {
            "role": "user",
            "content": f"Extract the top 5 story titles and their URLs from this HTML:\n\n{html[:8000]}"
        }
    ]
)

print(response.choices[0].message.content)
```

### JavaScript + Anthropic

```javascript theme={null}
import Anthropic from "@anthropic-ai/sdk";

const html = await fetch(
  "https://parsing.webunlocker.gologin.com/v1/scrape?url=" +
    encodeURIComponent("https://news.ycombinator.com"),
  { headers: { apikey: "YOUR_API_KEY" } }
).then((r) => r.text());

const client = new Anthropic();
const message = await client.messages.create({
  model: "claude-opus-4-5",
  max_tokens: 1024,
  messages: [
    {
      role: "user",
      content: `Extract the top 5 story titles and their URLs from this HTML:\n\n${html.slice(0, 8000)}`,
    },
  ],
});

console.log(message.content[0].text);
```

**Sprawdza się w przypadku:**

* Wyodrębniania ustrukturyzowanych danych (cen, nazw, dat) bez pisania parserów
* Streszczania artykułów lub stron produktów
* Porównywania wielu stron i wyciągania wniosków
* Tworzenia narzędzi badawczych lub monitorujących opartych na AI

***

## Użycie w agencie AI

Dodaj do swojego agenta AI narzędzie `scrape` oparte na Web Unlocker. Agent będzie wtedy mógł samodzielnie przeglądać internet — pobierać strony, czytać ich treść i podejmować działania — a Ty nie musisz pisać żadnej logiki przeglądania.

```python theme={null}
import requests
import anthropic

def scrape(url: str) -> str:
    """Fetch a URL and return its rendered HTML."""
    return requests.get(
        "https://parsing.webunlocker.gologin.com/v1/scrape",
        params={"url": url},
        headers={"apikey": "YOUR_API_KEY"}
    ).text

tools = [
    {
        "name": "scrape",
        "description": "Fetch the rendered HTML of any URL, including JavaScript-heavy and protected sites.",
        "input_schema": {
            "type": "object",
            "properties": {
                "url": {"type": "string", "description": "The URL to scrape"}
            },
            "required": ["url"]
        }
    }
]

client = anthropic.Anthropic()
messages = [
    {"role": "user", "content": "What is the current price of the iPhone 16 Pro on apple.com?"}
]

while True:
    response = client.messages.create(
        model="claude-opus-4-5",
        max_tokens=1024,
        tools=tools,
        messages=messages
    )

    if response.stop_reason == "end_turn":
        print(response.content[0].text)
        break

    tool_results = []
    for block in response.content:
        if block.type == "tool_use" and block.name == "scrape":
            html = scrape(block.input["url"])
            tool_results.append({
                "type": "tool_result",
                "tool_use_id": block.id,
                "content": html[:10000]
            })

    messages.append({"role": "assistant", "content": response.content})
    messages.append({"role": "user", "content": tool_results})
```

Agent sam decyduje, kiedy pobrać stronę i jaki adres URL wybrać. Samo pobieranie realizuje Web Unlocker.

**Sprawdza się w przypadku:**

* Agentów badawczych, które samodzielnie przeglądają internet
* Botów porównujących ceny lub wyszukujących okazje
* Procesów analizy konkurencji
* Każdego agenta, który potrzebuje danych z internetu w czasie rzeczywistym

***

## Pobieranie wielu stron jednocześnie

Wysyłaj żądania równolegle, aby zbierać dane z wielu adresów URL w tym samym czasie.

```python theme={null}
import requests
from concurrent.futures import ThreadPoolExecutor

API_URL = "https://parsing.webunlocker.gologin.com/v1/scrape"
API_KEY = "YOUR_API_KEY"

urls = [
    "https://example.com/page/1",
    "https://example.com/page/2",
    "https://example.com/page/3",
]

def scrape(url):
    response = requests.get(
        API_URL,
        params={"url": url},
        headers={"apikey": API_KEY}
    )
    return url, response.text

with ThreadPoolExecutor(max_workers=5) as executor:
    results = list(executor.map(scrape, urls))

for url, html in results:
    print(f"{url}: {len(html)} chars")
```

**Sprawdza się w przypadku:**

* Pobierania całych katalogów produktów lub stron z listami ofert
* Masowego zbierania danych do zbiorów treningowych
* Jednoczesnego monitorowania wielu stron

***

## Podsumowanie

| Przypadek użycia | Co robisz | Co otrzymujesz |
| - | - | - |
| Pobranie pojedynczej strony | GET z parametrem URL | Wyrenderowany HTML |
| Przekazanie do modelu LLM | Pobierasz stronę → przekazujesz do modelu | Wyodrębnione dane lub streszczenie |
| Narzędzie agenta AI | Agent wywołuje je na żądanie | Treści z internetu w czasie rzeczywistym |
| Masowe pobieranie | Równoległe żądania | HTML dla każdego adresu URL |

***

## Użycie z poziomu CLI

Możesz w ogóle nie pisać kodu — skorzystaj z Gologin Web Access CLI do typowych zadań scrapingu:

```bash theme={null}
npm install -g gologin-web-access
export GOLOGIN_WEB_UNLOCKER_API_KEY="wu_..."

# batch scrape multiple pages
gologin-web-access batch-scrape \
  https://example.com/page/1 \
  https://example.com/page/2 \
  https://example.com/page/3 \
  --format text --only-main-content --summary

# crawl a site
gologin-web-access crawl https://docs.example.com --format markdown --limit 50 --max-depth 2

# monitor page changes
gologin-web-access change-track https://example.com/pricing --format markdown

# extract structured data with a schema
gologin-web-access extract https://example.com/product/123 --schema ./product-schema.json

# search the web
gologin-web-access search "best antidetect browser 2026" --limit 10
```

Pełną listę poleceń znajdziesz w dokumencie [Web Access CLI](https://gologin.com/docs/pl/cli-tools/web-access.md).

***

## Podsumowanie

| Przypadek użycia | Co robisz | Co otrzymujesz |
| - | - | - |
| Pobranie pojedynczej strony | GET z parametrem URL | Wyrenderowany HTML |
| Przekazanie do modelu LLM | Pobierasz stronę → przekazujesz do modelu | Wyodrębnione dane lub streszczenie |
| Narzędzie agenta AI | Agent wywołuje je na żądanie | Treści z internetu w czasie rzeczywistym |
| Masowe pobieranie | Równoległe żądania | HTML dla każdego adresu URL |
| Zadania w CLI | polecenia `gologin-web-access` | Tekst, markdown, JSON, wyniki zbiorcze |

Zobacz [Quickstart](https://gologin.com/docs/pl/web-unlocker-quick-start.md), aby wysłać swoje pierwsze żądanie.


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