Skip to main content
POST
/
sessions
/
{session_id}
/
page
/
observe
python
from notte_sdk import NotteClient, actions

notte = NotteClient()
with notte.Session() as session:
    # Observe the state of a webpage

    _ = session.execute(
        actions.Goto(url="https://google.com/travel/flights")
    )
    obs = session.observe()
    print("Page Title:", obs.metadata.title)
    print(
        "Available Actions:\n",
        obs.space.description,
    )
    # # Example Output:
    # # Flight Search
    # * I1: Enter departure location
    # ...
{
  "metadata": {
    "title": "<string>",
    "url": "<string>",
    "viewport": {
      "scroll_x": 123,
      "scroll_y": 123,
      "viewport_width": 123,
      "viewport_height": 123,
      "total_width": 123,
      "total_height": 123
    },
    "tabs": [
      {
        "tab_id": 123,
        "title": "<string>",
        "url": "<string>"
      }
    ],
    "timestamp": "2023-11-07T05:31:56Z"
  },
  "screenshot": {
    "raw": "<string>",
    "bboxes": [
      {
        "x": 123,
        "y": 123,
        "width": 123,
        "height": 123,
        "scroll_x": 123,
        "scroll_y": 123,
        "viewport_width": 123,
        "viewport_height": 123,
        "iframe_offset_x": 0,
        "iframe_offset_y": 0,
        "notte_id": "<string>"
      }
    ],
    "last_action_id": "<string>"
  },
  "space": {
    "description": "<string>",
    "interaction_actions": [
      {
        "type": "click",
        "category": "Interaction Actions",
        "description": "Click on an element of the current page",
        "id": "",
        "selector": "<string>",
        "press_enter": true,
        "text_label": "<string>"
      }
    ],
    "actions": [
      {
        "value": {},
        "type": "form_fill",
        "category": "Special Browser Actions",
        "description": "Fill a form with multiple values. Important: If you detect a form requesting personal information, try to use this action at first, and otherwise use the regular fill action. CRITICAL: If this action fails once, use the regular form fill instead."
      }
    ],
    "browser_actions": [
      {
        "value": {},
        "type": "form_fill",
        "category": "Special Browser Actions",
        "description": "Fill a form with multiple values. Important: If you detect a form requesting personal information, try to use this action at first, and otherwise use the regular fill action. CRITICAL: If this action fails once, use the regular form fill instead."
      }
    ],
    "markdown": "<string>",
    "category": "homepage"
  },
  "session": {
    "session_id": "<string>",
    "timeout_minutes": 123,
    "created_at": "2023-11-07T05:31:56Z",
    "last_accessed_at": "2023-11-07T05:31:56Z",
    "status": "active",
    "closed_at": "2023-11-07T05:31:56Z",
    "duration": "<string>",
    "steps": [
      {}
    ],
    "error": "<string>",
    "credit_usage": 123,
    "proxies": false,
    "browser_type": "chromium",
    "use_file_storage": false,
    "network_request_bytes": 0,
    "network_response_bytes": 0
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

x-notte-request-origin
string | null
x-notte-sdk-version
string | null

Path Parameters

session_id
string
required

Body

application/json
min_nb_actions
integer | null

The minimum number of actions to list before stopping. If not provided, the listing will continue until the maximum number of actions is reached.

max_nb_actions
integer
default:100

The maximum number of actions to list after which the listing will stop. Used when min_nb_actions is not provided.

url
string | null

The URL to observe. If not provided, uses the current page URL.

instructions
string | null

Additional instructions to use for the observation.

perception_type
enum<string> | null

Whether to run with fast or deep perception

Available options:
fast,
deep

Response

Successful Response

metadata
SnapshotMetadata · object
required

Metadata of the current page, i.e url, page title, snapshot timestamp.

screenshot
Screenshot · object
required

Base64 encoded screenshot of the current page

space
ActionSpace · object
required

Available actions in the current state

session
SessionResponse · object
required

Browser session information