Web Map

Discover all URLs on a website for bulk scraping or site auditing.

Web Map discovers all URLs within a website. Use it to find pages before bulk scraping, audit site structure, or generate sitemaps.

Pricing

$0.0038 per call — flat rate regardless of how many URLs are discovered.

Basic usage

const result = await client.post('/v1/tools/web_map', {
  body: {
    url: 'https://docs.example.com',
    limit: 100
  }
});

console.log(result.links);
// [
//   { url: 'https://docs.example.com/', title: 'Docs', description: '...' },
//   { url: 'https://docs.example.com/getting-started', title: 'Getting started', description: '...' },
//   ...
// ]

Each entry in links is an object with the page url and, when known, its title and description.

Filter URLs by pattern

Find only URLs matching a search term:

const result = await client.post('/v1/tools/web_map', {
  body: {
    url: 'https://blog.example.com',
    search: 'tutorial',
    limit: 50
  }
});

// Only returns URLs containing "tutorial"

Sitemap handling

Control how sitemaps are used:

// Only crawl, ignore sitemap
const result = await client.post('/v1/tools/web_map', {
  body: {
    url: 'https://example.com',
    sitemap: 'exclude',
    limit: 100
  }
});

// Only use sitemap, skip crawling
const result = await client.post('/v1/tools/web_map', {
  body: {
    url: 'https://example.com',
    sitemap: 'only',
    limit: 100
  }
});
ModeBehavior
includeUse sitemap + crawl (default)
excludeOnly crawl, ignore sitemap
onlyOnly use sitemap

Include subdomains

Map across subdomains:

const result = await client.post('/v1/tools/web_map', {
  body: {
    url: 'https://example.com',
    include_subdomains: true,
    limit: 500
  }
});

// Includes blog.example.com, docs.example.com, etc.

Common workflows

Bulk scraping

Discover pages first, then scrape each one:

// Step 1: Map the site
const map = await client.post('/v1/tools/web_map', {
  body: {
    url: 'https://docs.example.com',
    limit: 50
  }
});

// Step 2: Scrape each page
const pages = await Promise.all(
  map.links.map(link =>
    client.post('/v1/tools/web_scrape', {
      body: {
        url: link.url,
        formats: ['markdown'],
        only_main_content: true
      }
    })
  )
);

Documentation indexing

Build a search index from all docs pages:

const map = await client.post('/v1/tools/web_map', {
  body: {
    url: 'https://docs.example.com',
    search: 'docs',
    limit: 200
  }
});

for (const link of map.links) {
  const page = await client.post('/v1/tools/web_scrape', {
    body: { url: link.url, formats: ['markdown'] }
  });

  await indexDocument({
    url: link.url,
    content: page.data.markdown
  });
}

Site audit

Check how many pages exist:

const map = await client.post('/v1/tools/web_map', {
  body: {
    url: 'https://example.com',
    limit: 5000
  }
});

console.log(`Found ${map.links.length} pages`);

API Reference

For complete parameter documentation, see the API Reference.