> ## 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.

# Scraping API SDK und CLI

Gologin Web Unlocker ist eine **Scraping API mit nur einem Endpoint** für JavaScript-lastige und geschützte Websites.

Sie senden eine URL, erhalten den gerenderten HTML-Code bzw. Text der Seite und verarbeiten ihn in Ihrer eigenen Extraktions-Pipeline.

## Warum als Scraping API verwenden

* Ein Endpoint für jede Ziel-URL
* Authentifizierung per API-Key, keine Browser-Orchestrierung erforderlich
* HTML-basierte Antwort, die sich in bestehende Parser einfügt
* Gut geeignet für ETL, Monitoring, KI-Datenaufnahme und Datenpipelines

## Endpoint

`GET https://parsing.webunlocker.gologin.com/v1/scrape?url={encoded_url}`

## Authentifizierung

Senden Sie Ihren API-Key in den Headern:

```http theme={null}
apikey: <API_KEY>
```

## Anfragemodell

| Name | Ort | Typ | Erforderlich | Beschreibung |
| - | - | - | - | - |
| `url` | query | Zeichenfolge (absolute URL) | ja | Ziel-URL für das Scraping |

## Schnellstart

### cURL

```bash theme={null}
curl "https://parsing.webunlocker.gologin.com/v1/scrape?url=https%3A%2F%2Fexample.com" \
  -H "apikey: YOUR_API_KEY"
```

### Python

```python theme={null}
import requests

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

print(response.status_code)
print(response.text[:500])
```

### JavaScript (fetch)

```js theme={null}
const response = await fetch(
  "https://parsing.webunlocker.gologin.com/v1/scrape?url=" +
    encodeURIComponent("https://example.com"),
  { headers: { apikey: "YOUR_API_KEY" } }
);

const html = await response.text();
console.log(response.status, html.slice(0, 500));
```

## Antwortverhalten

Der aktuelle Antworttext ist **rohes, gerendertes HTML bzw. Text**.

* `200` -> Erfolg, der Body enthält den HTML-Code bzw. Text der Seite
* `401` / `403` -> ungültiger oder fehlender API-Key
* `422` -> ungültige oder fehlende `url`
* `429` -> Rate Limit erreicht
* `500+` -> temporärer serverseitiger Fehler

## Hinweise zu Wiederholungsversuchen

Wiederholen Sie die Anfrage mit exponentiellem Backoff bei:

* Netzwerkfehlern
* `408`, `429`, `500`, `502`, `503`, `504`

## Hinweis zum Funktionsumfang

Der aktuelle öffentliche Endpoint ist HTML-basiert. Gehen Sie nicht davon aus, dass weitere Backend-Endpoints (z. B. Screenshot, Crawl, Suche oder Nutzung) verfügbar sind, sofern sie nicht ausdrücklich dokumentiert und für Ihr Konto aktiviert sind.

## Offizielles Node.js SDK

Installation:

```bash theme={null}
npm i gologin-webunlocker
```

### SDK-Schnellstart

```ts theme={null}
import { WebUnlocker } from "gologin-webunlocker";

const client = new WebUnlocker({
  apiKey: process.env.GOLOGIN_WEBUNLOCKER_API_KEY!
});

const result = await client.scrape("https://example.com");
console.log(result.status);
console.log(result.content.slice(0, 500));
```

### Konstruktoroptionen

```ts theme={null}
new WebUnlocker({
  apiKey: "wu_live_xxx",
  baseUrl: "https://parsing.webunlocker.gologin.com",
  timeoutMs: 15000,
  maxRetries: 2
});
```

### Zentrale SDK-Methoden

* `scrape(url)` -> normalisiertes Antwortobjekt
* `scrapeRaw(url)` -> natives `Response`
* `buildScrapeUrl(url)` -> vollständige Anfrage-URL

### Im SDK abgeleitete Methoden (aus dem zurückgegebenen HTML)

Dies sind **keine separaten Backend-Endpoints**, sondern Methoden, die im SDK aus dem von der API gelieferten HTML abgeleitet werden:

* `scrapeText(url)` -> reiner Text
* `scrapeMarkdown(url)` -> Markdown
* `scrapeJSON(url)` -> strukturierte Metadaten (`title`, `meta`, `links`, `headings`)
* `batchScrape(urls, { concurrency })` -> Hilfsmethode für mehrere Scrape-Aufrufe

### Typisierte Fehler

* `WebUnlockerError`
* `AuthenticationError`
* `RateLimitError`
* `APIError`
* `TimeoutError`
* `NetworkError`

Zuordnung:

* `401` / `403` -> `AuthenticationError`
* `429` -> `RateLimitError`
* `500+` -> `APIError`
* Timeout/Abbruch -> `TimeoutError`
* Fetch-/Netzwerkfehler -> `NetworkError`

## CLI

```bash theme={null}
gologin-webunlocker <command> <url> [options]
```

Befehle:

* `scrape` (rohes HTML/Text)
* `text` (abgeleiteter Text)
* `markdown` (abgeleitetes Markdown)
* `json` (abgeleitete Metadaten)

Beispiele:

```bash theme={null}
gologin-webunlocker scrape https://example.com --api-key wu_live_xxx
GOLOGIN_WEBUNLOCKER_API_KEY=wu_live_xxx gologin-webunlocker text https://example.com
GOLOGIN_WEBUNLOCKER_API_KEY=wu_live_xxx gologin-webunlocker json https://example.com
```

## Typische Scraping-Anwendungsfälle

* Preis- und Katalogüberwachung
* Anreicherung von Leads und Verzeichnissen
* Pipelines für Marktanalysen
* Content-Aggregation und Indexierung
* Workflows für LLM-Datenaufnahme und -Extraktion

## Gologin Web Access CLI (einheitlich)

Für eine leistungsfähigere CLI, die Web Unlocker und Cloud Browser in einer gemeinsamen Befehlsoberfläche vereint, verwenden Sie `gologin-web-access`:

```bash theme={null}
npm install -g gologin-web-access

export GOLOGIN_WEB_UNLOCKER_API_KEY="wu_..."

# all scraping commands from gologin-webunlocker, plus:
gologin-web-access batch-scrape url1 url2 url3 --format text --summary
gologin-web-access search "query" --limit 10
gologin-web-access map https://example.com --limit 50
gologin-web-access crawl https://docs.example.com --format markdown --limit 20
gologin-web-access extract https://example.com --schema ./schema.json
gologin-web-access change-track https://example.com --format markdown

# plus cloud browser interaction (requires GOLOGIN_TOKEN)
gologin-web-access open https://example.com
gologin-web-access snapshot
gologin-web-access click e3
```

Die vollständige Referenz finden Sie unter [Gologin Web Access CLI](https://gologin.com/docs/de/cli-tools/web-access.md).

## Weiterführende Dokumentation

* [Was ist Web Unlocker](https://gologin.com/docs/de/what-is-web-unlocker.md)
* [Web Unlocker Schnellstart](https://gologin.com/docs/de/web-unlocker-quick-start.md)
* [Web Unlocker Anwendungsfälle](https://gologin.com/docs/de/web-unlocker-use-cases.md)


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