Tutorial

Turn PyAutoGUI into Structured Actions with the Free Coasty Parse Endpoint

Marcus Sterling||5 min
+Enter

You have a working PyAutoGUI script that clicks buttons and types text, but it drifts when layouts shift or fonts change. You want to reuse that logic in a larger workflow or endpoint that drives real desktops. The Coasty Parse endpoint turns your raw PyAutoGUI code into structured actions, giving you portable, precise steps you can compose into workflows and pass to the computer use API.

How the endpoint works

The POST /v1/parse endpoint accepts a code string, a cua_version, and optional context. It returns a JSON object with an actions array. Each action contains type (click, type, scroll, etc.), x, y, text, and other fields defined by the computer use API. You can iterate these actions and replay them on any machine with the same layout, or embed them in a workflow with /v1/workflows.

bash
curl https://coasty.ai/v1/parse \ 
  -H 'X-API-Key: $COASTY_API_KEY' \ 
  -H 'Content-Type: application/json' \ 
  -d '{ 
    "code": "pyautogui.click(100, 200)\npyautogui.write("hello")\npyautogui.click(300, 400)\n", 
    "cua_version": "v3" 
  }'

What you get back

  • actions array is a list of structured steps
  • each action has type, x, y, text, and other fields
  • you can serialize the result to JSON for workflows and runs
  • the endpoint is free, no credits deducted
  • cua_version controls output shape and validation

Use /v1/parse to normalize your PyAutoGUI scripts into reusable structured actions for any computer use agent.

Where this beats brittle automation

Traditional automation relies on XPath, CSS selectors, or hardcoded coordinates. Those break when layouts change, fonts update, or the screen scales. Structured actions describe intent, click at coordinates, type text, scroll, rather than fragile selectors. The Coasty computer use API can drive real desktops, browsers, and terminals, perceiving the screen and acting like a human. Combine Parse results with /v1/predict or /v1/runs to build agents that adapt to layout shifts and recover gracefully, not just fail on the next build.

Start by turning a single PyAutoGUI script into structured actions with /v1/parse, then compose those actions into workflows with /v1/workflows and deploy agents with /v1/runs. Get your API key at https://coasty.ai/developers to begin building resilient computer use agents.

Want to see this in action?

View Case Studies
Try Coasty Free