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

# Map

> Scrape the list of pages on a website.

Best for finding the right page on a site before reading it with scrape.

> [!NOTE]
>
> Works without an API key within the free limits. See [Rate limits](https://docs.stophy.dev/production/rate-limits.md).

```bash cURL theme={null}
curl -X POST https://api.stophy.dev/v1/map \
  -H "Authorization: Bearer $STOPHY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://bun.com","search":"sqlite"}'
```

```json 200 theme={null}
{
  "success": true,
  "links": [
    {
      "url": "https://bun.com/reference/node/sqlite/constants/SQLITE_ANALYZE"
    }
  ]
}
```


## OpenAPI

````yaml api-reference/openapi.json POST /v1/map
openapi: 3.1.0
info:
  title: Stophy API
  version: '1'
  description: >-
    Each operation shows its method and its input: a JSON object body, path and
    query parameters, or a file upload.


    Responses leave out empty values: null, empty strings, empty objects and
    empty nested lists are not sent.


    Text comes back whole. To get shorter responses, add
    ?maxTextLength=<characters> to the URL. Every text value longer than that is
    cut and ends with …. A screenshot is never cut, and a page whose text was
    cut has isTruncated set to true.


    The x-cost-usd response header is what the request cost in dollars. An
    operation's description gives its pricing units and add-ons. The OpenAPI
    fields x-cost-usd and x-cost-usd-max are list-price estimates, not receipts
    or spending limits. When a call starts a job, check the job result for its
    total cost.


    When a response has a cursor, send it back unchanged with the same input to
    get the next page. When it has a page, send the next page number.
servers:
  - url: https://api.stophy.dev
security:
  - apiKey: []
paths:
  /v1/map:
    post:
      summary: Scrape the list of pages on a website
      description: Costs $0.50 per 1,000 calls.
      operationId: map
      parameters:
        - $ref: '#/components/parameters/MaxTextLength'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  description: Any page of the site to map, such as https://bun.com.
                  type: string
                search:
                  description: >-
                    Keep only addresses that mention these words, best matches
                    first, such as pricing.
                  type: string
                  minLength: 1
                sitemap:
                  default: include
                  description: >-
                    include uses the site's sitemaps and its pages. only lists
                    just what the sitemaps name. skip ignores the sitemaps.
                  type: string
                  enum:
                    - skip
                    - include
                    - only
                includeSubdomains:
                  default: true
                  description: >-
                    Also list pages on subdomains, such as docs.bun.com for
                    bun.com.
                  type: boolean
                ignoreQueryParameters:
                  default: true
                  description: List each page once, without its ?query part.
                  type: boolean
                deduplicateSimilarURLs:
                  description: >-
                    Send false to list distinct addresses such as /docs/a,
                    /docs/a/ and /docs/a.md.
                  type: boolean
                ignoreCache:
                  default: false
                  description: >-
                    Send true to build the list again instead of reusing one
                    made in the last 6 hours.
                  type: boolean
                limit:
                  default: 5000
                  description: The most addresses to return, up to 100000.
                  type: integer
                  minimum: 1
                  maximum: 100000
                timeout:
                  description: >-
                    Stop looking after this many milliseconds and return what
                    was found.
                  type: integer
                  minimum: 1000
                  maximum: 9007199254740991
                location:
                  description: >-
                    Where to read the page from. The default is the United
                    States.
                  type: object
                  properties:
                    country:
                      description: >-
                        Two-letter country code to read the page from, such as
                        DE or JP.
                      type: string
                    languages:
                      description: >-
                        Languages to ask the site for, best first, such as
                        ["de", "en"]. Sent as Accept-Language. A read with
                        languages is never answered from or saved to a stored
                        copy.
                      minItems: 1
                      maxItems: 5
                      type: array
                      items:
                        type: string
                        pattern: ^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$
                  additionalProperties: false
              required:
                - url
              additionalProperties: false
            example:
              url: https://bun.com
              search: sqlite
      responses:
        '200':
          description: The data, and what this call cost in dollars.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
            x-credits-used:
              $ref: '#/components/headers/CreditsUsed'
            x-cost-usd:
              $ref: '#/components/headers/CostUsd'
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            x-cache:
              $ref: '#/components/headers/Cache'
            x-cache-age:
              $ref: '#/components/headers/CacheAge'
            idempotent-replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  success:
                    type: boolean
                    const: true
                  links:
                    type: array
                    items:
                      type: object
                      additionalProperties: false
                      properties:
                        url:
                          type: string
                        title:
                          type: string
                        description:
                          type: string
                      required: []
                required:
                  - success
                  - links
        4XX:
          $ref: '#/components/responses/Error'
        5XX:
          $ref: '#/components/responses/Error'
      security:
        - apiKey: []
components:
  parameters:
    MaxTextLength:
      name: maxTextLength
      in: query
      required: false
      description: >-
        Cut every text value in the response to this many characters. A value
        that was cut ends with …, and a page whose text was cut has isTruncated
        set to true. A screenshot is never cut. Leave it out to get the full
        text.
      schema:
        type: integer
        minimum: 1
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        A value you choose for one call. Send the same key with the same method,
        path and body within 24 hours and the first answer comes back with
        idempotent-replayed: true, with the same cost headers and no second
        charge. A call that sends zeroDataRetention and answers with page data
        is not kept, so a retry runs again. Needs an API key.
      schema:
        type: string
  headers:
    RequestId:
      description: The request id. Quote it when you report a problem.
      schema:
        type: string
    CreditsUsed:
      description: >-
        Older header: what this call cost, as whole steps of $0.002. Use
        x-cost-usd.
      schema:
        type: integer
    CostUsd:
      description: What this call cost, in dollars.
      schema:
        type: string
    RateLimitLimit:
      description: Requests allowed in the current window.
      schema:
        type: integer
    RateLimitRemaining:
      description: Requests left in the current window.
      schema:
        type: integer
    RateLimitReset:
      description: Unix time in seconds when the current window resets.
      schema:
        type: integer
    Cache:
      description: hit if this result came from the cache, miss if it was fetched live.
      schema:
        type: string
    CacheAge:
      description: Seconds since the returned result was written to the cache.
      schema:
        type: integer
    IdempotentReplayed:
      description: >-
        true when this call reuses the result of an earlier call with the same
        Idempotency-Key.
      schema:
        type: string
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  responses:
    Error:
      description: The request failed. Retry-After says when trying again can help.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - success
        - error
        - code
      properties:
        success:
          const: false
        error:
          type: string
          description: What went wrong and what to do next.
        code:
          type: string
          enum:
            - apiKeyRequired
            - busy
            - checkRunning
            - cliSessionCompleted
            - cliSessionExists
            - cliSessionNotFound
            - forbidden
            - freeLimit
            - insufficientCredits
            - internalError
            - inviteClaimed
            - inviteDisabled
            - inviteExpired
            - inviteUsedUp
            - invalidCliSession
            - invalidCliVerifier
            - invalidRequest
            - jobFinished
            - methodNotAllowed
            - notFound
            - payloadTooLarge
            - profileBusy
            - profileTooLarge
            - prohibitedPermission
            - promptInjectionDetected
            - rateLimited
            - sourceChanged
            - sourceRefused
            - siteNotRead
            - sourceTimeout
            - sourceUnavailable
            - unauthorized
            - unsupportedMediaType
        retryable:
          type: boolean
          description: true when trying again can help.
        retryAfterSeconds:
          type: integer
        requestId:
          type: string
        requiredCredits:
          type: number
          description: >-
            Older field: the most the call can cost, in $0.002 steps. Sent when
            the balance is too low.
        availableCredits:
          type: number
          description: 'Older field: the balance in $0.002 steps. Sent with requiredCredits.'
        requiredUsd:
          type: number
          description: >-
            The most the call can cost, in dollars. Sent when the balance is too
            low.
        availableUsd:
          type: number
          description: What is left on the account, in dollars. Sent with requiredUsd.
        billingUrl:
          type: string
          description: Where to add money. Sent with requiredUsd.
        signupUrl:
          type: string
          const: https://stophy.dev/signup
          description: >-
            Where a person gets a key. Sent with apiKeyRequired, freeLimit and
            an invalid key.
        signup:
          type: string
          const: POST https://api.stophy.dev/v1/signup
          description: >-
            The call that gets an agent a key with no human. Sent next to
            signupUrl.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

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