Turn PyAutoGUI Code into Structured Actions with the Free Parse Endpoint
Writing automation with PyAutoGUI is fast, but raw clicks and moves are brittle. They break when a window moves or a button label changes. The /v1/parse endpoint is free. It takes pyautogui snippets and returns a structured action list you can feed into the Coasty computer use API. Use a single function call to turn script-like code into a sequence of precise actions.
How it works
POST https://coasty.ai/v1/parse sends a JSON body with a pyautogui_code field. The server returns actions, each with type, x, y, and other fields. You can inspect the response and then pass it directly to /v1/predict or /v1/sessions/{id}/predict. This endpoint is free, so you can experiment as much as needed. The output is a structured action list ready for a computer use agent.
#!/bin/bash
COASTY_API_KEY="${COASTY_API_KEY}"
PAYLOAD=$(cat <<EOF
{
"pyautogui_code": "pyautogui.moveTo(100, 200)
pyautogui.click()"
}
EOF
)
RESULT=$(curl -s -X POST https://coasty.ai/v1/parse \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d "$PAYLOAD")
echo "$RESULT"Real request and response fields
- ●POST /v1/parse accepts a JSON body with a pyautogui_code field containing the pyautogui snippet.
- ●The server returns JSON with an actions array where each object has type, x, y, and optional parameters.
- ●The endpoint is free. No credits are consumed.
- ●You can chain parse results into predict calls for the computer use API.
Parse raw pyautogui once, reuse the structured actions with the computer use API.
Where this beats brittle automation
Hardcoded coordinates break when windows resize or screens change resolution. A computer use agent reads the screen and acts based on visual context. The parse endpoint bridges the gap between quick pyautogui scripts and reliable, screen-aware automation. Use structured actions that describe intent, not pixel positions, and let the agent adapt to layout changes.
You now have a straightforward way to transform pyautogui code into structured actions without spending credits. Feed those actions into the computer use API to drive real desktops and browsers. Get your API key at https://coasty.ai/developers and start building resilient automation.