Skip to content

Latest commit

Β 

History

History
2842 lines (1939 loc) Β· 32.6 KB

reference.md

File metadata and controls

2842 lines (1939 loc) Β· 32.6 KB

Reference

Windows

client.windows.asyncCreateAutomation(sessionId, windowId, { ...params }) -> Airtop.AsyncSessionAiResponseEnvelope

πŸ“ Description

Create an automation of a browser window asynchronously

πŸ”Œ Usage

await client.windows.asyncCreateAutomation(
    "6aac6f73-bd89-4a76-ab32-5a6c422e8b0b",
    "0334da2a-91b0-42c5-6156-76a5eba87430",
);

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.AsyncCreateAutomationRequest

requestOptions: Windows.RequestOptions

client.windows.asyncCreateFormFiller(sessionId, windowId, { ...params }) -> Airtop.AsyncSessionAiResponseEnvelope

πŸ“ Description

Create a form filler automation asynchronously

πŸ”Œ Usage

await client.windows.asyncCreateFormFiller(
    "6aac6f73-bd89-4a76-ab32-5a6c422e8b0b",
    "0334da2a-91b0-42c5-6156-76a5eba87430",
);

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.AsyncCreateFormFillerRequest

requestOptions: Windows.RequestOptions

client.windows.asyncExecuteAutomation(sessionId, windowId, { ...params }) -> Airtop.AsyncSessionAiResponseEnvelope

πŸ“ Description

Execute an automation of a browser window asynchronously

πŸ”Œ Usage

await client.windows.asyncExecuteAutomation(
    "6aac6f73-bd89-4a76-ab32-5a6c422e8b0b",
    "0334da2a-91b0-42c5-6156-76a5eba87430",
    {
        automationId: "automationId",
    },
);

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.AsyncExecuteAutomationRequest

requestOptions: Windows.RequestOptions

client.windows.asyncFillForm(sessionId, windowId, { ...params }) -> Airtop.AsyncSessionAiResponseEnvelope

πŸ“ Description

Fill a form of a browser window asynchronously using a form-filler automation

πŸ”Œ Usage

await client.windows.asyncFillForm("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
    automationId: "automationId",
});

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.AsyncFillFormRequest

requestOptions: Windows.RequestOptions

client.windows.list(sessionId) -> Airtop.WindowsResponse

πŸ“ Description

Lists all browser windows in a session.

πŸ”Œ Usage

await client.windows.list("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b");

βš™οΈ Parameters

sessionId: string β€” ID of the session to list windows for.

requestOptions: Windows.RequestOptions

client.windows.create(sessionId, { ...params }) -> Airtop.WindowIdResponse

πŸ“ Description

Creates a new browser window in a session. Optionally, you can specify a url to load on the window upon creation.

πŸ”Œ Usage

await client.windows.create("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b");

βš™οΈ Parameters

sessionId: string β€” ID of the session that owns the window.

request: Airtop.CreateWindowInputV1Body

requestOptions: Windows.RequestOptions

client.windows.getWindowInfo(sessionId, windowId, { ...params }) -> Airtop.WindowResponse

πŸ“ Description

Get information about a browser window in a session, including the live view url.

πŸ”Œ Usage

await client.windows.getWindowInfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430", {
    screenResolution: "1280x720",
});

βš™οΈ Parameters

sessionId: string β€” ID of the session that owns the window.

windowId: string β€” ID of the browser window, which can either be a normal AirTop windowId or a CDP TargetId from a browser automation library like Puppeteer (typically associated with the page or main frame). Our SDKs will handle retrieving a TargetId for you from various popular browser automation libraries, but we also have details in our guides on how to do it manually.

request: Airtop.GetWindowInfoRequest

requestOptions: Windows.RequestOptions

client.windows.loadUrl(sessionId, windowId, { ...params }) -> Airtop.OperationOutcomeResponse

πŸ“ Description

Loads a specified url on a given window

πŸ”Œ Usage

await client.windows.loadUrl("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430", {
    url: "https://www.airtop.ai",
});

βš™οΈ Parameters

sessionId: string β€” ID of the session that owns the window.

windowId: string β€” Airtop window ID of the browser window.

request: Airtop.WindowLoadUrlV1Body

requestOptions: Windows.RequestOptions

client.windows.close(sessionId, windowId) -> Airtop.WindowIdResponse

πŸ“ Description

Closes a browser window in a session

πŸ”Œ Usage

await client.windows.close("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430");

βš™οΈ Parameters

sessionId: string β€” ID of the session that owns the window.

windowId: string β€” Airtop window ID of the browser window.

requestOptions: Windows.RequestOptions

client.windows.click(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ“ Description

Execute a click interaction in a specific browser window

πŸ”Œ Usage

await client.windows.click("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
    elementDescription: "The login button",
});

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.SessionClickHandlerRequestBody

requestOptions: Windows.RequestOptions

