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.

arrow-up-right1. 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
}

arrow-up-right2. 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.

arrow-up-right3. Step in and take an action

eg. we want to start our journey from Zurich.

Response:

arrow-up-right4. Step in one more time

and want to go to San Francisco.

Response: Same as above.

arrow-up-right5. Close the session

arrow-up-right

Last updated