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

# Take screenshot

> Deprecated: use POST /devices/{deviceId}/screenshots. Captures the device screen and returns it as a PNG image. An optional hideOverlay query parameter excludes the accessibility overlay from the capture.

Deprecated: use `POST /devices/{deviceId}/screenshots` to capture a screenshot. Existing callers can continue using this endpoint and migrate in a follow-up.

The response body is the PNG image itself (`Content-Type: image/png`), not a JSON wrapper.

The accessibility overlay is the on-screen element-highlight layer controlled by the set overlay visibility endpoint. If you've enabled it, pass `hideOverlay=true` to capture a clean frame; on devices whose capture path sits below the overlay, the flag has no effect either way.

Pass `save=true` to also store the captured PNG as device media. If the device has an active recording owned by the device owner, the screenshot is saved into that recording and inherits its retention. Otherwise it is saved standalone for seven days. Without `save=true`, no screenshot is stored.

The PNG response is unchanged; `X-Screenshot-Saved` is `true` when both the object and its metadata were stored, and `false` if storage limits or a save failure prevented persistence. A failed save does not fail screenshot capture. The device screenshots endpoints list saved screenshots, open their images, and delete individual screenshots. Recording screenshots remain available through the existing list recording screenshots endpoint and are also deleted with the recording.


## OpenAPI

````yaml /api-reference/phones/state.yaml get /devices/{deviceId}/screenshot
openapi: 3.1.0
info:
  title: State
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /devices/{deviceId}/screenshot:
    get:
      tags:
        - State
      summary: Take screenshot
      description: >-
        Deprecated: use POST /devices/{deviceId}/screenshots. Captures the
        device screen and returns it as a PNG image. An optional hideOverlay
        query parameter excludes the accessibility overlay from the capture.
      operationId: take-screenshot
      parameters:
        - in: path
          name: deviceId
          required: true
          schema:
            type: string
        - in: header
          name: X-Device-Display-ID
          schema:
            default: 0
            format: int64
            minimum: 0
            type: integer
        - explode: false
          in: query
          name: hideOverlay
          schema:
            default: false
            type: boolean
        - description: >-
            Store the screenshot as device media: in the owner's active
            recording, or standalone for 7 days. Without save=true nothing is
            stored. The PNG response is unchanged; X-Screenshot-Saved reports
            whether it was stored.
          explode: false
          in: query
          name: save
          schema:
            default: false
            description: >-
              Store the screenshot as device media: in the owner's active
              recording, or standalone for 7 days. Without save=true nothing is
              stored. The PNG response is unchanged; X-Screenshot-Saved reports
              whether it was stored.
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                contentEncoding: base64
                type: string
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
            X-Screenshot-Saved:
              schema:
                description: >-
                  Set when save=true: "true" if the screenshot was stored,
                  otherwise "false".
                type: string
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      deprecated: true
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.devices.state.screenshot('deviceId');

            console.log(response);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.devices.state.screenshot(
                device_id="deviceId",
            )
            print(response)
components:
  schemas:
    ErrorModel:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://example.com/schemas/ErrorModel.json
          format: uri
          readOnly: true
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````

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