RPC API Reference
Complete reference for all gRPC methods available in the Browser Cloud API. All requests must include session_id and api_key as the first two fields in the request payload.
Navigation
Navigate
Navigate to a URL with optional timeout.
Method: cloudbrowser.BrowserService/NavigateRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"url": "https://example.com",
"timeout_ms": 30000
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyurl(string, required): URL to navigate totimeout_ms(int32, required): Timeout in milliseconds
Response:
{}Empty response on success.
LoadHTML
Load HTML content directly into the browser.
Method: cloudbrowser.BrowserService/LoadHTMLRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"url": "https://example.com",
"html": "<html><body>Hello World</body></html>"
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyurl(string, required): URL to load the HTML content at (emulated)html(string, required): HTML content to load
Response:
{}Empty response on success.
JavaScript Execution
Evaluate
Execute JavaScript expression and return the result.
Method: cloudbrowser.BrowserService/EvaluateRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"expression": "document.title",
"frame_id": ""
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyexpression(string, required): JavaScript expression to executeframe_id(string, optional): Frame ID. Use""(empty string) or"ROOT_FRAME"to evaluate in the page's top frame, or a specific frame ID to evaluate only in that frame
Response:
{
"result": "\"Example Page\""
}result(string): JSON-encoded result of the JavaScript expression
Waiting Operations
WaitForSelector
Wait for an element to appear. Searches across all frames globally if frame_id is empty.
Method: cloudbrowser.BrowserService/WaitForSelectorRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"selector": "#my-button",
"timeout_ms": 30000,
"frame_id": ""
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyselector(string, required): CSS selector to wait fortimeout_ms(int32, required): Timeout in millisecondsframe_id(string, optional): Use""(empty string) to search across all frames globally,"ROOT_FRAME"to search only in the page's top frame, or a specific frame ID to search only in that frame (not children)
Response:
{
"frame_id": "frame-123"
}frame_id(string): Frame ID where the selector was found
WaitForExpression
Wait for a JavaScript expression to return true. Searches across all frames globally if frame_id is empty.
Method: cloudbrowser.BrowserService/WaitForExpressionRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"expression": "document.readyState === 'complete'",
"timeout_ms": 30000,
"frame_id": ""
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyexpression(string, required): JavaScript expression to wait fortimeout_ms(int32, required): Timeout in millisecondsframe_id(string, optional): Use""(empty string) to search across all frames globally,"ROOT_FRAME"to search only in the page's top frame, or a specific frame ID to search only in that frame (not children)
Response:
{
"frame_id": "frame-123"
}frame_id(string): Frame ID where the expression returned true
WaitForAnySelector
Wait for any of multiple selectors to appear. Searches across all frames globally if frame_id is empty.
Method: cloudbrowser.BrowserService/WaitForAnySelectorRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"selectors": ["#button1", "#button2", "#button3"],
"timeout_ms": 30000,
"frame_id": ""
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyselectors(array of strings, required): Array of CSS selectors to wait fortimeout_ms(int32, required): Timeout in millisecondsframe_id(string, optional): Use""(empty string) to search across all frames globally,"ROOT_FRAME"to search only in the page's top frame, or a specific frame ID to search only in that frame (not children)
Response:
{
"index": 1,
"frame_id": "frame-123"
}index(int32): Index of the first matching selector (0-based)frame_id(string): Frame ID where the selector was found
WaitForAnyExpression
Wait for any of multiple JavaScript expressions to return true. Searches across all frames globally if frame_id is empty.
Method: cloudbrowser.BrowserService/WaitForAnyExpressionRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"expressions": [
"document.getElementById('btn1')",
"document.getElementById('btn2')"
],
"timeout_ms": 30000,
"frame_id": ""
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyexpressions(array of strings, required): Array of JavaScript expressions to wait fortimeout_ms(int32, required): Timeout in millisecondsframe_id(string, optional): Use""(empty string) to search across all frames globally,"ROOT_FRAME"to search only in the page's top frame, or a specific frame ID to search only in that frame (not children)
Response:
{
"index": 0,
"frame_id": "frame-123"
}index(int32): Index of the first matching expression (0-based)frame_id(string): Frame ID where the expression returned true
Browser Operations
ClickSelector
Click an element using CSS selector. The selector is searched across all frames globally.
Method: cloudbrowser.BrowserService/ClickSelectorRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"selector": "#submit-button"
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyselector(string, required): CSS selector for the element
Response:
{}Empty response on success.
FillInput
Fill an input field with a value. The selector is searched across all frames globally.
Method: cloudbrowser.BrowserService/FillInputRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"selector": "#email-input",
"value": "user@example.com"
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyselector(string, required): CSS selector for the input elementvalue(string, required): Value to fill into the input field
Response:
{}Empty response on success.
SelectOption
Select an option from a select element. The selector is searched across all frames globally.
Method: cloudbrowser.BrowserService/SelectOptionRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"selector": "#country-select",
"option": "US"
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyselector(string, required): CSS selector for the select elementoption(string, required): Option value or text to select
Response:
{}Empty response on success.
Type
Type text into the currently focused element.
Method: cloudbrowser.BrowserService/TypeRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"text": "Hello World"
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keytext(string, required): Text to type into the focused element
Response:
{}Empty response on success. Note: This method types into whatever element currently has focus. Use ClickSelector or FillInput first to focus an element if needed.
MoveMouseToSelector
Move mouse to an element using CSS selector. Returns the coordinates where the mouse was moved.
Method: cloudbrowser.BrowserService/MoveMouseToSelectorRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"selector": "#hover-target"
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyselector(string, required): CSS selector for the element
Response:
{
"x": 150,
"y": 200
}x(int32): X coordinatey(int32): Y coordinate
PressPosition
Press mouse button at a specific position (x, y coordinates).
Method: cloudbrowser.BrowserService/PressPositionRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"x": 100,
"y": 200
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyx(int32, required): X coordinate to pressy(int32, required): Y coordinate to press
Response:
{}Empty response on success.
ReleasePosition
Release mouse button at a specific position (x, y coordinates).
Method: cloudbrowser.BrowserService/ReleasePositionRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"x": 100,
"y": 200
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyx(int32, required): X coordinate to releasey(int32, required): Y coordinate to release
Response:
{}Empty response on success.
Frame Management
Many RPC methods accept a frame_id parameter to specify which frame to operate on. Use "" (empty string) to search across all frames globally, "ROOT_FRAME" to target the page's top/main frame only, or a specific frame ID to search only in that frame (not children).
GetFrames
Get all available frame IDs.
Method: cloudbrowser.BrowserService/GetFramesRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key"
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API key
Response:
{
"frame_ids": ["frame-1", "frame-2", "frame-3"]
}frame_ids(array of strings): Array of frame IDs
GetFrameTree
Get the frame tree structure showing the hierarchy of all frames.
Method: cloudbrowser.BrowserService/GetFrameTreeRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key"
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API key
Response:
{
"frame_tree": {
"frame_id": "frame-1",
"pos_x": 0,
"pos_y": 0,
"children": [
{
"frame_id": "frame-2",
"pos_x": 10,
"pos_y": 20,
"children": []
}
]
}
}frame_tree(object): Frame tree structure with frame_id, pos_x, pos_y, and children array
Network Operations
WaitForRequest
Wait for a specific network request.
Method: cloudbrowser.BrowserService/WaitForRequestRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"url": "https://api.example.com/data",
"abort": false,
"timeout_ms": 30000
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyurl(string, required): URL pattern to wait forabort(bool, required): Whether to abort the requesttimeout_ms(int32, required): Timeout in milliseconds
Response:
{
"request": {
"method": "GET",
"url": "https://api.example.com/data",
"headers": [
{"name": "User-Agent", "value": "Mozilla/5.0..."},
{"name": "Accept", "value": "application/json"}
],
"body": "",
"status_code": 0
}
}request(object): Request object with method, url, headers array, body, and status_code
WaitForResponse
Wait for a specific network response.
Method: cloudbrowser.BrowserService/WaitForResponseRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"url": "https://api.example.com/data",
"timeout_ms": 30000
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyurl(string, required): URL pattern to wait fortimeout_ms(int32, required): Timeout in milliseconds
Response:
{
"response": {
"url": "https://api.example.com/data",
"headers": [
{"name": "Content-Type", "value": "application/json"},
{"name": "Content-Length", "value": "1234"}
],
"body": "{\"data\": \"value\"}",
"status_code": 200
}
}response(object): Response object with url, headers array, body, and status_code
WaitForAnyRequest
Wait for any of multiple network requests.
Method: cloudbrowser.BrowserService/WaitForAnyRequestRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"url_patterns": [
"https://api.example.com/endpoint1",
"https://api.example.com/endpoint2"
],
"abort_flags": [false, true],
"timeout_ms": 30000
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyurl_patterns(array of strings, required): Array of URL patterns to wait forabort_flags(array of bools, required): Array of abort flags corresponding to each URL patterntimeout_ms(int32, required): Timeout in milliseconds
Response:
{
"index": 0,
"request": {
"method": "GET",
"url": "https://api.example.com/endpoint1",
"headers": [],
"body": "",
"status_code": 0
}
}index(int32): Index of the matching request (0-based)request(object): Request object
WaitForAnyResponse
Wait for any of multiple network responses.
Method: cloudbrowser.BrowserService/WaitForAnyResponseRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"url_patterns": [
"https://api.example.com/endpoint1",
"https://api.example.com/endpoint2"
],
"timeout_ms": 30000
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyurl_patterns(array of strings, required): Array of URL patterns to wait fortimeout_ms(int32, required): Timeout in milliseconds
Response:
{
"index": 1,
"response": {
"url": "https://api.example.com/endpoint2",
"headers": [],
"body": "{}",
"status_code": 200
}
}index(int32): Index of the matching response (0-based)response(object): Response object
ModifyRequest
Modify network requests by adding, editing, or removing headers and optionally changing the request body.
Method: cloudbrowser.BrowserService/ModifyRequestRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"url_pattern": "https://api.example.com/*",
"timeout_ms": 30000,
"modifications": [
{
"name": "Authorization",
"value": "Bearer token123",
"action": 0
},
{
"name": "User-Agent",
"value": "CustomAgent/1.0",
"action": 1
}
],
"body": ""
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keyurl_pattern(string, required): URL pattern to match requests for modificationtimeout_ms(int32, required): Timeout in millisecondsmodifications(array of objects, required): Array of header modificationsbody(string, optional): New request body (only applies to POST requests)- Header modification actions:
0= ADD,1= EDIT,2= REMOVE
Response:
{
"request": {
"method": "GET",
"url": "https://api.example.com/data",
"headers": [
{"name": "Authorization", "value": "Bearer token123"},
{"name": "User-Agent", "value": "CustomAgent/1.0"}
],
"body": "",
"status_code": 0
}
}request(object): Modified request object
SetBlockList
Set URL patterns to block. Requests matching these patterns will be blocked.
Method: cloudbrowser.BrowserService/SetBlockListRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key",
"patterns": [
"https://ads.example.com/*",
"https://tracking.example.com/*"
]
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API keypatterns(array of strings, required): Array of URL patterns to block (supports wildcard*)
Response:
{}Empty response on success.
Cookie Management
GetCookies
Get all browser cookies.
Method: cloudbrowser.BrowserService/GetCookiesRequest:
{
"session_id": "ABC123",
"api_key": "your-api-key"
}session_id(string, required): Session ID from the rent responseapi_key(string, required): Your API key
Response:
{
"cookies": [
{
"name": "session_id",
"value": "abc123",
"domain": ".example.com",
"path": "/"
},
{
"name": "user_pref",
"value": "dark_mode",
"domain": ".example.com",
"path": "/settings"
}
]
}cookies(array of objects): Array of cookie objects with name, value, domain, and path