Primitives
Turn pyautogui code into structured actions
Parse
Parse, at a glance
Turn pyautogui code into structured actions
POST /v1/parseRequest map4 boundaries
- 01Codesupported pyautogui
- 02Parsestrict syntax tree
- 03Enforceaction policy
- 04Emitstructured actions
Parse converts a block of pyautogui code into the same structured action objects the model returns. It is deterministic, runs no model, and is free. Use it to migrate existing automation scripts onto Coasty's executor, or to normalise hand-written steps into the canonical action schema. Add an optional action_policy beside code to validate those parsed actions before accepting them; a violation returns 422 ACTION_POLICY_VIOLATION.
import os, requests
res = requests.post(
"https://coasty.ai/v1/parse",
headers={"X-API-Key": os.environ["COASTY_API_KEY"]},
json={"code": "pyautogui.click(100, 200)\npyautogui.typewrite('hello')"},
timeout=30,
).json()
for action in res["actions"]:
print(action["action_type"], action["params"])