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.
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. |
{ "url": "https://www.google.com" }
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. |
{ "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.
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}")
This example demonstrates how to navigate to Google:
{ "url": "https://www.google.com" }
This example shows how to navigate directly to a search results page:
{ "url": "https://www.google.com/search?q=smooth+operator+windows+automation" }
This example demonstrates navigation to a specific page on a website:
{ "url": "https://www.example.com/products/category/software" }