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

# Map

> Input a website and get the URLs on it, with their titles

## Introducing /map

The easiest way to go from a single URL to a list of the URLs on its website. This is useful when:

* You need to choose which pages to scrape or crawl
* You need to find the one page about a topic, like a pricing or API page
* You need a list of a site's pages, with their titles and descriptions

For details, see the [Map Endpoint API Reference](/api-reference/endpoint/map.md).

## Mapping

### /map endpoint

Used to map a URL and get the URLs of the website. Each link comes with its title and, when the site has one, its description.

### Installation

```bash Python
pip install screenshotrender
```

```bash Node
npm install screenshotrender
```

### Usage

```python Python
from screenshotrender import ScreenshotRender

screenshotrender = ScreenshotRender(api_key="sr-YOUR-API-KEY")

site = screenshotrender.map("https://docs.python.org/3/", limit=5)

for link in site.links:
    print(link.url, link.title)
```

```js Node
import ScreenshotRender from "screenshotrender";

const screenshotrender = new ScreenshotRender({ apiKey: "sr-YOUR-API-KEY" });

const site = await screenshotrender.map("https://docs.python.org/3/", { limit: 5 });

for (const link of site.links) {
  console.log(link.url, link.title);
}
```

```bash cURL
curl -s -X POST "https://www.screenshotrender.com/api/v1/map" \
  -H "Authorization: Bearer $SCREENSHOTRENDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://docs.python.org/3/",
    "limit": 5
  }'
```

### Response

SDKs return the data object directly. cURL returns the payload exactly as shown below.

```json Response
{
  "success": true,
  "data": {
    "links": [
      {
        "url": "https://docs.python.org/3/genindex-all.html",
        "title": "Index — Python 3.15.2 documentation"
      },
      {
        "url": "https://docs.python.org/3/library/cgitb.html",
        "title": "cgitb — Traceback manager for CGI scripts — Python 3.15.2...",
        "description": "This module is no longer part of the Python standard library. It was removed in Python 3.13 after be..."
      },
      {
        "url": "https://docs.python.org/3/library/readline.html",
        "title": "readline — GNU readline interface — Python 3.15.2 documen...",
        "description": "The readline module defines a number of functions to facilitate completion and reading/writing of hi..."
      },
      {
        "url": "https://docs.python.org/3/whatsnew/2.7.html",
        "title": "What’s New in Python 2.7 — Python 3.15.2 documentation",
        "description": "Author, A.M. Kuchling (amk at amk.ca),. This article explains the new features in Python 2.7. Python..."
      },
      {
        "url": "https://docs.python.org/3/whatsnew/2.3.html",
        "title": "What’s New in Python 2.3 — Python 3.15.2 documentation",
        "description": "Author, A.M. Kuchling,. This article explains the new features in Python 2.3. Python 2.3 was release..."
      }
    ]
  },
  "creditsUsed": 1
}
```

## Map with search

Add `search` to order the URLs by how relevant they are to it. The most relevant page comes first.

```bash cURL
curl -s -X POST "https://www.screenshotrender.com/api/v1/map" \
  -H "Authorization: Bearer $SCREENSHOTRENDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://docs.python.org/3/",
    "search": "asyncio",
    "limit": 3
  }'
```

```json Response
{
  "success": true,
  "data": {
    "links": [
      {
        "url": "https://docs.python.org/3/library/asyncio.html",
        "title": "asyncio — Asynchronous I/O",
        "description": "Hello World!: asyncio is a library to write concurrent code using the async/await syntax. asyncio is..."
      },
      {
        "url": "https://docs.python.org/3/howto/a-conceptual-overview-of-asyncio.html",
        "title": "A conceptual overview of asyncio",
        "description": "asyncio automatically associates tasks with the event loop for you. This automatic association was p..."
      },
      {
        "url": "https://docs.python.org/3/library/asyncio-task.html",
        "title": "Coroutines and tasks",
        "description": "This section outlines high-level asyncio APIs to work with coroutines and Tasks. Coroutines, Awaitab..."
      }
    ]
  },
  "creditsUsed": 1
}
```

## Considerations

* A map costs 1 credit, whatever the number of URLs.
* `limit` sets the most URLs to return.
* Map lists URLs without reading the pages. To read them, pass the ones you want to [Scrape](/features/scrape.md), or [Crawl](/features/crawl.md) the site.
