Tutorial

Turn PyAutoGUI into Structured Actions with the Free Coasty Parse Endpoint

Priya Patel||5 min
+Z

You have a PyAutoGUI script that clicks buttons, types text, and scrolls. It works locally, but when you move it to a cloud VM or a headless browser, the selectors break. You need a way to describe your automation in a form that a computer use agent can reliably execute. The Coasty Parse endpoint does exactly that without charging per request.

How it works

The parse endpoint accepts a PyAutoGUI-style code snippet that uses pyautogui functions. It returns a structured list of actions that your agent can replay. The request requires your API key and the code as text. The response is JSON with a parsed_actions array, each action containing a type and coordinates. No credits are deducted for this free endpoint, making it ideal for prototyping.

bash
curl -X POST https://coasty.ai/v1/parse \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "pyautogui_code": "pyautogui.moveTo(100, 200)\npyautogui.click()\npyautogui.moveTo(150, 250)\npyautogui.doubleClick()"
  }'

Request and response fields

  • pyautogui_code: a multiline string containing pyautogui calls.
  • X-API-Key header required (read from COASTY_API_KEY environment variable).
  • Response includes parsed_actions: an array of structured actions.
  • Each action has type (e.g., move_to, click, double_click) and x, y coordinates.
  • No billing is applied for this endpoint.

Use the free /v1/parse endpoint to compile your PyAutoGUI scripts into structured actions that your computer use agent can follow.

Where this beats brittle automation

Traditional automation relies on CSS selectors, XPath, or hardcoded IDs. When a UI updates or the DOM structure changes, the script fails. A computer use agent uses vision to see the screen, locate elements by description, and click or type at the correct coordinates. By converting your PyAutoGUI patterns into structured actions, you give the agent a clear plan that it can adapt to layout changes while still preserving your original intent.

Start turning your PyAutoGUI scripts into structured actions with the free parse endpoint. Once you have a working set of actions, feed them into a task run or a workflow to let the agent execute on a real VM. Get your API key at https://coasty.ai/developers and build automation that behaves like a human.

Want to see this in action?

View Case Studies
Try Coasty Free