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

> ## Agent Instructions
> Setting up Context.dev for a user? Follow https://docs.context.dev/agent-quickstart.md. MCP clients sign in with OAuth and need no API key; application code reads CONTEXT_DEV_API_KEY.

# Map URLs

> Discover a site’s URLs and available page metadata.

Use Map to discover a site’s URLs before choosing which pages to read. Results can include a title, description, keywords, and language. Map returns an inventory, not page content or a guarantee of complete site coverage.

## Map a domain

<CodeGroup>
  ```typescript TypeScript theme={null}
  import ContextDev from "context.dev";

  const client = new ContextDev({
    apiKey: process.env.CONTEXT_DEV_API_KEY,
  });

  const site = await client.web.mapUrls({
    domain: "stripe.com",
    maxLinks: 50,
    urlRegex: "/customers/",
  });

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

  ```python Python theme={null}
  import os
  from context.dev import ContextDev

  client = ContextDev(api_key=os.environ["CONTEXT_DEV_API_KEY"])

  site = client.web.map_urls(
      domain="stripe.com",
      max_links=50,
      url_regex="/customers/",
  )

  for entry in site.urls:
      print(entry.url, entry.title)
  ```

  ```ruby Ruby theme={null}
  require "cgi/core"
  require "context_dev"

  client = ContextDev::Client.new(api_key: ENV.fetch("CONTEXT_DEV_API_KEY"))

  site = client.web.map_urls(
    domain: "stripe.com",
    max_links: 50,
    url_regex: "/customers/",
  )

  site.urls.each do |entry|
    puts "#{entry.url} #{entry.title}"
  end
  ```

  ```go Go theme={null}
  package main

  import (
      "context"
      "fmt"
      "os"

      contextdev "github.com/context-dot-dev/context-go-sdk/v2"
      "github.com/context-dot-dev/context-go-sdk/v2/option"
  )

  func main() {
      client := contextdev.NewClient(
          option.WithAPIKey(os.Getenv("CONTEXT_DEV_API_KEY")),
      )

      site, err := client.Web.MapURLs(context.Background(), contextdev.WebMapURLsParams{
          Domain:   "stripe.com",
          MaxLinks: contextdev.Int(50),
          URLRegex: contextdev.String("/customers/"),
      })
      if err != nil {
          panic(err)
      }

      for _, entry := range site.URLs {
          fmt.Println(entry.URL, entry.Title)
      }
  }
  ```

  ```php PHP theme={null}
  <?php

  require __DIR__.'/vendor/autoload.php';

  use ContextDev\Client;

  $client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY'));

  $site = $client->web->mapUrls(
      domain: 'stripe.com',
      maxLinks: 50,
      urlRegex: '/customers/',
  );

  foreach ($site->urls as $entry) {
      echo $entry->url, ' ', $entry->title ?? '', PHP_EOL;
  }
  ```

  ```bash cURL theme={null}
  curl --get https://api.context.dev/v1/web/urls \
    --header "Authorization: Bearer $CONTEXT_DEV_API_KEY" \
    --data-urlencode "domain=stripe.com" \
    --data-urlencode "maxLinks=50" \
    --data-urlencode "urlRegex=/customers/"
  ```
</CodeGroup>

Abridged response:

```json theme={null}
{"success":true,"domain":"stripe.com","urls":[{"url":"https://stripe.com/pricing","title":"Pricing"}]}
```

## Use the results

Choose relevant URLs and pass them to [Scrape](/scrape/overview) or [Batches](/batches/overview). [Filters and search](/map/filter-and-search) narrow the returned inventory.

Newly discovered URLs can lack metadata while background enrichment runs. ZDR or custom headers return URLs without shared metadata enrichment. Responses are not cached as a complete inventory; inspect `partial` if a deadline stopped processing.

See the [Map reference](/api-reference/web-scraping/map) for the complete query and response.
