Automating Form Filling and Checkout Flows Over the Computer Use API
E-commerce checkout forms change layouts, labels, and validation rules weekly. Traditional automation using selectors or APIs breaks when a site updates its markup. A computer use API that can see the screen and act like a human solves this by navigating real elements, handling dynamic validation, and adapting to variations. This tutorial shows how to automate a form filling and checkout flow with the Coasty Computer Use API.
How it works
The Coasty Computer Use API operates as a computer use agent that drives a real desktop environment. You send a task with a machine ID, instructions, and configuration. The agent sees screenshots, decides actions, and executes them. For stateful workflows, you can use sessions to preserve memory across steps. The API also provides ground truth mapping of elements to coordinates and a free parser to convert pyautogui code into structured actions.
curl -X POST https://coasty.ai/v1/runs \
-H 'X-API-Key: $COASTY_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"machine_id": "your-vm-id",
"task": "Navigate to https://example.com/cart, fill in email and password, click login, then proceed to checkout and place the order.",
"cua_version": "v3",
"max_steps": 50,
"deadline_seconds": 300,
"on_awaiting_human": "pause"
}'Key fields and configuration
- ●machine_id: The cloud VM provisioned via POST /v1/machines, which the agent drives.
- ●task: A natural language description of the form filling and checkout steps.
- ●cua_version: 'v3' for guided runs, 'v4' for autonomous runs with a pass/fail verifier.
- ●max_steps: The maximum number of agent steps (billed $0.05 per step).
- ●deadline_seconds: Time limit for the run.
- ●on_awaiting_human: How to handle interruptions like human approval ('pause', 'fail', or 'cancel').
- ●webhook_url: Optional URL to receive status updates and events.
A single POST /v1/runs call launches a computer use agent to complete the entire form filling and checkout flow.
Where this beats brittle automation
Traditional automation relies on fragile selectors that fail when a site changes its UI. A computer use API that sees the screen can locate elements by their visual appearance, adapt to dynamic labels, handle multiple languages, and react to runtime validation messages. It also works on applications without an API, such as desktop tools, and can simulate mouse clicks and key presses like a human, reducing the chance of detection and bans.
You can now build robust form filling and checkout bots that adapt to UI changes. Explore the Computer Use API further by provisioning a machine, defining tasks, and monitoring runs. Get a key at https://coasty.ai/developers to start automating your workflows.