NotexAI
  • Quickstart
  • Python SDK
  • Authentication
  • Examples
    • Navigation
    • Scraping Flow
  • Browser Sessions
    • Session Management
    • Start Session
    • Close Session
    • Health
  • Browser Navigation
    • Observe Page
    • Step In Page
    • Scrape Data
Powered by GitBook
On this page
  1. Examples

Navigation

Examples of How to Use NotexAI to Navigate a Webpage

Use Case: Navigate Google Flights to Book a Zurich to San Francisco Flight


1. Start a NotexAI Session

Initiate a new session with NotexAI:

curl --location \
--request POST 'https://api.notexai.pro/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

Analyze the current state of the target webpage:

curl --location \
--request POST 'https://api.notexai.pro/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...",
    "actions": [
      {
        "id": "I3",
        "description": "Enters the origin city or airport for a flight",
        "params": [
          {
            "name": "origin",
            "type": "str"
          }
        ]
      },
      {
        "id": "I4",
        "description": "Enters the destination city or airport for a flight",
        "params": [
          {
            "name": "destination",
            "type": "str"
          }
        ]
      }
      // Additional actions available on the page...
    ]
  }
}

3. Take Action: Enter Origin City (Zurich)

Perform an action on the observed page:

curl --location \
--request POST 'https://api.notexai.pro/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",
  "data": "..."
}

4. Take Action: Enter Destination City (San Francisco)

Perform another action to specify the destination:

curl --location \
--request POST 'https://api.notexai.pro/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

End the session after completing the actions:

curl --location \
--request POST 'https://api.notexai.pro/session/close' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data '{
  "session_id": "2684782c-0b6a-4018-9dba-0de11f2e09d8"
}'

Response:

{
  "session_id": "2684782c-0b6a-4018-9dba-0de11f2e09d8",
  "error": null
}
PreviousAuthenticationNextScraping Flow

Last updated 4 months ago