Back to Blog
Tutorial

Emily Watson5 min
Home

Writing automation that clicks buttons, types text, and scrolls through UIs often starts with familiar pyautogui snippets. But raw pixel coordinates and hard-coded delays do not scale. You need a way to convert those steps into a structured list of actions your computer use agent can interpret reliably. The Coasty parse endpoint does exactly that. It accepts raw pyautogui code and returns a structured action payload you can feed directly into your workflow or task runs.

How it works

The parse endpoint is a lightweight API that takes a Python code snippet containing pyautogui functions and returns a JSON object with a structured actions array. The request body expects a string field code that contains the Python source. The response includes a top-level actions array where each element has type and parameters matching the underlying Coasty action model. This conversion lets you reuse existing scripts while giving your agent the context it needs to navigate real UIs dynamically.

bash
curl -X POST https://coasty.ai/v1/parse \
  -H 'Authorization: Bearer $COASTY_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "code": "import pyautogui\npyautogui.moveTo(500, 300, duration=1)\npyautogui.click()\npyautogui.typewrite("hello")"
  }'

What you get from parse

  • A JSON response with a top-level actions array
  • Each action has a type field such as 'move_to', 'click', 'type'
  • Parameters include coordinates, text, and duration when available
  • The payload is ready to be used as the steps array in a workflow or task run
  • No billing is incurred for this endpoint

Call POST /v1/parse with a Python code string to receive a structured actions array with zero cost.

Where this beats brittle automation

Pixel-based scripts break whenever a window resizes, a UI updates, or a layout shifts. Using parse lets you keep the intent in code while the agent uses real vision to locate elements dynamically. The structured actions act as a blueprint that your computer use agent can adapt to the current screen state, reducing flaky workflows and maintenance overhead.

Start building reliable desktop workflows by converting your existing pyautogui scripts into structured actions. Get your API key at https://coasty.ai/developers and start parsing and running tasks with the Coasty computer use API.

© 2026 Coasty

Backed byYCombinator