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

# Render page as Markdown

> Renders a URL (or supplied HTML) and returns the page content as Markdown. Requires scope: browser:render



## OpenAPI

````yaml /api-specs/services.json post /browser/v1/markdown
openapi: 3.1.0
info:
  title: Voyant Cloud REST API
  version: 1.0.0
  description: >-
    Public REST API for Voyant Cloud products: Vault, SMS, Email, Verification,
    Video, Realtime, and Browser. All requests authenticate with an API token
    passed as an HTTP bearer token in the Authorization header. Each operation
    requires a specific token scope, documented in the operation description.
servers:
  - url: https://api.voyant.travel
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Vault
    description: >-
      Encrypted secret storage and envelope/per-call cryptography scoped to an
      organization vault.
  - name: SMS
    description: Send SMS messages and inspect message history and phone numbers.
  - name: Email
    description: Send transactional email and inspect message history.
  - name: Verification
    description: >-
      Start and check one-time-code verifications across SMS, call, email, and
      WhatsApp.
  - name: Video
    description: >-
      Upload, manage, caption, and watermark videos, and mint signed playback
      tokens.
  - name: Realtime
    description: >-
      Publish messages to realtime channels, inspect history and presence, and
      mint short-lived subscriber tokens.
  - name: Browser
    description: >-
      Headless browser rendering, scraping, structured extraction, crawling, and
      interactive sessions.
paths:
  /browser/v1/markdown:
    post:
      tags:
        - Browser
      summary: Render page as Markdown
      description: >-
        Renders a URL (or supplied HTML) and returns the page content as
        Markdown. Requires scope: browser:render
      operationId: browserMarkdown
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BrowserRenderInput'
      responses:
        '200':
          $ref: '#/components/responses/BrowserStringResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      x-codeSamples:
        - lang: typescript
          label: SDK
          source: >-
            import { createVoyantCloudClient } from "@voyant-travel/cloud-sdk";


            const cloud = createVoyantCloudClient({ apiKey:
            process.env.VOYANT_API_KEY });


            const markdown = await cloud.browser.markdown({
              "url": "https://example.com",
              "html": "<string>",
              "cookies": [
                {
                  "name": "<string>",
                  "value": "<string>",
                  "url": "<string>",
                  "domain": "<string>",
                  "path": "<string>",
                  "expires": 123,
                  "httpOnly": true,
                  "secure": true,
                  "sameSite": "Strict"
                }
              ],
              "viewport": {
                "width": 123,
                "height": 123,
                "deviceScaleFactor": 123,
                "isMobile": true,
                "hasTouch": true,
                "isLandscape": true
              },
              "userAgent": "<string>",
              "setExtraHTTPHeaders": {},
              "authenticate": {
                "username": "<string>",
                "password": "<string>"
              },
              "rejectResourceTypes": [
                "<string>"
              ],
              "rejectRequestPattern": [
                "<string>"
              ],
              "allowResourceTypes": [
                "<string>"
              ],
              "allowRequestPattern": [
                "<string>"
              ],
              "bestAttempt": true,
              "emulateMediaType": "screen",
              "gotoOptions": {
                "timeout": 123,
                "waitUntil": "load",
                "referer": "<string>"
              },
              "waitForSelector": {
                "selector": "<string>",
                "timeout": 123,
                "visible": true,
                "hidden": true
              },
              "waitForTimeout": 123
            });
        - lang: bash
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.voyant.travel/browser/v1/markdown \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
              "url": "https://example.com",
              "html": "<string>",
              "cookies": [
                {
                  "name": "<string>",
                  "value": "<string>",
                  "url": "<string>",
                  "domain": "<string>",
                  "path": "<string>",
                  "expires": 123,
                  "httpOnly": true,
                  "secure": true,
                  "sameSite": "Strict"
                }
              ],
              "viewport": {
                "width": 123,
                "height": 123,
                "deviceScaleFactor": 123,
                "isMobile": true,
                "hasTouch": true,
                "isLandscape": true
              },
              "userAgent": "<string>",
              "setExtraHTTPHeaders": {},
              "authenticate": {
                "username": "<string>",
                "password": "<string>"
              },
              "rejectResourceTypes": [
                "<string>"
              ],
              "rejectRequestPattern": [
                "<string>"
              ],
              "allowResourceTypes": [
                "<string>"
              ],
              "allowRequestPattern": [
                "<string>"
              ],
              "bestAttempt": true,
              "emulateMediaType": "screen",
              "gotoOptions": {
                "timeout": 123,
                "waitUntil": "load",
                "referer": "<string>"
              },
              "waitForSelector": {
                "selector": "<string>",
                "timeout": 123,
                "visible": true,
                "hidden": true
              },
              "waitForTimeout": 123
            }'
        - lang: javascript
          label: Node
          source: >-
            const response = await
            fetch("https://api.voyant.travel/browser/v1/markdown", {
              method: "POST",
              headers: {
                "Content-Type": "application/json",
                "Authorization": "Bearer <token>"
              },
              body: JSON.stringify({
                "url": "https://example.com",
                "html": "<string>",
                "cookies": [
                  {
                    "name": "<string>",
                    "value": "<string>",
                    "url": "<string>",
                    "domain": "<string>",
                    "path": "<string>",
                    "expires": 123,
                    "httpOnly": true,
                    "secure": true,
                    "sameSite": "Strict"
                  }
                ],
                "viewport": {
                  "width": 123,
                  "height": 123,
                  "deviceScaleFactor": 123,
                  "isMobile": true,
                  "hasTouch": true,
                  "isLandscape": true
                },
                "userAgent": "<string>",
                "setExtraHTTPHeaders": {},
                "authenticate": {
                  "username": "<string>",
                  "password": "<string>"
                },
                "rejectResourceTypes": [
                  "<string>"
                ],
                "rejectRequestPattern": [
                  "<string>"
                ],
                "allowResourceTypes": [
                  "<string>"
                ],
                "allowRequestPattern": [
                  "<string>"
                ],
                "bestAttempt": true,
                "emulateMediaType": "screen",
                "gotoOptions": {
                  "timeout": 123,
                  "waitUntil": "load",
                  "referer": "<string>"
                },
                "waitForSelector": {
                  "selector": "<string>",
                  "timeout": 123,
                  "visible": true,
                  "hidden": true
                },
                "waitForTimeout": 123
              }),
            });


            const data = await response.json();
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.post(
                "https://api.voyant.travel/browser/v1/markdown",
                headers={
                    "Authorization": "Bearer <token>"
                },
                json={
                    "url": "https://example.com",
                    "html": "<string>",
                    "cookies": [
                        {
                            "name": "<string>",
                            "value": "<string>",
                            "url": "<string>",
                            "domain": "<string>",
                            "path": "<string>",
                            "expires": 123,
                            "httpOnly": True,
                            "secure": True,
                            "sameSite": "Strict"
                        }
                    ],
                    "viewport": {
                        "width": 123,
                        "height": 123,
                        "deviceScaleFactor": 123,
                        "isMobile": True,
                        "hasTouch": True,
                        "isLandscape": True
                    },
                    "userAgent": "<string>",
                    "setExtraHTTPHeaders": {},
                    "authenticate": {
                        "username": "<string>",
                        "password": "<string>"
                    },
                    "rejectResourceTypes": [
                        "<string>"
                    ],
                    "rejectRequestPattern": [
                        "<string>"
                    ],
                    "allowResourceTypes": [
                        "<string>"
                    ],
                    "allowRequestPattern": [
                        "<string>"
                    ],
                    "bestAttempt": True,
                    "emulateMediaType": "screen",
                    "gotoOptions": {
                        "timeout": 123,
                        "waitUntil": "load",
                        "referer": "<string>"
                    },
                    "waitForSelector": {
                        "selector": "<string>",
                        "timeout": 123,
                        "visible": True,
                        "hidden": True
                    },
                    "waitForTimeout": 123
                }
            )

            data = response.json()
