Navigate

POST
/tools-api/chrome/navigate

Description

Navigates the Chrome browser to the specified URL. This endpoint allows an agent to direct the browser to visit any valid website or web application. The browser will wait until the page's DOM content is loaded before considering the navigation complete.

Note: Chrome must be started with the POST /tools-api/system/open-chrome action first before using this endpoint.

Request Format

Parameter Type Required Description
url string Yes The URL to navigate to. Must be a valid absolute URL (e.g., "https://www.google.com"). The system will automatically add "https://" if no protocol is specified.

Example Request

{
    "url": "https://www.google.com"
}

Response Format

Parameter Type Description
success boolean Indicates whether the navigation was successful.
message string A message describing the result of the navigation. In case of success, it will contain a confirmation message. In case of failure, it will contain error details.
timestamp datetime The timestamp when the action was completed.

Example Response

{
    "success": true,
    "message": "Successfully navigated to https://www.google.com",
    "timestamp": "2023-11-01T14:30:45.123Z"
}

Important: The navigation will wait for the DOM content to be loaded, but it won't necessarily wait for all resources (images, scripts, etc.) to be fully loaded. The system uses a timeout of 30 seconds for the navigation to complete.

Code Examples

import requests
import json

# API configuration
api_url = "http://localhost:54321/tools-api/chrome/navigate"
api_key = "your_api_key_here"

# Request payload
payload = {
    "url": "https://www.google.com"
}

# Headers with authentication
headers = {
    "Content-Type": "application/json",
    "Authorization": f"Bearer {api_key}"
}

# Send the request
response = requests.post(api_url, headers=headers, data=json.dumps(payload))

# Process the response
if response.status_code == 200:
    result = response.json()
    print(f"Navigation successful: {result['message']}")
else:
    print(f"Error: {response.status_code} - {response.text}")

Examples

Navigating to a Search Engine

This example demonstrates how to navigate to Google:

{
    "url": "https://www.google.com"
}

Navigating to a Specific Search Query

This example shows how to navigate directly to a search results page:

{
    "url": "https://www.google.com/search?q=smooth+operator+windows+automation"
}

Navigating to an Internal Page

This example demonstrates navigation to a specific page on a website:

{
    "url": "https://www.example.com/products/category/software"
}

Good news! We now offer convenient client libraries for Python, TypeScript and C# that make integration even easier while preserving all the functionality explained in these docs. The request/response formats and general usage notes shown here remain relevant regardless of which integration method you choose.