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

# Capture a screenshot

> Render a public page and return a viewport JPEG.

Capture a public web page as a 1280 × 800 JPEG. Successful captures cost **5 credits**; failed captures are not charged.

The response contains image bytes rather than JSON. Save the response to a file or read it as a binary buffer. See the [screenshot guide](/guides/screenshots) for examples.


## OpenAPI

````yaml POST /v1/api/screenshot
openapi: 3.1.0
info:
  title: PagePith API
  version: 0.1.0
  description: >-
    One content API for web pages, PDFs, video transcripts, brand profiles,
    screenshots, and monitoring. Authenticate with your API key as a Bearer
    token. Credits are charged for successful results.
servers:
  - url: https://api.pagepith.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Scrape
    description: Fetch and convert web pages
  - name: Brand
    description: Extract company and visual-brand profiles
  - name: Video
    description: Transcribe public YouTube, Instagram, and TikTok videos
  - name: Monitoring
    description: Watch public pages for content changes
  - name: Blog
    description: Read published PagePith engineering articles
  - name: Screenshot
    description: Capture rendered public pages as JPEG images
paths:
  /v1/api/screenshot:
    post:
      tags:
        - Screenshot
      summary: Capture a website screenshot
      description: >-
        Capture a browser-rendered 1280 × 800 viewport as a JPEG. Costs 5
        credits per successful response. Failures are not charged. Supports
        public HTTP(S) pages; private network URLs are rejected.
      operationId: captureScreenshot
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScreenshotRequest'
            example:
              url: https://example.com
      responses:
        '200':
          description: Viewport JPEG image.
          headers:
            X-Final-Url:
              description: Final URL after redirects.
              schema:
                type: string
                format: uri
          content:
            image/jpeg:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: Insufficient credits for the 5-credit capture.
        '422':
          description: >-
            Upstream page returned an error status or no screenshot was
            produced.
        '502':
          description: Browser capture failed.
components:
  schemas:
    ScreenshotRequest:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          description: Public HTTP(S) page to capture.
  responses:
    InvalidRequest:
      description: The request body failed validation.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                enum:
                  - invalid_request
              details:
                type: object
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                enum:
                  - unauthorized
              message:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key as a Bearer token: `Authorization: Bearer <api-key>`.'

````

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