01 Why use it
These functions start an account's browser profile and return a link that lets you drive the profile from your own code. What this is good for and how it works is explained below. How to call a function and read the response is in the API catalog.
- You can write your own automation with Playwright, Puppeteer, Selenium and similar tools. GGL starts the profile, holds the session and hands you the link to the browser. Your script does the rest: it opens pages, clicks and reads the data.
- The profile opens on your server, in your anti-detect browser, the very one that is connected to GGL. You do not need a separate server for your automation.
- While your session lasts, the robot leaves that account alone. Farming, statistics upload, registration, login and 2FA do not start, and the farm settings and the account status stay as they are. Other accounts on the same proxy wait too. If the account is busy at that moment, start answers with the
busyerror and the profile does not open. So the robot and your script never fight over one account. - The channel to the browser is already built. If the browser management server, also known as the GGL connector, is installed on your server, the link goes through its port 4888, the same way as the robot's own link. You do not have to set up your own tunnel. Port 4888 is opened when you install the connector by the instructions in the “Integration” section. The management key stands right in the link and takes the place of authorization.
How to drive a browser by link
A Chromium browser can accept commands on a special address. The protocol is called CDP, the Chrome DevTools Protocol. It is the same channel that Chrome's own developer tools use.
An automation tool does not launch a browser of its own. It connects to that address instead. From there it sees the tabs of the running browser and drives them as usual: opens pages, clicks, types and reads the content.
GGL supplies the address. The start function opens the profile in your anti-detect browser and returns a link like ws://…/devtools/browser/… in the connect field. This is the WebSocket address the tool connects to. The second field, expire, tells you when the session ends.
With the connector the link looks like this: ws://server-address:4888/management-key/profile-port/devtools/browser/…. The management key is shown by browser/info, in the code field. Without the connector the link leads straight to the profile port on your server, and that port must be reachable from outside. The key in the link gives access to the browser on your server, so do not publish the link.
How to put the link into Playwright
It takes three steps: call start, take connect from the response and hand it to the tool. Playwright has connect_over_cdp for this. It attaches to a browser that is already running instead of launching a new one. Below is an outline in Python. It is a sketch and not a finished program, so put in your own token and account ID and add error handling.
import requests
from playwright.sync_api import sync_playwright
API = "https://ggl.farm/api/accs"
TOKEN = "123-abcdef" # token: <user id>-<API key>
ACC = 501 # account ID in GGL
def call(name):
r = requests.get(f"{API}/{name}.json", params={"id": TOKEN, "acc": ACC}, timeout=120)
return r.json()
started = call("start")
if started["status"] != "ok":
raise SystemExit(started.get("error")) # for example, busy
try:
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(started["connect"])
context = browser.contexts[0]
page = context.pages[0] if context.pages else context.new_page()
page.goto("https://myaccount.google.com/")
print(page.title())
# your work goes here, and if it takes over half an hour, call("ping")
finally:
call("stop")
The start can take up to a minute and a half, so the request has a 120-second timeout. By then the profile is already open and usually has a context and a tab. The code takes them and creates new ones only if there are none. The stop call sits in finally, so the profile closes even if the script crashes. If the work runs longer than half an hour, add a regular ping call.
In Node.js the same thing is chromium.connectOverCDP(connect). Puppeteer connects with its own call, puppeteer.connect({ browserWSEndpoint: connect }), and takes the same link. Selenium and other tools also have a way to attach to a running browser. Check their documentation for the addresses they accept.
How a session goes
accs/startopens the profile in manual mode for 30 minutes and returnsconnectandexpire, the end time of the session. You can start dead accounts too.accs/pingmoves the end of the session 30 minutes ahead, counting from the moment of the call. Call it at least once every half hour, or the session closes by timeout.accs/stopcloses the profile and frees the account for further work. Call it when you are done and do not wait for the session to close by itself.
02 Starting a browser profile
URLhttps://ggl.farm/api/accs/start.json?id={apitoken}&acc={id}
Starts the browser profile of the account and returns a link to control the profile over the CDP protocol. The profile starts in manual mode for 30 minutes. While the session lasts, the robot leaves that account alone. You can start dead accounts too.
Parameters
| Field | Description |
|---|---|
acc* | Account ID in GGL. |
The start can take up to a minute and a half, so do not set a short request timeout.
If the account already has a session or the robot has taken it, nothing starts and the existing session is not extended. You get the busy error.
Warning! If the profile is already open in the browser, for example opened by you by hand, Vision and OctoBrowser report that it is busy. GGL then stops that profile and answers with the busy error, and the response has a connect field with the value -904 and a debug field with the browser's reply. Repeat the request and the profile starts anew.
Response
| Field | Description |
|---|---|
connect | Link for connecting to the profile over the CDP protocol. |
expire | When the session ends, UNIX timestamp. |
{
"status": "ok",
"connect": "ws://192.168.105.250:4888/9a2b8d41c07e5f36/9222/devtools/browser/d3cd4c0f",
"expire": 1754857600
}
Errors
| Code | Description |
|---|---|
no-id | Account ID is not specified. |
bad-id | Account with this ID was not found. |
no-profile | The account has no browser profile. |
antidetect-browser | Anti-detect browser integration is not set up. |
locked | Another operation with the account is in progress, try again. |
busy | The account is busy with a task, another manual session or the work of another account on the same proxy. Or the browser failed to launch the profile, and GGL then stops the profile and frees the account. |
unpaid | Subscription not paid. |
03 Extending a browser profile session
URLhttps://ggl.farm/api/accs/ping.json?id={apitoken}&acc={id}
Extends the manual session of the browser profile: the end of the session moves 30 minutes ahead, counting from the moment of the call. Call it at least once every half hour, or the session closes by timeout.
Parameters
| Field | Description |
|---|---|
acc* | Account ID in GGL. |
Response
| Field | Description |
|---|---|
expire | New end of the session, UNIX timestamp. |
{
"status": "ok",
"expire": 1754859400
}
Errors
| Code | Description |
|---|---|
no-id | Account ID is not specified. |
bad-id | Account with this ID was not found. |
not-started | The profile is not running in manual mode. |
ping | Failed to extend the session. |
unpaid | Subscription not paid. |
04 Stopping a browser profile
URLhttps://ggl.farm/api/accs/stop.json?id={apitoken}&acc={id}
Stops the manual session. It closes the browser profile and frees the account for further work. Call it when you finish working with the profile, and do not wait for the session to time out. If you do not call it, GGL closes the profile by itself within a minute after the session ends.
Parameters
| Field | Description |
|---|---|
acc* | Account ID in GGL. |
Response
{ "status": "ok" }
Errors
| Code | Description |
|---|---|
no-id | Account ID is not specified. |
bad-id | Account with this ID was not found. |
not-started | The profile is not running in manual mode. |
stop | Failed to stop the profile. |
unpaid | Subscription not paid. |