> ## 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 a site

> Quickly enumerate a site's URLs without scraping them. Returns synchronously and costs one credit.



## OpenAPI

````yaml https://api.hydrafetch.com/openapi.json post /v1/web/map
openapi: 3.0.0
info:
  title: Hydrafetch API
  description: >-
    Hydrafetch turns any URL into clean, LLM-ready data through one API.


    Give us a link and get back Markdown, the page's own structured data,
    extracted JSON, links, a

    summary, or a screenshot. Point us at a whole site and get every page. Ask a
    question and get

    answers with per-field confidence and the passage each value came from. You
    describe the outcome

    you want — the pipeline decides how to get it.


    ## Authentication


    Every request is authenticated with your API key in the `X-API-Key` header.
    Keys are scoped to a

    workspace and carry its credit balance.


    ## Credits


    Calls are billed in credits and charged only on success. A standard scrape
    is one credit; richer

    formats and the extraction tier cost more. Each response reports what it
    consumed.


    ## Conventions


    All timestamps are UTC ISO 8601. Long-running jobs (crawl, batch) return a
    job id you poll, or a

    webhook you register. Errors return a structured body with a stable `code`
    and an HTTP status.
  version: '1.0'
  contact:
    name: Hydrafetch
    url: https://hydrafetch.com
    email: team@hydrafetch.com
servers:
  - url: https://api.hydrafetch.com
    description: Production
security:
  - apiKey: []
tags:
  - name: Web Scraping
    description: >-
      Turn URLs into clean, LLM-ready content: scrape a single page, crawl or
      batch-scrape a whole site, map its URLs, search the web, and capture
      screenshots or images.
  - name: Web Extraction
    description: >-
      Pull schema-shaped JSON out of one or many pages, with optional per-field
      confidence and the source passage behind each value.
paths:
  /v1/web/map:
    post:
      tags:
        - Web Scraping
      summary: Map a site
      description: >-
        Quickly enumerate a site's URLs without scraping them. Returns
        synchronously and costs one credit.
      operationId: mapUrls
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MapRequestDto'
      responses:
        '200':
          description: The discovered URLs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MapResponseDto'
components:
  schemas:
    MapRequestDto:
      type: object
      properties:
        url:
          type: string
          example: https://example.com
          description: The site whose URLs you want to enumerate. Must be http(s).
        includeLinks:
          type: boolean
          example: true
          description: >-
            Also include same-site links found on the starting page, not just
            the site's page list.
        limit:
          type: number
          minimum: 1
          maximum: 5000
          example: 1000
          description: Maximum number of URLs to return.
        search:
          type: string
          maxLength: 200
          example: pricing
          description: Keep only discovered URLs containing this term.
        sitemap:
          type: string
          enum:
            - skip
            - include
            - only
          example: include
          description: >-
            Whether to use the site's published page list: skip it, include it
            alongside discovered links, or use it only.
        sitemapInclude:
          type: string
          maxLength: 200
          example: post
          description: >-
            On sitemap-index sites, only descend into sub-sitemaps whose URL
            contains one of these comma-separated terms (case-insensitive). E.g.
            "post" to target article sitemaps.
        sitemapExclude:
          type: string
          maxLength: 200
          example: tag,category,author
          description: >-
            Skip sub-sitemaps whose URL contains any of these comma-separated
            terms (case-insensitive). Compose with sitemapInclude — e.g. include
            "post" + exclude "tag,category,author" avoids WordPress taxonomy
            sitemaps (post_tag-sitemap, …-taxonomies-post_tag-*) that also
            contain "post".
        order:
          type: string
          enum:
            - newest
            - oldest
            - sitemap
          default: newest
          description: >-
            Sort order by sitemap lastmod. "newest" (default) returns the most
            recent URLs first — the wanted end of a large archive under the
            limit. URLs without a lastmod sort last.
        before:
          type: string
          example: '2024-06-01T00:00:00Z'
          description: >-
            Cursor for paging a large archive newest→oldest: return only URLs
            with lastmod at or before this ISO timestamp. Page by passing the
            oldest lastmod from the previous page; dedupe by url across pages.
        offset:
          type: number
          minimum: 0
          maximum: 100000
          example: 5000
          description: >-
            Skip the first N results (in the sorted order) then return the next
            `limit`. Pagination for sources with no lastmod (WordPress-core),
            where the date cursor can't apply. Page sequentially (0, limit,
            2·limit, …) so the sub-sitemap cache keeps deep pages fast.
        includeSubdomains:
          type: boolean
          example: false
          description: Also include URLs on subdomains of the site. Default off.
        ignoreQueryParameters:
          type: boolean
          example: false
          description: Treat URLs that differ only by query string as one. Default off.
      required:
        - url
    MapResponseDto:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/MapResultDto'
      required:
        - data
    MapResultDto:
      type: object
      properties:
        url:
          type: string
          example: https://example.com
          description: The site you requested.
        links:
          description: >-
            The site's discovered URLs, each with its sitemap lastmod (null when
            unknown).
          type: array
          items:
            $ref: '#/components/schemas/MapUrlEntryDto'
        count:
          type: number
          example: 2
          description: How many URLs were returned.
        total:
          type: number
          example: 9051
          description: >-
            Total URLs in the enumeration this page is a slice of. Page with
            `offset` until offset+count reaches this — do not infer the end from
            a short page.
        truncated:
          type: boolean
          example: false
          description: >-
            Whether enumeration hit its ceiling or time budget. When true,
            `total` is a floor rather than the real size of the site.
      required:
        - url
        - links
        - count
        - total
        - truncated
    MapUrlEntryDto:
      type: object
      properties:
        url:
          type: string
          example: https://example.com/blog/hello
        lastmod:
          type: object
          nullable: true
          example: '2026-05-01T12:00:00Z'
          description: >-
            The <lastmod> from the sitemap, if present. null for links found on
            the page.
      required:
        - url
        - lastmod
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key

````