Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
cleanup
Matic Zavadlal22c05773befb
diff --git a/docs/api-reference/run-task.mdx b/docs/api-reference/run-task.mdxindex 064223d1e..91ba473b3 100644--- a/docs/api-reference/run-task.mdx+++ b/docs/api-reference/run-task.mdx@@ -17,7 +17,13 @@ Creates a new browser automation task and returns the task ID that can be used t</ParamField><ParamField body="allowed_domains" type="array">- List of domains that the agent is allowed to visit. If not set, the agent will be allowed to visit all domains (not recommended if you are using secrets).+ List of domains that the agent is allowed to visit (e.g. ["google.com", "amazon.com", "*.skyscanner.com"]). <br/>+ We recommend using a wildcard to allow all subdomains of a domain (e.g. "*.skyscanner.com"). <br/>+ If not set, the agent will be allowed to visit all domains (not recommended if you are using secrets).+</ParamField>++<ParamField body="browser_profile_id" type="string">+ ID of the browser profile to use. If not set, the default profile will be used.</ParamField><ParamField body="save_browser_data" type="boolean" default="false">diff --git a/docs/cloud/custom-sdk.mdx b/docs/cloud/custom-sdk.mdxindex 41526faa4..9b9473e9e 100644--- a/docs/cloud/custom-sdk.mdx+++ b/docs/cloud/custom-sdk.mdx@@ -31,17 +31,60 @@ This will create a Python package with full type hints, modern dataclasses, and### TypeScript/JavaScript-For TypeScript projects, use [openapi-typescript](https://www.npmjs.com/package/openapi-typescript) to generate type definitions:+Use [OpenAPI TS](https://openapi-ts.dev/) library to generate a type safe TypeScript client for the Browser Use API.-```bash-# Install the generator-npm install -D openapi-typescript+The following guide shows how to create a simple type-safe `fetch` client, but you can also use other generators.++- React Query - https://openapi-ts.dev/openapi-react-query/+- SWR - https://openapi-ts.dev/swr-openapi/+++<CodeGroup>+```bash npm+npm install openapi-fetch+npm install -D openapi-typescript typescript+```-# Generate the types-npx openapi-typescript http://api.browser-use.com/openapi.json -o browser-use-api.ts+```bash yarn+yarn add openapi-fetch+yarn add -D openapi-typescript typescript+```+```bash pnpm+pnpm add openapi-fetch+pnpm add -D openapi-typescript typescript```+</CodeGroup>-This will create TypeScript definitions you can use with your preferred HTTP client.+```json title="package.json"+{+ "scripts": {+ "openapi:gen": "openapi-typescript https://api.browser-use.com/openapi.json -o ./src/lib/api/v1.d.ts"+ }+}+```++```bash+pnpm openapi:gen+```++```ts+// client.ts++'use client'++import createClient from 'openapi-fetch'+import { paths } from '@/lib/api/v1'++export type Client = ReturnType<typeof createClient<paths>>++export const client = createClient<paths>({+ baseUrl: 'https://api.browser-use.com/',++ // NOTE: You can get your API key from https://cloud.browser-use.com/billing!+ headers: { Authorization: `Bearer ${apiKey}` },+})++```<Note>Need help? Contact our support team at [email protected] or join ourdiff --git a/docs/cloud/implementation.mdx b/docs/cloud/implementation.mdxindex 9f78f94f1..c7b400e33 100644--- a/docs/cloud/implementation.mdx+++ b/docs/cloud/implementation.mdx@@ -1,7 +1,7 @@----title: "Using the API"-description: "Learn how to use the Browser Use API in Python"-icon: "book"+title: "Implementing the API"+description: "Learn how to implement the Browser Use API in Python"+icon: "code"---This guide shows how to implement common API patterns using Python. We'll create a complete example that creates and monitors a browser automation task.diff --git a/docs/cloud/openapi.mdx b/docs/cloud/openapi.mdxdeleted file mode 100644index 66feb4cd2..000000000--- a/docs/cloud/openapi.mdx+++ /dev/null@@ -1,83 +0,0 @@-----title: "OpenAPI Client"-description: "Learn how to generate a type safe client for the Browser Use API"-icon: "book"------## Generating a Type Safe TypeScript Client--Use [OpenAPI TS](https://openapi-ts.dev/) library to generate a type safe TypeScript client for the Browser Use API.--The following guide shows how to create a simple type-safe `fetch` client, but you can also use other generators.--- React Query - https://openapi-ts.dev/openapi-react-query/-- SWR - https://openapi-ts.dev/swr-openapi/---<CodeGroup>-```bash npm-npm install openapi-fetch-npm install -D openapi-typescript typescript-```--```bash yarn-yarn add openapi-fetch-yarn add -D openapi-typescript typescript-```-```bash pnpm-pnpm add openapi-fetch-pnpm add -D openapi-typescript typescript-```-</CodeGroup>--```json title="package.json"-{- "scripts": {- "openapi:gen": "openapi-typescript https://api.browser-use.com/openapi.json -o ./src/lib/api/v1.d.ts"- }-}-```--```bash-pnpm openapi:gen-```--```ts-// client.ts--'use client'--import createClient from 'openapi-fetch'-import { paths } from '@/lib/api/v1'--export type Client = ReturnType<typeof createClient<paths>>--export const client = createClient<paths>({- baseUrl: 'https://api.browser-use.com/',-- // NOTE: You can get your API key from https://cloud.browser-use.com/billing!- headers: { Authorization: `Bearer ${apiKey}` },-})--```--## Generating a Type Safe Python Client--Use [openapi-python-client](https://github.com/openapi-generators/openapi-python-client) to generate a modern Python client:--```bash-# Install the generator-pipx install openapi-python-client --include-deps--# Generate the client-openapi-python-client generate --url http://api.browser-use.com/openapi.json-```--This will create a Python package with full type hints, modern dataclasses, and async support.----<Note>- Need help? Contact our support team at [email protected] or join our- [Discord community](https://link.browser-use.com/discord)-</Note>