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

# GET /map

> List every URL a site exposes, from its sitemaps and on-page links. 1 credit.

Returns a site's URLs, most useful first, without fetching the pages.

**1 credit.** Failed requests are never charged.

> [card] [Guide: Map a site](https://docs.prefetch.io/web-data/map.md)
>
> Ordering, search, sources, scope and examples.


## OpenAPI

````yaml GET /map
openapi: 3.1.0
info:
  title: Prefetch API
  description: >-
    Extract brand identity, company data, screenshots, IAB classifications, and
    clean page content from any URL.
  version: 1.0.0
  contact:
    email: support@prefetch.io
servers:
  - url: https://api.prefetch.io
    description: Production
security:
  - apiKey: []
tags:
  - name: Endpoints
    description: Data extraction endpoints. All require authentication and consume credits.
  - name: Health
    description: Health and readiness probes. No authentication required.
paths:
  /map:
    get:
      tags:
        - Endpoints
      summary: Map a site's URLs
      description: >-
        Discovers the URLs a site exposes without fetching them: its sitemaps,
        found through `robots.txt` and the conventional locations, merged with
        the links on the page itself. **Credit cost: 1.**
      operationId: mapSite
      parameters:
        - $ref: '#/components/parameters/url'
        - $ref: '#/components/parameters/mapLimit'
        - $ref: '#/components/parameters/mapSearch'
        - $ref: '#/components/parameters/mapSitemap'
        - $ref: '#/components/parameters/mapIncludeSubdomains'
        - $ref: '#/components/parameters/mapIgnoreQueryParams'
      responses:
        '200':
          description: Links discovered.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    $ref: '#/components/schemas/MapData'
                  meta:
                    $ref: '#/components/schemas/Meta'
                required:
                  - success
                  - data
                  - meta
              example:
                success: true
                data:
                  url: https://stripe.com
                  domain: stripe.com
                  links:
                    - url: https://stripe.com/pricing
                      title: Pricing
                      description: null
                      lastmod: '2026-07-02'
                      source: sitemap
                    - url: https://stripe.com/enterprise/pricing
                      title: null
                      description: null
                      lastmod: null
                      source: sitemap
                  count: 2
                  total_discovered: 2
                  sources:
                    sitemap: 2
                    links: 0
                  sitemaps_used:
                    - https://stripe.com/sitemap/sitemap.xml
                meta:
                  requestId: b4e3d2c1-8a7b-4c3d-9e2f-1a3b5c7d9e1f
                  durationMs: 1830
        '400':
          description: Invalid or missing parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Revoked key, expired key, credit limit, or blocklisted URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: The URL hostname could not be resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service temporarily busy. Retry shortly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Request timed out.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    url:
      name: url
      in: query
      required: true
      description: >-
        The website URL to process. `https://` is prepended automatically if no
        protocol is provided.
      schema:
        type: string
        example: https://stripe.com
    mapLimit:
      name: limit
      in: query
      required: false
      description: Maximum number of links to return.
      schema:
        type: integer
        minimum: 1
        maximum: 5000
        default: 1000
    mapSearch:
      name: search
      in: query
      required: false
      description: >-
        Rank and filter results by relevance to this query. Links that match
        nothing are dropped.
      schema:
        type: string
        example: pricing
    mapSitemap:
      name: sitemap
      in: query
      required: false
      description: >-
        Which sources to use. `include` merges sitemap entries with on-page
        links, `skip` uses on-page links only, `only` uses sitemaps only.
      schema:
        type: string
        enum:
          - include
          - skip
          - only
        default: include
    mapIncludeSubdomains:
      name: include_subdomains
      in: query
      required: false
      description: Include links on subdomains of the target.
      schema:
        type: boolean
        default: true
    mapIgnoreQueryParams:
      name: ignore_query_params
      in: query
      required: false
      description: Treat URLs that differ only by query string as one page.
      schema:
        type: boolean
        default: true
  schemas:
    MapData:
      type: object
      properties:
        url:
          type: string
        domain:
          type: string
          nullable: true
        links:
          type: array
          items:
            $ref: '#/components/schemas/MapLinkItem'
        count:
          type: integer
        total_discovered:
          type: integer
          description: Links found before `limit` was applied.
        sources:
          type: object
          properties:
            sitemap:
              type: integer
            links:
              type: integer
        sitemaps_used:
          type: array
          items:
            type: string
    Meta:
      type: object
      properties:
        requestId:
          type: string
          format: uuid
          description: Unique identifier for this request.
          example: a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d
        durationMs:
          type: integer
          nullable: true
          description: Time taken to process the request in milliseconds.
          example: 1842
      required:
        - requestId
        - durationMs
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
          description: >-
            Always false. Absent, like `meta`, on authentication and rate-limit
            errors, which are answered before a request is processed.
        error:
          type: string
          description: >-
            Human-readable error message. The wording can change: branch on
            `error_code`.
          example: Credit limit exceeded
        error_code:
          type: string
          enum:
            - INVALID_REQUEST
            - PAYLOAD_TOO_LARGE
            - NOT_FOUND
            - CONFLICT
            - UNAUTHORIZED
            - FORBIDDEN
            - CREDITS_EXHAUSTED
            - RATE_LIMITED
            - CONCURRENCY_LIMITED
            - URL_BLOCKED
            - URL_NOT_PERMITTED
            - DNS_RESOLUTION_FAILED
            - TARGET_BLOCKED
            - TARGET_CONNECTION_FAILED
            - TARGET_TIMEOUT
            - TARGET_SSL_ERROR
            - TARGET_SERVER_ERROR
            - TARGET_CLIENT_ERROR
            - TARGET_NOT_A_PAGE
            - NO_LINKS_FOUND
            - TARGET_UNLOADABLE
            - RESEARCH_INCONCLUSIVE
            - TIMEOUT
            - SERVICE_BUSY
            - SERVICE_UNAVAILABLE
            - INTERNAL_ERROR
          description: >-
            What went wrong, for machines. Stable: a code keeps its meaning once
            published. See [Error handling](/concepts/errors).
          example: CREDITS_EXHAUSTED
        retryable:
          type: boolean
          description: >-
            Whether the same request can succeed if sent again after a short
            wait (honour `Retry-After` when present). False for problems with
            the request or the target.
          example: false
        retryAfterSeconds:
          type: integer
          description: 'On `RATE_LIMITED`: seconds until a request will be accepted.'
        limit:
          type: integer
          description: >-
            On `CONCURRENCY_LIMITED`: how many requests this key may have in
            flight.
        meta:
          $ref: '#/components/schemas/Meta'
      required:
        - error
        - error_code
        - retryable
    MapLinkItem:
      type: object
      properties:
        url:
          type: string
        title:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        lastmod:
          type: string
          nullable: true
          description: From the sitemap, when the site publishes one.
        source:
          type: string
          enum:
            - sitemap
            - links
          description: Where the URL was discovered.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your Prefetch API key. Obtain one from the dashboard.

````

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