Navigation
Examples of how to use cros.one to navigate a webpage
Use Cros to navigate Google Flights and book a Zurich to San Francisco flight.
1. Start a Cros session
curl --location \
--request POST 'https://api.cros.one/session/start' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data '{
"keep_alive": true,
"session_timeout": 15,
"screenshot": false
}'Response:
{
"session_id": "2684782c-0b6a-4018-9dba-0de11f2e09d8",
"error": null
}2. Observe the page
curl --location \
--request POST 'https://api.cros.one/env/observe' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data '{
"session_id": "2684782c-0b6a-4018-9dba-0de11f2e09d8",
"url": "https://flights.google.com"
}'Response:
This contains everything you need to move on. Note: The above is cropped for brevity.
3. Step in and take an action
eg. we want to start our journey from Zurich.
Response:
4. Step in one more time
and want to go to San Francisco.
Response: Same as above.
5. Close the session
Last updated