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

# Karten

> Erhalte alle URLs auf einer Website.

Über den Olostep `/v1/maps` Endpunkt kannst du alle URLs auf einer Website abrufen. Dies ist nützlich für die Inhaltserkennung, die Analyse der Website-Struktur (z.B. SEO) oder um zu entscheiden, welche URLs du als nächstes scrapen möchtest.

* Erhalte alle URLs auf einer Website (einschließlich Sitemaps und entdeckter Links)
* Verwende spezielle Muster, um Pfade einzuschließen/auszuschließen (z.B. `/blog/**`)
* Paginierung großer Antworten mit `cursor` (bis zu 10MB pro Antwort)
* Begrenze das Volumen mit `top_n`

Für API-Details siehe die [Map Endpoint API Referenz](/api-reference/maps/create).

## Installation

<CodeGroup>
  ```python Python theme={null}
  pip install olostep
  ```

  ```javascript Node theme={null}
  npm install olostep
  ```

  ```bash cURL theme={null}
  # curl ist standardmäßig auf macOS, Linux und Windows verfügbar
  ```

  ```javascript Node (API) theme={null}
  npm install node-fetch
  ```

  ```bash Python (API) theme={null}
  pip install requests
  ```
</CodeGroup>

## Verwendung

Sende eine POST-Anfrage mit der Website-`url`. Optional kannst du `include_urls`, `exclude_urls` (Glob-Muster) und `top_n` übergeben.

<CodeGroup>
  ```python Python theme={null}
  from olostep import Olostep

  client = Olostep(api_key="YOUR_REAL_KEY")

  sitemap = client.maps.create(url="https://docs.olostep.com")

  for url in sitemap.urls():
      print(url)
  ```

  ```js Node theme={null}
  import Olostep from 'olostep'

  const client = new Olostep({ apiKey: 'YOUR_REAL_KEY' })

  const map = await client.maps.create({ url: 'https://docs.olostep.com' })

  for await (const url of map.urls()) {
    console.log(url)
  }
  ```

  ```bash cURL theme={null}
  curl -s -X POST "https://api.olostep.com/v1/maps" \
    -H "Authorization: Bearer $OLOSTEP_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://docs.olostep.com"
    }'
  ```

  ```js Node (API) theme={null}
  const res = await fetch('https://api.olostep.com/v1/maps', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer <YOUR_API_KEY>',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ url: 'https://docs.olostep.com' })
  })
  console.log(await res.json())
  ```

  ```python Python (API) theme={null}
  import requests
  import json

  endpoint = "https://api.olostep.com/v1/maps"

  payload = {
      "url": "https://docs.olostep.com"
  }
  headers = {
      "Authorization": "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json"
  }

  response = requests.post(endpoint, json=payload, headers=headers)
  print(json.dumps(response.json(), indent=2))
  ```
</CodeGroup>

Die Antwortzeit liegt normalerweise innerhalb von Sekunden, kann aber bei komplexeren Websites bis zu 120 Sekunden dauern. Es können alle URLs von einer Website extrahiert werden, sogar Backlinks und solche, die nicht in den Sitemaps vorhanden sind. Du kannst auch entscheiden, welche URL-Pfade du in die Antwort ein- oder ausschließen möchtest.

Standardmäßig gibt der Endpunkt etwa 100k URLs in einem einzigen Aufruf zurück (max. 10MB). Wenn die Antwort mehr Daten enthält, gibt die API einen `cursor`-Parameter zurück, der für die Paginierung und das Abrufen der nachfolgenden URLs verwendet werden kann. Für weitere Details siehe die [API Referenz](/api-reference/maps/create#body-cursor).

Dieser Endpunkt ist besonders nützlich, wenn du:

* Alle Inhaltsseiten auf einer Website entdecken möchtest
* Die Struktur und Hierarchie der Website analysieren möchtest
* URLs für die Batch-Verarbeitung vorbereiten möchtest
* Entscheiden möchtest, welche spezifischen URLs gescrapt werden sollen

Für eine feinere Kontrolle über die zurückgegebenen URLs kannst du die Parameter `include_urls` und `exclude_urls` verwenden.

### Beispiel

Angenommen, du möchtest von [www.brex.com](http://www.brex.com) alle URLs extrahieren, die die Pfade nach `/product/` haben, z.B. `https://www.brex.com/product/api/no-code`, aber auch `www.brex.com/product` einschließen. Du kannst den folgenden Code verwenden:

<CodeGroup>
  ```python Python theme={null}
  from olostep import Olostep

  client = Olostep(api_key="YOUR_REAL_KEY")

  sitemap = client.maps.create(
      url="https://www.brex.com/",
      include_urls=["/product", "/product/**"],
      top_n=100000,
  )

  for url in sitemap.urls():
      print(url)
  ```

  ```js Node theme={null}
  import Olostep from 'olostep'

  const client = new Olostep({ apiKey: 'YOUR_REAL_KEY' })

  const map = await client.maps.create({
    url: 'https://www.brex.com/',
    includeUrls: ['/product', '/product/**'],
    topN: 100000,
  })

  for await (const url of map.urls()) {
    console.log(url)
  }
  ```

  ```bash cURL theme={null}
  curl -s -X POST "https://api.olostep.com/v1/maps" \
    -H "Authorization: Bearer $OLOSTEP_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://www.brex.com/",
      "include_urls": ["/product", "/product/**"],
      "top_n": 100000
    }'
  ```

  ```js Node (API) theme={null}
  const endpoint = 'https://api.olostep.com/v1/maps'

  const res = await fetch(endpoint, {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer <YOUR_API_KEY>',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      url: 'https://www.brex.com/',
      include_urls: ['/product', '/product/**'],
      top_n: 100000
    })
  })
  console.log(await res.text())
  ```

  ```python Python (API) theme={null}
  import requests

  endpoint = "https://api.olostep.com/v1/maps"

  payload = {
      "url": "https://www.brex.com/",
      "include_urls": ["/product", "/product/**"],
      "top_n": 100000
  }

  headers = {
      "Authorization": "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json"
  }

  response = requests.post(endpoint, json=payload, headers=headers)

  print(response.text)
  ```
</CodeGroup>

## Fazit

Der Maps-Endpunkt ist ein leistungsstarkes Werkzeug zur Inhaltserkennung und Website-Analyse. Er bietet eine umfassende Liste von URLs auf einer Website, die es dir ermöglicht, Inhalte von bestimmten Seiten zu extrahieren oder die Website-Struktur zu analysieren. Dieser Endpunkt ist besonders nützlich für SEO-Profis, Content-Marketer und KI-Agenten, die Website-Inhalte oder -Strukturen analysieren müssen.

## Preisgestaltung

Eine Karte kostet 1 Kredit. Für jede zusätzlichen 1000 URLs, die in der Antwort zurückgegeben werden, wird ein zusätzlicher Kredit berechnet.