components:
  schemas:
    BrowserRenderInput:
      type: object
      description: >-
        Common fields accepted by every browser render endpoint. Forwarded to
        Cloudflare Browser Rendering, so additional CF-supported fields are also
        accepted. Provide exactly one of url or html.
      additionalProperties: true
      properties:
        url:
          type: string
          format: uri
          example: https://example.com
        html:
          type: string
        cookies:
          type: array
          items:
            $ref: '#/components/schemas/BrowserCookie'
        viewport:
          $ref: '#/components/schemas/BrowserViewport'
        userAgent:
          type: string
        setExtraHTTPHeaders:
          type: object
          additionalProperties:
            type: string
        authenticate:
          type: object
          required:
            - username
            - password
          properties:
            username:
              type: string
            password:
              type: string
        rejectResourceTypes:
          type: array
          items:
            type: string
        rejectRequestPattern:
          type: array
          items:
            type: string
        allowResourceTypes:
          type: array
          items:
            type: string
        allowRequestPattern:
          type: array
          items:
            type: string
        bestAttempt:
          type: boolean
        emulateMediaType:
          type: string
          enum:
            - screen
            - print
        gotoOptions:
          $ref: '#/components/schemas/BrowserGoToOptions'
        waitForSelector:
          $ref: '#/components/schemas/BrowserWaitForSelector'
        waitForTimeout:
          type: integer
    BrowserCookie:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
        value:
          type: string
        url:
          type: string
        domain:
          type: string
        path:
          type: string
        expires:
          type: number
        httpOnly:
          type: boolean
        secure:
          type: boolean
        sameSite:
          type: string
          enum:
            - Strict
            - Lax
            - None
    BrowserViewport:
      type: object
      required:
        - width
        - height
      properties:
        width:
          type: integer
        height:
          type: integer
        deviceScaleFactor:
          type: number
        isMobile:
          type: boolean
        hasTouch:
          type: boolean
        isLandscape:
          type: boolean
    BrowserGoToOptions:
      type: object
      properties:
        timeout:
          type: integer
        waitUntil:
          $ref: '#/components/schemas/BrowserWaitUntil'
        referer:
          type: string
    BrowserWaitForSelector:
      type: object
      required:
        - selector
      properties:
        selector:
          type: string
        timeout:
          type: integer
        visible:
          type: boolean
        hidden:
          type: boolean
    Error:
      type: object
      properties:
        error:
          type: string
    RateLimitError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        retryAfterMs:
          type: integer
          description: Milliseconds to wait before retrying.
    BrowserWaitUntil:
      type: string
      enum:
        - load
        - domcontentloaded
        - networkidle0
        - networkidle2
  responses:
    BrowserStringResult:
      description: Rendered string result
      content:
        text/plain:
          schema:
            type: string
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication is missing, invalid, revoked, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The API token does not include a scope required for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Rate limit exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
    ServerError:
      description: An unexpected error occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServiceUnavailable:
      description: >-
        A required dependency (for example the platform database) is not
        available.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Voyant Cloud API token, passed as `Authorization: Bearer <token>`. Each
        token carries a fixed set of scopes; an operation rejects tokens missing
        its required scope.

````