Explore the open-source repository https://github.com/nottelabs/notte and star us 🌟

Overview

The Notte Python SDK provides a comprehensive set of tools for interacting with the Notte API. This guide will walk you through the steps to install the SDK, configure your API key, and start using the SDK to manage your browser sessions, web agents, and page interactions.

We strongly recommend using the Python SDK for all your automation needs. It is the most efficient way to interact with the Notte API.

Quickstart

1

Install the latest version of the SDK (requires `python >= 3.11`)

pip install --upgrade notte-sdk
2

Configure your API key as an environment variable

You can request a free key directly from our console

export NOTTE_API_KEY=<your-api-key>
3

Run your first agent

import os
from notte_sdk import NotteClient

notte = NotteClient(api_key=os.getenv("NOTTE_API_KEY"))
response = notte.agents.run(
    task="Find the latest job openings on notte.cc", 
    max_step=5
)

Explore what the Notte Python SDK can do for you

The SDK provides a comprehensive set of tools for interacting with the Notte API.

Learn more about web agents in the web agents guide.

Run a Web Agent

from notte_sdk import NotteClient

notte = NotteClient()
agent = notte.Agent()
response = agent.run(task="Find the best italian restaurant in SF and book a table for 2 at 7pm today")
status = agent.status()

you can also get more control over the session and agent lifecycle by running an agent in a session explicitly:

session_control.py
with notte.Session(proxies=True) as session:  
	_ = notte.agents.run(
		task="<YOUR_TASK_PROMPT>",
		session_id=session.session_id
	)
	...

How to get visual insights about your sessions & agents

At any time during the execution of a session or an agent, you can retrieve a replay of the execution so far as a WebP image.

from notte_sdk import NotteClient

notte = NotteClient()
# Get the replay of the session so far
replay = notte.sessions.replay(session_id="<your-session-id>")
# Or the agent's execution
replay = notte.agents.replay(agent_id="<your-agent-id>")

# Save the replay to a file
replay.save("replay.webp")
# Uncomment to display the replay in a Jupyter notebook
# replay.display()