Quick Start

Connect your AI Agent to the web in just 2 minutes

Welcome to Airtop! We’re thrilled to guide you through connecting your AI Agent to the web using our powerful cloud browsers. In this quick-start guide, we’ll walk you through:

  • Setting up your project
  • Creating a browser session
  • Navigating the web
  • Summarizing web pages using AI

By the end, you’ll have created your browser session and summarized the page contents in just a few minutes. Let’s get started!

1

Step 1

Let’s begin by installing the necessary packages. You’ll need the Airtop SDK to interact with our service.

$npm i -s @airtop/sdk
2

Step 2

Get an API key from the Airtop Developer Portal.

You can create a free account if you don’t already have one when you first log in.
3

Step 3

Open up your favorite code editor and create a new file called quickstart.js. Create a new Airtop client.

1import { AirtopClient } from '@airtop/sdk';
2
3const apiKey = 'YOUR_AIRTOP_API_KEY';
4const client = new AirtopClient({ apiKey });
4

Step 4

Create a new browser session.

1const session = await client.sessions.create();
5

Step 5

Create a new window, load a URL and get the window information.

1const window = await client.windows.create(session.data.id, { url: "https://www.airtop.ai" });
6

Step 6

Get the page content and summarize using AI.

1const contentSummary = await client.windows.pageQuery(session.data.id, window.data.windowId, {
2 prompt: 'Summarize the contents of the page in 1 short paragraph up to 170 characters.',
3});
4console.log(contentSummary.data.modelResponse);
5
6// Terminate the session when you're done
7await client.sessions.terminate(session.data.id);
7

Step 7

In your terminal, run the following command:

$node quickstart.js

Congratulations 🎉! You’ve just created your first browser session, navigated to the Airtop website and summarized the page contents using AI.

Built with