Skip to main content

Overview

Use Map when you need a list of URLs from a website before deciding what to scrape, crawl, or analyze. Map discovers links; it does not return page body content. For multi-page content extraction, use Crawl. For a single page, use Scraper or Extract.

Endpoint

POST /api/v2/map

Quickstart

import { LLMLayerClient } from 'llmlayer';

const client = new LLMLayerClient({
  apiKey: process.env.LLMLAYER_API_KEY,
});

const site = await client.map('https://www.ycombinator.com', {
  limit: 100,
  search: 'blog',
});

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

Request Parameters

ParameterTypeRequiredDefaultDescription
urlstringYes-Website URL to map
ignoreSitemapbooleanNofalseIgnore sitemap.xml discovery
includeSubdomainsbooleanNofalseInclude subdomains
searchstring | nullNonullFilter discovered URLs/titles by text
limitintegerNo5000Maximum links to return
timeoutinteger | nullNo45000Timeout in milliseconds
The raw API uses camelCase for map request fields: ignoreSitemap and includeSubdomains. The Python SDK maps these to ignore_sitemap and include_subdomains.

Response

{
  "links": [
    {
      "url": "https://www.ycombinator.com/blog",
      "title": "YC Blog"
    }
  ],
  "statusCode": 200,
  "cost": 0.002
}
FieldTypeDescription
linksarrayDiscovered links with url and title
statusCodeinteger200 on success
costnumber | nullCost in USD

Common Patterns

Map then crawl

Use Map to inspect the URL surface before crawling.
const site = await client.map('https://www.ycombinator.com', {
  limit: 50,
});

const blogPages = site.links.filter((link) => link.url.includes('/blog'));
console.log(blogPages.map((link) => link.url));

Map then scrape selected pages

site = client.map("https://www.ycombinator.com", search="blog", limit=20)

for link in site.links[:3]:
    page = client.scrape(str(link.url), formats=["markdown"], main_content_only=True)
    print(page.title, page.markdown[:200] if page.markdown else "")

Pricing

Map costs $0.002 per request.

Errors

StatusMeaning
400Invalid URL or request parameters
401Missing or invalid LLMLayer API key
403Blocked private/unsafe target
500Mapping provider or internal error
See Errors & Refunds for the shared error format.

More Examples

Search + Scrape Pipeline

Find and process selected pages.

Crawl API

Stream markdown from multiple pages.