Pig LogoPig Docs
Piglet Reference

Routes

HTTP API routes exposed by the Piglet process

Piglet exposes a RESTful API that can be accessed directly or through the Python SDK.

Display API

  • GET /computer/display/screenshot

    • Returns body: image/png bytes
  • GET /computer/display/dimensions

    • Returns json body: { width: number, height: number }

Keyboard API

  • POST /computer/input/keyboard/type

    • Requires json body: { text: string }
  • POST /computer/input/keyboard/key

    • Requires json body: { text: string }

Mouse API

  • GET /computer/input/mouse/position

    • Returns json body: { x: number, y: number }
  • POST /computer/input/mouse/move

    • Requires json body: { x: number, y: number }
  • POST /computer/input/mouse/click

    • Requires json body: { x: number, y: number, button: "left"|"right", down: boolean }

On this page