browser-use API reference
331 public APIs from browser-use (browser-use/browser-use) — 134 classes, 38 functions, 159 methods. Signatures extracted by static analysis of the actual source.
Repository: browser-use/browser-use
| Kind | Count |
|---|---|
| Classes | 134 |
| Functions | 38 |
| Methods | 159 |
API list
class
browser_use.actor.element.BoundingBoxElement bounding box with position and dimensions.
class
browser_use.actor.element.ElementElement operations using BackendNodeId.
method
browser_use.actor.element.Element.check() -> NoneCheck or uncheck a checkbox/radio button.
method
browser_use.actor.element.Element.evaluate(page_function:str, *args) -> strExecute JavaScript code in the context of this element.
method
browser_use.actor.element.Element.focus() -> NoneFocus the element.
method
browser_use.actor.element.Element.get_attribute(name:str) -> str | NoneGet an attribute value.
method
browser_use.actor.element.Element.get_bounding_box() -> BoundingBox | NoneGet the bounding box of the element.
method
browser_use.actor.element.Element.hover() -> NoneHover over the element.
method
browser_use.actor.element.Element.select_option(values:str | list[str]) -> NoneSelect option(s) in a select element.
class
browser_use.actor.element.ElementInfoBasic information about a DOM element.
class
browser_use.actor.element.Position2D position coordinates.
class
browser_use.actor.mouse.MouseMouse operations for a target.
method
browser_use.actor.mouse.Mouse.click(x:int, y:int, button:'MouseButton'='left', click_count:int=1) -> NoneClick at the specified coordinates.
method
browser_use.actor.mouse.Mouse.down(button:'MouseButton'='left', click_count:int=1) -> NonePress mouse button down.
method
browser_use.actor.mouse.Mouse.move(x:int, y:int, steps:int=1) -> NoneMove mouse to the specified coordinates.
method
browser_use.actor.mouse.Mouse.scroll(x:int | None=None, y:int | None=None, delta_x:int | None=None, delta_y:int | None=None) -> NoneScroll the page using robust CDP methods.
method
browser_use.actor.mouse.Mouse.up(button:'MouseButton'='left', click_count:int=1) -> NoneRelease mouse button.
class
browser_use.actor.page.PagePage operations (tab or iframe).
method
browser_use.actor.page.Page.dom_service() -> 'DomService'Get the DOM service for this target.
method
browser_use.actor.page.Page.evaluate(page_function:str, *args) -> strExecute JavaScript in the target.
method
browser_use.actor.page.Page.get_element(backend_node_id:int) -> 'Element'Get an element by its backend node ID.
method
browser_use.actor.page.Page.get_element_by_prompt(prompt:str, llm:'BaseChatModel | None'=None) -> 'Element | None'Get an element by a prompt.
method
browser_use.actor.page.Page.get_elements_by_css_selector(selector:str) -> list['Element']Get elements by CSS selector.
method
browser_use.actor.page.Page.get_target_info() -> 'TargetInfo'Get target information.
method
browser_use.actor.page.Page.get_title() -> strGet the current title.
method
browser_use.actor.page.Page.get_url() -> strGet the current URL.
method
browser_use.actor.page.Page.go_back() -> NoneNavigate back in history.
method
browser_use.actor.page.Page.go_forward() -> NoneNavigate forward in history.
method
browser_use.actor.page.Page.goto(url:str) -> NoneNavigate this target to a URL.
method
browser_use.actor.page.Page.mouse() -> 'Mouse'Get the mouse interface for this target.
method
browser_use.actor.page.Page.must_get_element_by_prompt(prompt:str, llm:'BaseChatModel | None'=None) -> 'Element'Get an element by a prompt.
method
browser_use.actor.page.Page.navigate(url:str) -> NoneAlias for goto.
method
browser_use.actor.page.Page.reload() -> NoneReload the target.
method
browser_use.actor.page.Page.screenshot(format:str='png', quality:int | None=None) -> strTake a screenshot and return base64 encoded image.
method
browser_use.actor.page.Page.session_id() -> strGet the session ID for this target.
method
browser_use.actor.page.Page.set_viewport_size(width:int, height:int) -> NoneSet the viewport size.
func
browser_use.actor.playground.playground.main()Main playground function.
class
browser_use.actor.utils.UtilsUtility functions for actor operations.
method
browser_use.actor.utils.Utils.get_key_info(key:str) -> tuple[str, int | None]Get the code and windowsVirtualKeyCode for a key.
func
browser_use.actor.utils.get_key_info(key:str) -> tuple[str, int | None]Get the code and windowsVirtualKeyCode for a key.
class
browser_use.agent.cloud_events.UpdateAgentSessionEventEvent to update an existing agent session
class
browser_use.agent.message_manager.views.MessageHistoryHistory of messages
class
browser_use.agent.message_manager.views.MessageManagerStateHolds the state for MessageManager
func
browser_use.agent.prompts.get_ai_step_user_prompt(query:str, stats_summary:str, content:str) -> strBuild user prompt for AI step action.
func
browser_use.agent.prompts.get_rerun_summary_message(prompt:str, screenshot_b64:str | None=None) -> UserMessageBuild a UserMessage for rerun summary generation.
method
browser_use.agent.service.Agent.authenticate_cloud_sync(show_instructions:bool=True) -> boolAuthenticate with cloud service for future runs.
method
browser_use.agent.service.Agent.close()Close all resources
method
browser_use.agent.service.Agent.current_llm_model() -> strGet the model name of the currently active LLM.
method
browser_use.agent.service.Agent.detect_variables() -> dict[str, DetectedVariable]Detect reusable variables in agent history
method
browser_use.agent.service.Agent.get_model_output(input_messages:list[BaseMessage]) -> AgentOutputGet next action from LLM based on current state
method
browser_use.agent.service.Agent.log_completion() -> NoneLog the completion of the task
method
browser_use.agent.service.Agent.multi_act(actions:list[ActionModel]) -> list[ActionResult]Execute multiple actions with page-change guards.
method
browser_use.agent.service.Agent.pause() -> NonePause the agent before the next step
func
browser_use.agent.service.Agent.replace_url(match:re.Match) -> strUrl can only have 1 query and 1 fragment
method
browser_use.agent.service.Agent.resume() -> NoneResume the agent
method
browser_use.agent.service.Agent.save_file_system_state() -> NoneSave current file system state to agent state
method
browser_use.agent.service.Agent.save_history(file_path:str | Path | None=None) -> NoneSave the history to a file with sensitive data filtering
func
browser_use.agent.service.Agent.skill_handler(params:BaseModel) -> ActionResultExecute a specific skill
method
browser_use.agent.service.Agent.step(step_info:AgentStepInfo | None=None) -> NoneExecute one step of the task
method
browser_use.agent.service.Agent.stop() -> NoneStop the agent
func
browser_use.agent.service.log_response(response:AgentOutput, registry=None, logger=None) -> NoneUtility function to log the model's response.
class
browser_use.agent.views.ActionResultResult of executing an action
class
browser_use.agent.views.AgentErrorContainer for agent error handling
class
browser_use.agent.views.AgentHistoryHistory item for agent actions
class
browser_use.agent.views.AgentHistoryListList of AgentHistory messages, i.e.
method
browser_use.agent.views.AgentHistoryList.action_names() -> list[str]Get all action names from history
method
browser_use.agent.views.AgentHistoryList.action_results() -> list[ActionResult]Get all results from history
method
browser_use.agent.views.AgentHistoryList.add_item(history_item:AgentHistory) -> NoneAdd a history item to the list
method
browser_use.agent.views.AgentHistoryList.extracted_content() -> list[str]Get all extracted content from history
method
browser_use.agent.views.AgentHistoryList.final_result() -> None | strFinal result from history
method
browser_use.agent.views.AgentHistoryList.has_errors() -> boolCheck if the agent has any non-None errors
method
browser_use.agent.views.AgentHistoryList.is_done() -> boolCheck if the agent is done
method
browser_use.agent.views.AgentHistoryList.is_judged() -> boolCheck if the agent trace has been judged
method
browser_use.agent.views.AgentHistoryList.last_action() -> None | dictLast action in history
method
browser_use.agent.views.AgentHistoryList.load_from_file(filepath:str | Path, output_model:type[AgentOutput]) -> AgentHistoryListLoad history from JSON file
method
browser_use.agent.views.AgentHistoryList.model_actions() -> list[dict]Get all actions from history
method
browser_use.agent.views.AgentHistoryList.model_actions_filtered(include:list[str] | None=None) -> list[dict]Get all model actions from history as JSON
method
browser_use.agent.views.AgentHistoryList.model_outputs() -> list[AgentOutput]Get all model outputs from history
method
browser_use.agent.views.AgentHistoryList.model_thoughts() -> list[AgentBrain]Get all thoughts from history
method
browser_use.agent.views.AgentHistoryList.number_of_steps() -> intGet the number of steps in the history
method
browser_use.agent.views.AgentHistoryList.screenshot_paths(n_last:int | None=None, return_none_if_not_screenshot:bool=True) -> list[str | None]Get all screenshot paths from history
method
browser_use.agent.views.AgentHistoryList.total_duration_seconds() -> floatGet total duration of all steps in seconds
method
browser_use.agent.views.AgentHistoryList.urls() -> list[str | None]Get all unique URLs from history
method
browser_use.agent.views.AgentOutput.type_with_custom_actions(custom_actions:type[ActionModel]) -> type[AgentOutput]Extend actions with custom actions
class
browser_use.agent.views.AgentSettingsConfiguration options for the Agent
class
browser_use.agent.views.AgentStateHolds all state information for an Agent
class
browser_use.agent.views.DetectedVariableA detected variable in agent history
class
browser_use.agent.views.JudgementResultLLM judgement of agent trace
class
browser_use.agent.views.PageFingerprintLightweight fingerprint of the browser page state.
class
browser_use.agent.views.RerunSummaryActionAI-generated summary for rerun completion
class
browser_use.agent.views.VariableMetadataMetadata about detected variables in history
method
browser_use.beta.service.Agent.authenticate_cloud_sync(show_instructions:bool=True) -> boolBrowser Use-compatible cloud-sync hook.
method
browser_use.beta.service.Agent.log_completion() -> NoneLog Browser Use-style task completion.
method
browser_use.beta.service.Agent.resume() -> NoneResume a paused Rust-backed agent.
method
browser_use.beta.service.Agent.save_history(file_path:str | Path | None=None) -> NoneSave the current Browser Use history to disk.
method
browser_use.beta.service.Agent.stop() -> NoneStop the Rust-backed agent before the next terminal run.
class
browser_use.beta.service.BetaAgentErrorRaised when the beta agent cannot run a task.
func
browser_use.browser.chrome.find_chrome_executable() -> str | NoneFind Chrome/Chromium executable on the system.
class
browser_use.browser.cloud.cloud.CloudBrowserClientClient for browser-use cloud browser service.
method
browser_use.browser.cloud.cloud.CloudBrowserClient.create_browser(request:CreateBrowserRequest, extra_headers:dict[str, str] | None=None) -> CloudBrowserResponseCreate a new cloud browser instance.
method
browser_use.browser.cloud.cloud.CloudBrowserClient.stop_browser(session_id:str | None=None, extra_headers:dict[str, str] | None=None) -> CloudBrowserResponseStop a cloud browser session.
class
browser_use.browser.cloud.views.CloudBrowserErrorException raised when cloud browser operations fail.
class
browser_use.browser.cloud.views.CloudBrowserResponseResponse from cloud browser API.
class
browser_use.browser.cloud.views.CreateBrowserRequestRequest to create a cloud browser instance.
class
browser_use.browser.events.AgentFocusChangedEventAgent focus changed to a different tab.
class
browser_use.browser.events.BrowserConnectedEventBrowser has started/connected.
class
browser_use.browser.events.BrowserErrorEventAn error occurred in the browser layer.
class
browser_use.browser.events.BrowserKillEventKill local browser subprocess.
class
browser_use.browser.events.BrowserLaunchEventLaunch a local browser process.
class
browser_use.browser.events.BrowserLaunchResultResult of launching a browser.
class
browser_use.browser.events.BrowserReconnectedEventWebSocket reconnection succeeded.
class
browser_use.browser.events.BrowserReconnectingEventWebSocket reconnection attempt is starting.
class
browser_use.browser.events.BrowserStartEventStart/connect to browser.
class
browser_use.browser.events.BrowserStateRequestEventRequest current browser state.
class
browser_use.browser.events.BrowserStopEventStop/disconnect from browser.
class
browser_use.browser.events.BrowserStoppedEventBrowser has stopped/disconnected.
class
browser_use.browser.events.CaptchaSolverFinishedEventCaptcha solving finished by the browser proxy.
class
browser_use.browser.events.CaptchaSolverStartedEventCaptcha solving started by the browser proxy.
class
browser_use.browser.events.ClickCoordinateEventClick at specific coordinates.
class
browser_use.browser.events.ClickElementEventClick an element.
class
browser_use.browser.events.CloseTabEventClose a tab.
class
browser_use.browser.events.ElementSelectedEventAn element was selected.
class
browser_use.browser.events.FileDownloadedEventA file has been downloaded.
class
browser_use.browser.events.GoBackEventNavigate back in browser history.
class
browser_use.browser.events.GoForwardEventNavigate forward in browser history.
class
browser_use.browser.events.LoadStorageStateEventRequest to load browser storage state.
class
browser_use.browser.events.NavigateToUrlEventNavigate to a specific URL.
class
browser_use.browser.events.NavigationCompleteEventNavigation completed.
class
browser_use.browser.events.NavigationStartedEventNavigation started.
class
browser_use.browser.events.RefreshEventRefresh/reload the current page.
class
browser_use.browser.events.SaveStorageStateEventRequest to save browser storage state.
class
browser_use.browser.events.ScreenshotEventRequest to take a screenshot.
class
browser_use.browser.events.ScrollEventScroll the page or element.
class
browser_use.browser.events.ScrollToTextEventScroll to specific text on the page.
class
browser_use.browser.events.SendKeysEventSend keyboard keys/shortcuts.
class
browser_use.browser.events.StorageStateLoadedEventNotification that storage state was loaded.
class
browser_use.browser.events.StorageStateSavedEventNotification that storage state was saved.
class
browser_use.browser.events.SwitchTabEventSwitch to a different tab.
class
browser_use.browser.events.TabClosedEventA tab was closed.
class
browser_use.browser.events.TabCreatedEventA new tab was created.
class
browser_use.browser.events.TargetCrashedEventA target has crashed.
class
browser_use.browser.events.TypeTextEventType text into an element.
class
browser_use.browser.events.UploadFileEventUpload a file to an element.
class
browser_use.browser.events.WaitEventWait for a specified number of seconds.
class
browser_use.browser.profile.BrowserNewContextArgsPydantic model for new_context() arguments.
class
browser_use.browser.profile.ProxySettingsTyped proxy settings for Chromium traffic.
func
browser_use.browser.profile.validate_cli_arg(arg:str) -> strValidate that arg is a valid CLI argument.
func
browser_use.browser.profile.validate_float_range(value:float, min_val:float, max_val:float) -> floatValidate that float is within specified range.
func
browser_use.browser.python_highlights.get_element_color(tag_name:str, element_type:str | None=None) -> strGet color for element based on tag name and type.
func
browser_use.browser.python_highlights.should_show_index_overlay(backend_node_id:int | None) -> boolDetermine if index overlay should be shown.
method
browser_use.browser.session.BrowserSession.cdp_client() -> CDPClientGet the cached root CDP cdp_session.cdp_client.
method
browser_use.browser.session.BrowserSession.cdp_url() -> str | NoneCDP URL from browser profile.
method
browser_use.browser.session.BrowserSession.clear_cookies() -> NoneClear all cookies.
method
browser_use.browser.session.BrowserSession.close() -> NoneAlias for stop().
method
browser_use.browser.session.BrowserSession.close_page(page:'Union[Page, str]') -> NoneClose a page by Page object or target ID.
method
browser_use.browser.session.BrowserSession.cookies() -> list['Cookie']Get cookies, optionally filtered by URLs.
method
browser_use.browser.session.BrowserSession.demo_mode() -> 'DemoMode | None'Lazy init demo mode helper when enabled.
method
browser_use.browser.session.BrowserSession.find_frame_target(frame_id:str, all_frames:dict[str, dict] | None=None) -> dict | NoneFind the frame info for a specific frame ID.
method
browser_use.browser.session.BrowserSession.get_current_page() -> 'Page | None'Get the current page as an actor Page.
method
browser_use.browser.session.BrowserSession.get_current_page_title() -> strGet the title of the current page.
method
browser_use.browser.session.BrowserSession.get_current_page_url() -> strGet the URL of the current page.
method
browser_use.browser.session.BrowserSession.get_dom_element_by_index(index:int) -> EnhancedDOMTreeNode | NoneGet DOM element by index.
method
browser_use.browser.session.BrowserSession.get_focused_target() -> 'Target | None'Get the target that currently has agent focus.
method
browser_use.browser.session.BrowserSession.get_index_by_id(element_id:str) -> int | NoneFind element index by its id attribute.
method
browser_use.browser.session.BrowserSession.get_or_create_cdp_session(target_id:TargetID | None=None, focus:bool=True) -> CDPSessionGet CDP session for a target from the event-driven pool.
method
browser_use.browser.session.BrowserSession.get_selector_index(node:EnhancedDOMTreeNode) -> intReturn the model-visible selector index for a DOM node.
method
browser_use.browser.session.BrowserSession.get_state_as_text() -> strGet the browser state as text.
method
browser_use.browser.session.BrowserSession.is_file_input(element:Any) -> boolCheck if element is a file input.
method
browser_use.browser.session.BrowserSession.kill() -> NoneKill the browser session and reset all state.
method
browser_use.browser.session.BrowserSession.must_get_current_page() -> 'Page'Get the current page as an actor Page.
method
browser_use.browser.session.BrowserSession.navigate_to(url:str, new_tab:bool=False) -> NoneNavigate to a URL using the standard event system.
method
browser_use.browser.session.BrowserSession.new_page(url:str | None=None) -> 'Page'Create a new page (tab).
method
browser_use.browser.session.BrowserSession.on_BrowserStartEvent(event:BrowserStartEvent) -> dict[str, str]Handle browser start request.
method
browser_use.browser.session.BrowserSession.on_BrowserStopEvent(event:BrowserStopEvent) -> NoneHandle browser stop request.
method
browser_use.browser.session.BrowserSession.on_CloseTabEvent(event:CloseTabEvent) -> NoneHandle tab closure - update focus if needed.
method
browser_use.browser.session.BrowserSession.on_FileDownloadedEvent(event:FileDownloadedEvent) -> NoneTrack downloaded files during this session.
method
browser_use.browser.session.BrowserSession.on_SwitchTabEvent(event:SwitchTabEvent) -> TargetIDHandle tab switching - core browser functionality.
method
browser_use.browser.session.BrowserSession.on_TabClosedEvent(event:TabClosedEvent) -> NoneHandle tab closure - update focus if needed.
method
browser_use.browser.session.BrowserSession.remove_highlights() -> NoneRemove highlights from the page using CDP.
method
browser_use.browser.session.BrowserSession.reset() -> NoneClear all cached CDP sessions with proper cleanup.
method
browser_use.browser.session.BrowserSession.screenshot_element(selector:str, path:str | None=None, format:str='png', quality:int | None=None) -> bytesTake a screenshot of a specific element.
method
browser_use.browser.session.BrowserSession.start() -> NoneStart the browser session.
method
browser_use.browser.session.BrowserSession.take_screenshot(path:str | None=None, full_page:bool=False, format:str='png', quality:int | None=None, clip:dict | None=None) -> bytesTake a screenshot using CDP.
class
browser_use.browser.session.CDPSessionCDP communication channel to a target.
class
browser_use.browser.session_manager.SessionManagerEvent-driven CDP session manager.
method
browser_use.browser.session_manager.SessionManager.clear() -> NoneClear all owned data structures for cleanup.
method
browser_use.browser.session_manager.SessionManager.get_all_page_targets() -> listGet all page/tab targets using owned data.
method
browser_use.browser.session_manager.SessionManager.get_all_target_ids() -> list[TargetID]Get all target IDs from owned data.
method
browser_use.browser.session_manager.SessionManager.get_session(session_id:SessionID) -> 'CDPSession | None'Get session from owned data.
method
browser_use.browser.session_manager.SessionManager.get_target(target_id:TargetID) -> 'Target | None'Get target from owned data.
method
browser_use.browser.session_manager.SessionManager.get_target_id_from_session_id(session_id:SessionID) -> TargetID | NoneLook up which target a session belongs to.
method
browser_use.browser.session_manager.SessionManager.start_monitoring() -> NoneStart monitoring Target attach/detach events.
method
browser_use.browser.session_manager.SessionManager.validate_session(target_id:TargetID) -> boolCheck if a target still has active sessions.
class
browser_use.browser.views.NetworkRequestInformation about a pending network request
class
browser_use.browser.views.PageInfoComprehensive page size and scroll information
class
browser_use.browser.views.TabInfoRepresents information about a browser tab
class
browser_use.browser.views.URLNotAllowedErrorError raised when a URL is not allowed
class
browser_use.browser.watchdog_base.BaseWatchdogBase class for all browser watchdogs.
class
browser_use.browser.watchdogs.crash_watchdog.NetworkRequestTrackerTracks ongoing network requests.
class
browser_use.browser.watchdogs.local_browser_watchdog.LocalBrowserWatchdogManages local browser subprocess lifecycle.
method
browser_use.browser.watchdogs.local_browser_watchdog.LocalBrowserWatchdog.browser_pid() -> int | NoneGet the browser process ID.
method
browser_use.browser.watchdogs.local_browser_watchdog.LocalBrowserWatchdog.on_BrowserKillEvent(event:BrowserKillEvent) -> NoneKill the local browser subprocess.
method
browser_use.browser.watchdogs.local_browser_watchdog.LocalBrowserWatchdog.on_BrowserLaunchEvent(event:BrowserLaunchEvent) -> BrowserLaunchResultLaunch a local browser process.
class
browser_use.browser.watchdogs.screenshot_watchdog.ScreenshotWatchdogHandles screenshot requests using CDP.
method
browser_use.browser.watchdogs.screenshot_watchdog.ScreenshotWatchdog.on_ScreenshotEvent(event:ScreenshotEvent) -> strHandle screenshot request using CDP.
class
browser_use.config.AgentEntryAgent configuration entry.
class
browser_use.config.DBStyleConfigJSONNew database-style configuration format.
class
browser_use.config.DBStyleEntryDatabase-style entry with UUID and metadata.
class
browser_use.config.FlatEnvConfigAll environment variables in a flat namespace.
class
browser_use.config.LLMEntryLLM configuration entry.
func
browser_use.config.create_default_config() -> DBStyleConfigJSONCreate a fresh default configuration.
func
browser_use.config.get_default_llm(config:dict[str, Any]) -> dict[str, Any]Get default LLM config from config dict.
func
browser_use.config.get_default_profile(config:dict[str, Any]) -> dict[str, Any]Get default browser profile from config dict.
func
browser_use.config.load_and_migrate_config(config_path:Path) -> DBStyleConfigJSONLoad config.json or create fresh one if old format detected.
func
browser_use.config.load_browser_use_config() -> dict[str, Any]Load browser-use configuration for MCP components.
class
browser_use.dom.serializer.html_serializer.HTMLSerializerSerializes enhanced DOM trees back to HTML format.
method
browser_use.dom.serializer.html_serializer.HTMLSerializer.serialize(node:EnhancedDOMTreeNode, depth:int=0) -> strSerialize an enhanced DOM tree node to HTML.
class
browser_use.dom.serializer.paint_order.RectUnionPureMaintains a *disjoint* set of rectangles.
method
browser_use.dom.serializer.paint_order.RectUnionPure.add(r:Rect) -> boolInsert r unless it is already covered.
method
browser_use.dom.serializer.paint_order.RectUnionPure.contains(r:Rect) -> boolTrue iff r is fully covered by the current union.
class
browser_use.dom.serializer.serializer.DOMTreeSerializerSerializes enhanced DOM trees to string format.
func
browser_use.dom.utils.cap_text_length(text:str, max_length:int) -> strCap text length for display.
class
browser_use.dom.views.MarkdownChunkA structure-aware chunk of markdown content.
class
browser_use.dom.views.MatchLevelElement matching strictness levels for history replay.
class
browser_use.dom.views.NodeTypeDOM node types based on the DOM specification.
class
browser_use.dom.views.SimplifiedNodeSimplified tree node for optimization.
func
browser_use.dom.views.filter_dynamic_classes(class_str:str | None) -> strRemove dynamic state classes, keep semantic/identifying ones.
class
browser_use.filesystem.file_system.BaseFileBase class for all file types
method
browser_use.filesystem.file_system.BaseFile.append_file_content(content:str) -> NoneAppend content to internal content
method
browser_use.filesystem.file_system.BaseFile.extension() -> strFile extension (e.g.
method
browser_use.filesystem.file_system.BaseFile.write_file_content(content:str) -> NoneUpdate internal content (formatted)
class
browser_use.filesystem.file_system.DocxFileDOCX file implementation
method
browser_use.filesystem.file_system.FileSystem.append_file(full_filename:str, content:str) -> strAppend content to file using file-specific append method
method
browser_use.filesystem.file_system.FileSystem.display_file(full_filename:str) -> str | NoneDisplay file content using file-specific display method
method
browser_use.filesystem.file_system.FileSystem.get_allowed_extensions() -> list[str]Get allowed extensions
method
browser_use.filesystem.file_system.FileSystem.get_dir() -> PathGet the file system directory
method
browser_use.filesystem.file_system.FileSystem.get_state() -> FileSystemStateGet serializable state of the file system
method
browser_use.filesystem.file_system.FileSystem.get_todo_contents() -> strGet todo file contents
method
browser_use.filesystem.file_system.FileSystem.list_files() -> list[str]List all files in the system
method
browser_use.filesystem.file_system.FileSystem.nuke() -> NoneDelete the file system directory
method
browser_use.filesystem.file_system.FileSystem.replace_file_str(full_filename:str, old_str:str, new_str:str) -> strReplace old_str with new_str in file_name
method
browser_use.filesystem.file_system.FileSystem.save_extracted_content(content:str) -> strSave extracted content to a numbered file
method
browser_use.filesystem.file_system.FileSystem.write_file(full_filename:str, content:str) -> strWrite content to file using file-specific write method
class
browser_use.filesystem.file_system.FileSystemStateSerializable state of the file system
class
browser_use.filesystem.file_system.HtmlFileHTML file implementation
class
browser_use.filesystem.file_system.JsonFileJSON file implementation
class
browser_use.filesystem.file_system.JsonlFileJSONL (JSON Lines) file implementation
class
browser_use.filesystem.file_system.MarkdownFileMarkdown file implementation
class
browser_use.filesystem.file_system.PdfFilePDF file implementation
class
browser_use.filesystem.file_system.TxtFilePlain text file implementation
class
browser_use.filesystem.file_system.XmlFileXML file implementation
class
browser_use.integrations.gmail.actions.GetRecentEmailsParamsParameters for getting recent emails
class
browser_use.integrations.gmail.service.GmailServiceGmail API service for email reading.
method
browser_use.integrations.gmail.service.GmailService.is_authenticated() -> boolCheck if Gmail service is authenticated
class
browser_use.llm.anthropic.chat.ChatAnthropicA wrapper around Anthropic's chat model.
method
browser_use.llm.anthropic.chat.ChatAnthropic.get_client() -> AsyncAnthropicReturns an AsyncAnthropic client.
class
browser_use.llm.aws.chat_anthropic.ChatAnthropicBedrockAWS Bedrock Anthropic Claude chat model.
method
browser_use.llm.aws.chat_anthropic.ChatAnthropicBedrock.get_client() -> AsyncAnthropicBedrockReturns an AsyncAnthropicBedrock client.
class
browser_use.llm.browser_use.chat.ChatBrowserUseClient for browser-use cloud API.
class
browser_use.llm.cerebras.chat.ChatCerebrasCerebras inference wrapper (OpenAI-compatible).
class
browser_use.llm.deepseek.chat.ChatDeepSeekDeepSeek /chat/completions wrapper (OpenAI-compatible).
class
browser_use.llm.exceptions.ModelProviderErrorException raised when a model provider returns an error.
class
browser_use.llm.ollama.chat.ChatOllamaA wrapper around Ollama's chat model.
method
browser_use.llm.ollama.chat.ChatOllama.get_client() -> OllamaAsyncClientReturns an OllamaAsyncClient client.
method
browser_use.llm.openai.chat.ChatOpenAI.get_client() -> AsyncOpenAIReturns an AsyncOpenAI client.
func
browser_use.llm.schema.SchemaOptimizer.ensure_additional_properties_false(obj:Any) -> NoneEnsure all objects have additionalProperties: false
func
browser_use.llm.schema.SchemaOptimizer.remove_forbidden_fields(obj:Any) -> NoneRecursively remove minItems/min_items and default values
class
browser_use.llm.views.ChatInvokeCompletionResponse from a chat model invocation.
class
browser_use.llm.views.ChatInvokeUsageUsage information for a chat model invocation.
class
browser_use.logging_config.FIFOHandlerNon-blocking handler that writes to a named pipe.
func
browser_use.logging_config.setup_log_pipes(session_id:str, base_dir:str | None=None)Setup named pipes for log streaming.
func
browser_use.mcp.client.MCPClient.mcp_action_wrapper(params:param_model) -> ActionResultWrapper function that calls the MCP tool.
class
browser_use.mcp.controller.MCPToolWrapperWrapper to integrate MCP tools as browser-use actions.
func
browser_use.mcp.controller.register_mcp_tools(registry:Registry, mcp_command:str, mcp_args:list[str] | None=None) -> MCPToolWrapperRegister MCP tools with a browser-use registry.
class
browser_use.mcp.server.BrowserUseServerMCP Server for browser-use capabilities.
func
browser_use.mcp.server.BrowserUseServer.handle_call_tool(name:str, arguments:dict[str, Any] | None) -> list[types.TextContent | types.ImageContent]Handle tool execution.
func
browser_use.mcp.server.BrowserUseServer.handle_list_tools() -> list[types.Tool]List all available browser-use tools.
method
browser_use.mcp.server.BrowserUseServer.run()Run the MCP server.
func
browser_use.observability.is_debug_mode() -> boolCheck if we're currently in debug mode.
func
browser_use.observability.is_lmnr_available() -> boolCheck if lmnr is available for tracing.
func
browser_use.sandbox.sandbox.get_terminal_width() -> intGet terminal width, default to 80 if unable to detect
class
browser_use.sandbox.views.BrowserCreatedDataData for browser_created event
class
browser_use.sandbox.views.ErrorDataData for error event
class
browser_use.sandbox.views.ExecutionResponseExecution result from the executor
class
browser_use.sandbox.views.LogDataData for log event
class
browser_use.sandbox.views.ResultDataData for result event
class
browser_use.sandbox.views.SSEEventTypeEvent types for Server-Sent Events
func
browser_use.skills.browser_use.skill_text() -> strReturn the canonical Browser Use skill.
method
browser_use.skills.views.Skill.from_skill_response(response:SkillResponse) -> 'Skill'Create a Skill from SDK SkillResponse
class
browser_use.sync.auth.CloudAuthConfigConfiguration for cloud authentication
method
browser_use.sync.auth.CloudAuthConfig.load_from_file() -> 'CloudAuthConfig'Load auth config from local file
method
browser_use.sync.auth.CloudAuthConfig.save_to_file() -> NoneSave auth config to local file
class
browser_use.sync.auth.DeviceAuthClientClient for OAuth2 device authorization flow
method
browser_use.sync.auth.DeviceAuthClient.api_token() -> str | NoneGet the current API token
method
browser_use.sync.auth.DeviceAuthClient.authenticate(agent_session_id:str | None=None, show_instructions:bool=True) -> boolRun the full authentication flow.
method
browser_use.sync.auth.DeviceAuthClient.clear_auth() -> NoneClear stored authentication
method
browser_use.sync.auth.DeviceAuthClient.get_headers() -> dictGet headers for API requests
method
browser_use.sync.auth.DeviceAuthClient.is_authenticated() -> boolCheck if we have valid authentication
method
browser_use.sync.auth.DeviceAuthClient.poll_for_token(device_code:str, interval:float=3.0, timeout:float=1800.0) -> dict | NonePoll for the access token.
method
browser_use.sync.auth.DeviceAuthClient.start_device_authorization(agent_session_id:str | None=None) -> dictStart the device authorization flow.
method
browser_use.sync.auth.DeviceAuthClient.user_id() -> strGet the current user ID (temporary or real)
class
browser_use.sync.service.CloudSyncService for syncing events to the Browser Use cloud
method
browser_use.sync.service.CloudSync.authenticate(show_instructions:bool=True) -> boolAuthenticate with the cloud service
method
browser_use.sync.service.CloudSync.handle_event(event:BaseEvent) -> NoneHandle an event by sending it to the cloud
method
browser_use.sync.service.CloudSync.set_auth_flow_active() -> NoneMark auth flow as active to allow all events
class
browser_use.telemetry.service.ProductTelemetryService for capturing anonymized telemetry data.
func
browser_use.telemetry.service.get_or_create_device_id() -> strReturn the anonymous device id shared by telemetry
class
browser_use.telemetry.views.MCPClientTelemetryEventTelemetry event for MCP client usage
class
browser_use.telemetry.views.MCPServerTelemetryEventTelemetry event for MCP server usage
func
browser_use.tokens.openrouter_pricing.get_openrouter_model_metadata(model_name:str, refresh:bool=False) -> dict[str, Any] | NoneFetch metadata for one OpenRouter model id.
func
browser_use.tokens.openrouter_pricing.get_openrouter_models_metadata(refresh:bool=False) -> dict[str, dict[str, Any]]Fetch OpenRouter model metadata keyed by model id.
class
browser_use.tokens.service.TokenCostService for tracking token usage and calculating costs
method
browser_use.tokens.service.TokenCost.clear_history() -> NoneClear usage history
method
browser_use.tokens.service.TokenCost.ensure_pricing_loaded() -> NoneEnsure pricing data is loaded in the background.
method
browser_use.tokens.service.TokenCost.get_cost_by_model() -> dict[str, ModelUsageStats]Get cost breakdown by model
method
browser_use.tokens.service.TokenCost.get_model_pricing(model_name:str) -> ModelPricing | NoneGet pricing information for a specific model
method
browser_use.tokens.service.TokenCost.get_usage_tokens_for_model(model:str) -> ModelUsageTokensGet usage tokens for a specific model
method
browser_use.tokens.service.TokenCost.initialize() -> NoneInitialize the service by loading pricing data
method
browser_use.tokens.service.TokenCost.refresh_pricing_data() -> NoneForce refresh of pricing data from GitHub
class
browser_use.tokens.views.CachedPricingDataCached pricing data with timestamp
class
browser_use.tokens.views.ModelPricingPricing information for a model
class
browser_use.tokens.views.ModelUsageStatsUsage statistics for a single model
class
browser_use.tokens.views.ModelUsageTokensUsage tokens for a single model
class
browser_use.tokens.views.TokenCostCalculatedToken cost
class
browser_use.tokens.views.TokenUsageEntrySingle token usage entry
class
browser_use.tokens.views.UsageSummarySummary of token usage and costs
func
browser_use.utils.check_env_variables(keys:list[str], any_or_all=all) -> boolCheck if all required environment variables are set
func
browser_use.utils.get_git_info() -> dict[str, str] | NoneGet git information if installed from git repository
func
browser_use.utils.is_placeholder_url(url:str) -> boolReturn True for mock placeholder hostnames like https://XXX.XX.
func
browser_use.utils.match_url_with_domain_pattern(url:str, domain_pattern:str, log_warnings:bool=False) -> boolCheck if a URL matches a domain pattern.
func
browser_use.utils.sanitize_surrogates(text:str) -> strRemove surrogate characters that can't be encoded in UTF-8.
About this data
These signatures were extracted from the public source of browser-use/browser-use
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.