Examples
Navigation
Examples
Navigation
Examples of how to use Notte to navigate a webpage
Use Notte to navigate Google Flights and book a Zurich to San Francisco flight.
1. Start a Notte session
curl --location \
--request POST 'https://api.notte.cc/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.notte.cc/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:
{
"session_id": "2684782c-0b6a-4018-9dba-0de11f2e09d8",
"error": null,
"title": "Google Flights - Find Cheap Flight Options & Track Prices",
"url": "https://www.google.com/travel/flights",
"timestamp": "2025-01-07T22:07:16.036160",
"screenshot": null,
"space": {
"description": "This is Google Flights webpage interface, focused on searching and comparing flights, including filters and more specific functionalities to improve user experience. The main content consists of various sections such as Navigation, Flight Search and multiple subcategories, Help & Support, Discovery & Exploration and others. \nUsers can find cheap flights and compare prices between different destinations and dates.",
"actions": [
{
"id": "I1",
"description": "Selects trip type (round-trip, one-way, or multi-city)",
"category": "Flight Search",
"params": [
{
"name": "tripType",
"type": "str",
"default": "round-trip",
"values": [
"round-trip",
"one-way",
"multi-city"
]
},
{
"id": "B6",
"description": "Changes the number of passengers for a flight",
"category": "Flight Search"
},
{
"id": "I2",
"description": "Selects the seating class for a flight (economy, premium-economy, business, or first)",
"category": "Flight Search",
"params": [
{
"name": "seatingClass",
"type": "str",
"default": "economy",
"values": [
"economy",
"premium-economy",
"business",
"first"
]
}
]
},
{
"id": "I3",
"description": "Enters the origin city or airport for a flight",
"category": "Flight Search",
"params": [
{
"name": "origin",
"type": "str"
}
]
},
{
"id": "B7",
"description": "Swaps the origin and destination cities or airports",
"category": "Flight Search"
},
{
"id": "I4",
"description": "Enters the destination city or airport for a flight",
"category": "Flight Search",
"params": [
{
"name": "destination",
"type": "str"
}
]
},
{
"id": "I5",
"description": "Enters the departure date for a flight",
"category": "Flight Search",
"params": [
{
"name": "departure",
"type": "date"
}
]
},
{
"id": "I6",
"description": "Enters the return date for a flight",
"category": "Flight Search",
"params": [
{
"name": "return",
"type": "date"
}
]
},
{
"id": "B18",
"description": "Finds the cheapest days to fly using the Date grid and Price graph",
"category": "Tools"
}
]
}
]
}
}
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.
curl --location \
--request POST 'https://api.notte.cc/env/step' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data '{
"session_id": "2684782c-0b6a-4018-9dba-0de11f2e09d8",
"action_id": "I3",
"value": "Zurich"
}'
Response:
{
"session_id": "2684782c-0b6a-4018-9dba-0de11f2e09d8",
"error": null,
"title": "Google Flights - Find Cheap Flight Options & Track Prices",
"url": "https://www.google.com/travel/flights",
"timestamp": "2025-01-07T22:07:16.036160",
"screenshot": null,
"data": "..."
}
4. Step in one more time
and want to go to San Francisco.
curl --location \
--request POST 'https://api.notte.cc/env/step' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data '{
"session_id": "2684782c-0b6a-4018-9dba-0de11f2e09d8",
"action_id": "I4",
"value": "San Francisco"
}'
Response: Same as above.
5. Close the session
curl --location \
--request POST 'https://api.notte.cc/session/close' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data '{
"session_id": "2684782c-0b6a-4018-9dba-0de11f2e09d8"
}'