client.windows.createFormFiller(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ“ Description

Create a form-filler automation synchronously for the form loaded in the browser window

πŸ”Œ Usage

await client.windows.createFormFiller("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430");

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.CreateFormFillerRequest

requestOptions: Windows.RequestOptions

client.windows.fileInput(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ“ Description

Execute a file input interaction in a specific browser window. includeHiddenElements defaults to true and considers hidden file input elements. If there is only one file input element, it will be used directly. If there are multiple file input elements, the elementDescription will be used by AI to select among them. If no file input elements are found by inspecting the page structure, elementDescription will be used by AI to try to find a match visually.

πŸ”Œ Usage

await client.windows.fileInput("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430");

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.SessionFileInputHandlerRequestBody

requestOptions: Windows.RequestOptions

client.windows.fillForm(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ“ Description

Fill a form of a browser window synchronously using a form-filler automation

πŸ”Œ Usage

await client.windows.fillForm("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
    automationId: "automationId",
});

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.FillFormRequest

requestOptions: Windows.RequestOptions

client.windows.hover(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ“ Description

Execute a hover interaction in a specific browser window

πŸ”Œ Usage

await client.windows.hover("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
    elementDescription: "The search box input in the top right corner",
});

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.SessionHoverHandlerRequestBody

requestOptions: Windows.RequestOptions

client.windows.monitor(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ”Œ Usage

await client.windows.monitor("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
    condition: "Determine if the user appears to be signed in to the website",
});

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.SessionMonitorHandlerRequestBody

requestOptions: Windows.RequestOptions

client.windows.pageQuery(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ“ Description

Submit a prompt that queries the content of a specific browser window. You may extract content from the page, or ask a question about the page and allow the AI to answer it (ex. Is the user logged in?).

πŸ”Œ Usage

await client.windows.pageQuery("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
    prompt: "What is the main idea of this page?",
});

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.SessionPageQueryHandlerRequestBody

requestOptions: Windows.RequestOptions

client.windows.paginatedExtraction(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ“ Description

Submit a prompt that queries the content of a specific browser window and paginates through pages to return a list of results.

πŸ”Œ Usage

await client.windows.paginatedExtraction(
    "6aac6f73-bd89-4a76-ab32-5a6c422e8b0b",
    "0334da2a-91b0-42c5-6156-76a5eba87430",
    {
        prompt: "This site contains a list of results about <provide details about the list>. Navigate through 3 pages of results and return the title and <provide details about the data you want to extract> about each result in this list.",
    },
);

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.SessionPaginatedExtractionHandlerRequestBody

requestOptions: Windows.RequestOptions

client.windows.promptContent(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ“ Description

This endpoint is deprecated. Please use the pageQuery endpoint instead.

πŸ”Œ Usage

await client.windows.promptContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
    prompt: "What is the main idea of this page?",
});

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.SessionPageQueryHandlerRequestBody

requestOptions: Windows.RequestOptions

client.windows.scrapeContent(sessionId, windowId, { ...params }) -> Airtop.ScrapeResponse

πŸ“ Description

Scrape a window and return the content as markdown

πŸ”Œ Usage

await client.windows.scrapeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430");

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window to scrape.

request: Airtop.ScrapeContentRequest

requestOptions: Windows.RequestOptions

client.windows.screenshot(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ“ Description

Take a screenshot of a browser window

πŸ”Œ Usage

await client.windows.screenshot("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430");

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.SessionScreenshotHandlerRequestBody

requestOptions: Windows.RequestOptions

client.windows.scroll(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ“ Description

Execute a scroll interaction in a specific browser window

πŸ”Œ Usage

await client.windows.scroll("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430");

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.SessionScrollHandlerRequestBody

requestOptions: Windows.RequestOptions

client.windows.summarizeContent(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ“ Description

This endpoint is deprecated. Please use the pageQuery endpoint and ask for a summary in the prompt instead.

πŸ”Œ Usage

await client.windows.summarizeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430");

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window to summarize.

request: Airtop.SessionSummaryHandlerRequestBody

requestOptions: Windows.RequestOptions

client.windows.type(sessionId, windowId, { ...params }) -> Airtop.AiPromptResponse

πŸ“ Description

Execute a type interaction in a specific browser window

πŸ”Œ Usage

await client.windows.type("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
    text: "Example text",
});

βš™οΈ Parameters

sessionId: string β€” The session id for the window.

windowId: string β€” The Airtop window id of the browser window.

request: Airtop.SessionTypeHandlerRequestBody

requestOptions: Windows.RequestOptions

Automations

client.automations.list() -> Airtop.ListAutomationsOutput

πŸ“ Description

List all automations for a given organization

πŸ”Œ Usage

await client.automations.list();

βš™οΈ Parameters

requestOptions: Automations.RequestOptions

client.automations.update({ ...params }) -> Airtop.AutomationOutput

πŸ“ Description

Update the description of a specific automation

πŸ”Œ Usage

await client.automations.update({
    description: "description",
    id: "id",
    orgId: "orgId",
});

βš™οΈ Parameters

request: Airtop.UpdateAutomationDescriptionInputBody

requestOptions: Automations.RequestOptions

client.automations.get(automationId) -> Airtop.AutomationOutput

πŸ“ Description

Get a specific automation by ID

πŸ”Œ Usage

await client.automations.get("automationId");

βš™οΈ Parameters

automationId: string β€” ID of the automation to retrieve

requestOptions: Automations.RequestOptions

client.automations.delete(automationId) -> Airtop.DeleteAutomationOutputWrapperBody

πŸ“ Description

Delete a specific automation

πŸ”Œ Usage

await client.automations.delete("automationId");

βš™οΈ Parameters

automationId: string β€” ID of the automation to delete

requestOptions: Automations.RequestOptions

Files

client.files.list({ ...params }) -> Airtop.FilesResponse

πŸ“ Description

Get a list of files filtered by session ID

πŸ”Œ Usage

await client.files.list({
    offset: 1,
    limit: 10,
});

βš™οΈ Parameters

request: Airtop.FilesListRequest

requestOptions: Files.RequestOptions

client.files.create({ ...params }) -> Airtop.EnvelopeCreateFileV1EnvelopeDefaultMeta

πŸ”Œ Usage

await client.files.create({
    fileName: "fileName",
});

βš™οΈ Parameters

request: Airtop.CreateFileRestInputV1

requestOptions: Files.RequestOptions

client.files.get(id) -> Airtop.EnvelopeGetFileV1EnvelopeDefaultMeta

πŸ”Œ Usage

await client.files.get("id");

βš™οΈ Parameters

id: string β€” ID of the file

requestOptions: Files.RequestOptions

client.files.delete(id) -> void

πŸ”Œ Usage

await client.files.delete("id");

βš™οΈ Parameters

id: string β€” ID of the file

requestOptions: Files.RequestOptions

client.files.push(id, { ...params }) -> void

πŸ“ Description

Push a file to one or more sessions, making it available for the sessions to use

πŸ”Œ Usage

await client.files.push("id");

βš™οΈ Parameters

id: string β€” ID of the file

request: Airtop.PushFileBodyV1

requestOptions: Files.RequestOptions

Profiles

client.profiles.delete({ ...params }) -> void

πŸ“ Description

Delete profiles matching by id

πŸ”Œ Usage

await client.profiles.delete();

βš™οΈ Parameters

request: Airtop.ProfilesDeleteRequest

requestOptions: Profiles.RequestOptions

Requests

client.requests.getRequestStatus(requestId) -> Airtop.RequestStatusResponse

πŸ”Œ Usage

await client.requests.getRequestStatus("123e4567-e89b-12d3-a456-426614174000");

βš™οΈ Parameters

requestId: string β€” The ID of the request to check.

requestOptions: Requests.RequestOptions

Sessions

client.sessions.list({ ...params }) -> Airtop.SessionsResponse

πŸ“ Description

Get a paginated list of sessions filtered by ID or status

πŸ”Œ Usage

await client.sessions.list({
    offset: 1,
    limit: 10,
});

βš™οΈ Parameters

request: Airtop.SessionsListRequest

requestOptions: Sessions.RequestOptions

client.sessions.create({ ...params }) -> Airtop.SessionResponse

πŸ”Œ Usage

await client.sessions.create();

βš™οΈ Parameters

request: Airtop.SessionRestInputV1

requestOptions: Sessions.RequestOptions

client.sessions.getInfo(id) -> Airtop.SessionResponse

πŸ“ Description

Get a session by ID

πŸ”Œ Usage

await client.sessions.getInfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b");

βš™οΈ Parameters

id: string β€” Id of the session to get

requestOptions: Sessions.RequestOptions

client.sessions.terminate(id) -> void

πŸ“ Description

Ends a session by ID. If a given session id does not exist within the organization, it is ignored.

πŸ”Œ Usage

await client.sessions.terminate("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b");

βš™οΈ Parameters

id: string β€” ID of the session to delete.

requestOptions: Sessions.RequestOptions

client.sessions.events(id, { ...params }) -> core.Stream

πŸ“ Description

Get a session event stream for a given session ID

πŸ”Œ Usage

const response = await client.sessions.events("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", {
    lastEventId: 0,
    all: true,
});
for await (const item of response) {
    console.log(item);
}

βš™οΈ Parameters

id: string β€” ID of the session to get status info for

request: Airtop.SessionsEventsRequest

requestOptions: Sessions.RequestOptions

client.sessions.saveProfileOnTermination(sessionId, profileName) -> void

πŸ”Œ Usage

await client.sessions.saveProfileOnTermination("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "myProfile");

βš™οΈ Parameters

sessionId: string β€” ID of the session.

profileName: string β€” Name under which to save the profile.

requestOptions: Sessions.RequestOptions