> ## Documentation Index
> Fetch the complete documentation index at: https://notte-experiment-visibility-md-links.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get started in a few seconds

How do you want to get started?

<CardGroup cols={3}>
  <Card title="Browser Session" icon="tv" href="#browser-session">
    Connect to a cloud browser via CDP
  </Card>

  <Card title="Web Agent" icon="microchip-ai" href="#web-agent">
    Run an AI agent on the browser
  </Card>

  <Card title="Scraping" icon="database" href="#scraping">
    Extract structured data from a page
  </Card>
</CardGroup>

***

## Prerequisites

Before you start, you'll need an API key and a local environment configured to use it.

<Steps>
  <Step title="Get an API key">
    Create an account on the [Console](https://console.notte.cc) to get your API key.
  </Step>

  <Step title="Export your API key">
    <CodeGroup>
      ```bash Python / Node.js theme={null}
      export NOTTE_API_KEY=your_api_key_here
      ```

      ```python Python theme={null}
      from notte_sdk import NotteClient

      client = NotteClient()  # reads NOTTE_API_KEY automatically
      ```

      ```javascript JavaScript theme={null}
      import { NotteClient } from 'notte-sdk';

      const client = new NotteClient({
        apiKey: process.env.NOTTE_API_KEY,
      });
      ```
    </CodeGroup>
  </Step>

  <Step title="Install the SDK">
    <CodeGroup>
      ```bash Python (requires >= 3.11) theme={null}
      pip install notte-sdk playwright
      ```

      ```bash JavaScript (Node.js 18+) theme={null}
      npm install notte-sdk playwright-core
      ```
    </CodeGroup>
  </Step>
</Steps>

Both Python and JavaScript quickstarts below use the official Notte SDK. Start with Browser Session if you want the shortest path to a working integration.

***

## Browser Session

Create a cloud browser session and control it with Playwright over CDP.

<CodeGroup>
  ```python Python theme={null}
  from playwright.sync_api import sync_playwright
  from notte_sdk import NotteClient

  client = NotteClient()

  with client.Session(open_viewer=True) as session:
      cdp_url = session.cdp_url()

      with sync_playwright() as p:
          browser = p.chromium.connect_over_cdp(cdp_url)
          page = browser.contexts[0].pages[0]
          page.goto("https://www.google.com")
          page.screenshot(path="screenshot.png")
  ```

  ```javascript JavaScript theme={null}
  import { chromium } from 'playwright-core';
  import { NotteClient } from 'notte-sdk';

  const notte = new NotteClient({
    apiKey: process.env.NOTTE_API_KEY,
  });

  await notte.Session({ open_viewer: true }).use(async (session) => {
    const status = await session.status();
    const cdpUrl = status.cdp_url;

    if (!cdpUrl) {
      throw new Error('Session did not return a cdp_url');
    }

    const browser = await chromium.connectOverCDP(cdpUrl);

    try {
      const page = browser.contexts()[0].pages()[0];
      await page.goto('https://news.ycombinator.com');

      const topStories = await page.locator('.titleline > a').allInnerTexts();

      console.log('Top 5 Hacker News stories:');
      topStories.slice(0, 5).forEach((title, index) => {
        console.log(`${index + 1}. ${title}`);
      });
    } finally {
      await browser.close();
    }
  });
  ```
</CodeGroup>

<Card title="Learn more about Sessions" icon="arrow-right" href="/concepts/sessions.md">
  Proxies, anti-detection, captcha solving, and more.
</Card>

***

## Web Agent

Run an AI agent that browses and completes tasks autonomously.

<CodeGroup>
  ```python Python theme={null}
  from notte_sdk import NotteClient

  client = NotteClient()

  with client.Session(open_viewer=True) as session:
      agent = client.Agent(session=session, max_steps=5)

      response = agent.run(
          task="Browse on Notte docs and book a demo for me",
          url="https://docs.notte.cc"
      )
      print(response)
  ```

  ```javascript JavaScript theme={null}
  import { NotteClient } from 'notte-sdk';

  const client = new NotteClient({
    apiKey: process.env.NOTTE_API_KEY,
  });

  await client.Session({ open_viewer: true }).use(async (session) => {
    const agent = client.Agent({ session, max_steps: 5 });

    const response = await agent.run({
      task: 'Browse on Notte docs and book a demo for me',
      url: 'https://docs.notte.cc',
    });

    console.log(response);
  });
  ```
</CodeGroup>

<Card title="Learn more about Agents" icon="arrow-right" href="/concepts/agents.md">
  Models, reasoning, structured output, and more.
</Card>

***

## Scraping

Extract structured data from any page using AI.

<CodeGroup>
  ```python Python theme={null}
  from pydantic import BaseModel
  from notte_sdk import NotteClient

  class HackerNewsPost(BaseModel):
      title: str
      url: str
      points: int
      author: str

  class HackerNewsFeed(BaseModel):
      posts: list[HackerNewsPost]

  client = NotteClient()

  result = client.scrape(
      url="https://news.ycombinator.com",
      response_format=HackerNewsFeed,
      instructions="Extract the top 5 posts from the front page"
  )

  for i, post in enumerate(result.data.posts, 1):
      print(f"{i}. {post.points} - {post.title}")
  ```

  ```javascript JavaScript theme={null}
  import { z } from 'zod';
  import { NotteClient } from 'notte-sdk';

  const HackerNewsPost = z.object({
    title: z.string(),
    url: z.string(),
    points: z.number(),
    author: z.string(),
  });

  const HackerNewsFeed = z.object({
    posts: z.array(HackerNewsPost),
  });

  const notte = new NotteClient({
    apiKey: process.env.NOTTE_API_KEY,
  });

  const result = await notte.scrape('https://news.ycombinator.com', {
    instructions: 'Extract the top 5 posts from the front page',
    response_format: HackerNewsFeed,
  });

  result.posts.forEach((post, index) => {
    console.log(`${index + 1}. ${post.points} - ${post.title}`);
  });
  ```
</CodeGroup>

<Card title="Learn more about Scraping" icon="arrow-right" href="/concepts/scraping.md">
  Structured extraction, selectors, and more.
</Card>
