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

# Map

> Fast, synchronous URL discovery for a site — without scraping content.

Map enumerates a site's URLs quickly, without scraping any of them. It returns synchronously and costs one credit — the fastest way to see what pages a site has before committing to a crawl.

## When to use

* You want to preview a [Crawl](/endpoints/crawl)'s scope before running it.
* You need a list of a site's URLs to filter down and feed into a [Batch](/endpoints/batch).
* You want to find pages matching a term (e.g. every URL containing `pricing`).

Map returns URLs only — no page content. To get content, pass the URLs to Scrape, Batch, or Crawl.

## Example request

Send a `POST` to `/v1/web/map`. Narrow the results with `search`, `limit`, and discovery options.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.hydrafetch.com/v1/web/map \
    -H "X-API-Key: hf_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://example.com",
      "search": "pricing",
      "limit": 1000
    }'
  ```

  ```javascript Node theme={null}
  const res = await fetch("https://api.hydrafetch.com/v1/web/map", {
    method: "POST",
    headers: {
      "X-API-Key": "hf_your_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      url: "https://example.com",
      search: "pricing",
      limit: 1000,
    }),
  });
  const { data } = await res.json();
  console.log(data.links);
  ```

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

  res = requests.post(
      "https://api.hydrafetch.com/v1/web/map",
      headers={"X-API-Key": "hf_your_key_here"},
      json={"url": "https://example.com", "search": "pricing", "limit": 1000},
  )
  print(res.json()["data"]["links"])
  ```
</CodeGroup>

## Example response

```json theme={null}
{
  "data": {
    "url": "https://example.com",
    "links": [
      "https://example.com/",
      "https://example.com/pricing"
    ],
    "count": 2
  }
}
```

## Request options

<ParamField body="url" type="string" required>
  The site whose URLs you want to enumerate. Must be `http(s)`.
</ParamField>

<ParamField body="includeLinks" type="boolean" default="false">
  Also include same-site links found on the starting page, not just the site's page list.
</ParamField>

<ParamField body="limit" type="number">
  Maximum number of URLs to return. 1–5000. Results are ordered by how recently each page changed, so a limit gives you the **most recently updated** URLs rather than an even sample of the site. On a site where one kind of page changes constantly, such as a shop's product pages, a small limit can return that kind and nothing else. `sitemapInclude` is how you ask for the rest.
</ParamField>

<ParamField body="search" type="string">
  Keep only discovered URLs containing this term (e.g. `"pricing"`). Up to 200 characters.
</ParamField>

<ParamField body="sitemap" type="string">
  Whether to use the site's published page list: `skip` it, `include` it alongside discovered links, or use it `only`.
</ParamField>

<ParamField body="sitemapInclude" type="string">
  On sites that publish several page lists, only read the ones whose address contains one of these comma-separated terms. For example `"pages"` on a shop to reach its policy and information pages instead of its products.
</ParamField>

<ParamField body="sitemapExclude" type="string">
  Skip page lists whose address contains any of these comma-separated terms. Compose it with `sitemapInclude`, for example include `"post"` and exclude `"tag,category,author"` to avoid tag and category archives.
</ParamField>

<ParamField body="order" type="string" default="newest">
  Sort by how recently each page changed: `newest` first, or `oldest`. URLs with no recorded date sort last either way.
</ParamField>

<ParamField body="includeSubdomains" type="boolean" default="false">
  Also include URLs on subdomains of the site.
</ParamField>

<ParamField body="ignoreQueryParameters" type="boolean" default="false">
  Treat URLs that differ only by query string as one.
</ParamField>

## Response fields

<ResponseField name="data" type="object">
  <Expandable title="MapResult">
    <ResponseField name="url" type="string">The site you requested.</ResponseField>
    <ResponseField name="links" type="string[]">The site's discovered URLs.</ResponseField>
    <ResponseField name="count" type="number">How many URLs were returned.</ResponseField>
  </Expandable>
</ResponseField>

<Note>
  Map is one credit regardless of how many URLs come back, and it returns synchronously. It is the cheapest way to size up a site before a crawl or batch.
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="Map API reference" icon="https://mintcdn.com/hydrafetch/koPVMLXM3S4OTC3p/icons/code.svg?fit=max&auto=format&n=koPVMLXM3S4OTC3p&q=85&s=ce116045b848b9f082595f6161ed7383" href="/api-reference" width="18" height="18" data-path="icons/code.svg">
    Full request and response schema with a live playground.
  </Card>

  <Card title="Crawl a whole site" icon="https://mintcdn.com/hydrafetch/DnAi7n_kype0jB2E/icons/sitemap.svg?fit=max&auto=format&n=DnAi7n_kype0jB2E&q=85&s=cffc277c9028dc4743694521f28f8088" href="/endpoints/crawl" width="18" height="18" data-path="icons/sitemap.svg">
    Turn a mapped scope into scraped pages.
  </Card>

  <Card title="Scrape a list of URLs" icon="https://mintcdn.com/hydrafetch/DnAi7n_kype0jB2E/icons/bullet-list.svg?fit=max&auto=format&n=DnAi7n_kype0jB2E&q=85&s=879895a11dd7930d967e781b595fd992" href="/endpoints/batch" width="18" height="18" data-path="icons/bullet-list.svg">
    Feed mapped URLs into a batch job.
  </Card>

  <Card title="Scrape one URL" icon="https://mintcdn.com/hydrafetch/DnAi7n_kype0jB2E/icons/file-content.svg?fit=max&auto=format&n=DnAi7n_kype0jB2E&q=85&s=478eea6173d8c82bf8c41ab7277656bf" href="/endpoints/scrape" width="18" height="18" data-path="icons/file-content.svg">
    Scrape any single discovered URL.
  </Card>
</CardGroup>


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