Skip to main content

Getting Running Browser Instance

Description: This method returns the running browser instance data for the specified profile. The connectionString field contains the WebSocket connection string for connecting to the browser through the Chrome DevTools Protocol (CDP), while processId contains the browser process identifier (PID). If no browser instance is currently running for the profile, the API returns an error.

Request parameters:​

ParameterTypeFormatDefaultDescription
profileIdstringuuid(required)Unique identifier of the profile.
workspaceIdintegerint64-1Workspace identifier. -1 means the default workspace.

Example request:​

POST
CURL:

curl 'http://localhost:8160/v1/browser_instances/get_running?profileId=123e4567-e89b-12d3-a456-426614174000&workspaceId=-1' \
--request POST \
--header 'Api-Token: YOUR_SECRET_TOKEN'

C#:

var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("http://localhost:8160/v1/browser_instances/get_running?profileId=123e4567-e89b-12d3-a456-426614174000&workspaceId=-1"),
Headers =
{
{ "Api-Token", "YOUR_SECRET_TOKEN" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}

Cube:

http://localhost:8160/v1/browser_instances/get_running?profileId=123e4567-e89b-12d3-a456-426614174000&workspaceId=-1

Additionally:
User-Agent: {-Profile.UserAgent-}
Api-Token: Token from UserArea2.

Response API:​

Response codeResult
200 OKOK
401 UnauthorizedUnauthorized
403 ForbiddenForbidden
409 ConflictNo browser instance is running for the specified profile
500 Internal Server ErrorInternal Server Error

Response fields:​

FieldTypeFormatDescription
connectionStringstringWebSocket connection string for connecting to the browser through the Chrome DevTools Protocol (CDP).
processIdintegerint32Browser process identifier (PID).
profileIdstringuuidUnique identifier of the profile.

Success Response (200 OK):

{
"connectionString": "ws://127.0.0.1:12345/devtools/browser/example",
"processId": 1234,
"profileId": "123e4567-e89b-12d3-a456-426614174000"
}

Error Response (500):

{
"message": null
}