01 What the functions do
These functions do what the Integration page does: they set up the link between GGL and the anti-detect browser, the SMS service and CapMonster. You can read and save the settings without the interface. It helps when you move your farm to another server or set it up with your own program. How to call a function and read the response is in the API catalog.
- Read the settings.
browser/inforeturns everything at once: the browser type, its API key, the server address and port, the thread limits, the management key, and the keys and settings of the SMS service and CapMonster. The balances of the SMS service and CapMonster come in the same response, so your own program can watch them. - Set up the browser.
browser/savesaves the browser type (Vision, OctoBrowser or AdsPower), the API key, the server address, the port, headless mode, whether the management server is installed and the thread limits: overall, for registration and for farming. To check that the integration is set up and the server responds, useaccs/status. - Connect an SMS service.
browser/servicesshows which services there are and what each can do: number rental, sending SMS, a price cap, rental terms and renewal.browser/smssaves the chosen one: the service ID, the API key and, if the service supports it, the price, the rental term and renewal. - Set the CapMonster key.
browser/captchasaves the API key. You cannot clear it, only replace it. - Find out what went wrong.
browser/logdownloads the journal of all the requests GGL sent to the anti-detect browser: the address, the sent data and the browser reply. Filter the records by error (error=1), by account (acc) or by browser function (func).
02 Getting integration settings
URLhttps://ggl.farm/api/browser/info.json?id={apitoken}
Returns the current integration settings: the anti-detect browser, the SMS service and CapMonster. This is the same data as the Integration page shows, with your keys.
The function asks the SMS service and CapMonster for their balance, so the first response can take a few seconds.
Response
The data field has three blocks: browser, sms and capmonster. Fields of the browser block, the anti-detect browser settings:
| Field | Description |
|---|---|
type | Browser type: 1 — Vision, 2 — OctoBrowser, 3 — AdsPower, 0 — not configured. |
name | Name of the browser type. |
api | Browser API key. |
ip | IP address of the server running the browser. |
port | Port of the browser local daemon. 0 when not set. |
head | Whether the browser runs in headless mode. |
wrap | Whether the browser management server is installed. It is also called the GGL connector. |
code | Management key for that server. It stands in the path of the browser link, so do not show it to others. |
limits | Thread limits: total — overall, reg — for registration, farm — for farming. |
Fields of the sms block, the SMS service settings:
| Field | Description |
|---|---|
type | Service ID. 0 when not configured. |
name | Service name. |
api | Service API key. |
login | Service username. Needed by services with a two-part key. |
max | Maximum phone number price. |
term | Number rental term in days. |
renew | Whether automatic rental renewal is on. |
balance | Balance at the service. false when no key is set. |
caps | What the service can do: rent — number rental, send — sending SMS, price — price cap, term — rental terms, renew — renewal, termdef and pricedef — default values, login — whether a username is required. |
Fields of the capmonster block, the CapMonster settings:
| Field | Description |
|---|---|
api | CapMonster API key. |
balance | CapMonster balance. false when no key is set. |
{
"status": "ok",
"data": {
"browser": {
"type": 2,
"name": "OctoBrowser (stable)",
"api": "1772f5a9e4c14b8fa3d0c6e85b219d77",
"ip": "192.168.105.250",
"port": 0,
"head": true,
"wrap": true,
"code": "9a2b8d41c07e5f36",
"limits": { "total": 10, "reg": 3, "farm": 7 }
},
"sms": {
"type": 17,
"name": "GGL (rent and send)",
"api": "e03f6c7a90d54e12b8c4f7a1d3e5b926",
"login": "",
"max": 0,
"term": 0,
"renew": true,
"balance": 148.5,
"caps": {
"rent": true,
"send": true,
"price": false,
"term": "",
"renew": true,
"termdef": 0,
"pricedef": 0,
"login": false
}
},
"capmonster": {
"api": "1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d",
"balance": 12.34
}
}
}
Errors
| Code | Description |
|---|---|
unpaid | Subscription not paid. |
03 Configuring the anti-detect browser
URLhttps://ggl.farm/api/browser/save.json?id={apitoken}
Saves the anti-detect browser settings, like the anti-detect browser form on the Integration page. Send the parameters in the POST request body.
Parameters
| Field | Description |
|---|---|
type* | Browser type: 1 — Vision, 2 — OctoBrowser, 3 — AdsPower. |
api* | Browser API key. |
ip | IP address of the server the browser is installed on. If the IP is wrong, an empty value is saved. |
port | Port of the browser local daemon. If you do not know what it is, leave it empty. |
head | Whether to run the browser in headless mode: 0 or 1, 0 by default. |
wrap | Whether the browser management server, also called the GGL connector, is installed: 0 or 1, 0 by default. |
lim | Total thread limit on the server. |
lim1 | Thread limit for registration. |
lim2 | Thread limit for farming. |
Warning! The form rewrites all fields at once, and so does the function. A parameter missing from the request clears its field or resets it to zero.
Response
{ "status": "ok" }
Errors
| Code | Description |
|---|---|
unpaid | Subscription not paid. |
bad-type | Unknown browser type. |
no-api | API key is not specified. |
04 Listing SMS services
URLhttps://ggl.farm/api/browser/services.json?id={apitoken}
Returns the SMS services you can choose from and what each of them can do. The service picker on the Integration page is built from the same list. You need the service ID to configure the SMS service.
Response
| Field | Description |
|---|---|
current | ID of the service selected now. 0 when not configured. |
data | List of services. The fields are described below. |
Service fields:
| Field | Description |
|---|---|
id | Service ID. |
name | Service name. |
rent | The service can rent phone numbers. |
send | The service can send SMS. |
price | The service supports a number price cap. |
term | Rental terms: an empty string — no term, * — any term from 1 to 365 days, a comma-separated list of days — only those options. |
renew | The service supports automatic rental renewal. |
termdef | Default rental term, in days. |
pricedef | Default maximum price. |
login | The service needs a separate username in addition to the API key. |
{
"status": "ok",
"current": 17,
"data": [
{
"id": 17,
"name": "GGL (rent and send)",
"rent": true,
"send": true,
"price": false,
"term": "",
"renew": true,
"termdef": 0,
"pricedef": 0,
"login": false
},
{
"id": 19,
"name": "SMS4G (rental)",
"rent": true,
"send": false,
"price": true,
"term": "",
"renew": false,
"termdef": 0,
"pricedef": 0,
"login": false
},
{
"id": 2,
"name": "textverified.com (rental)",
"rent": true,
"send": false,
"price": false,
"term": "1,3,7,14,30,90,365",
"renew": true,
"termdef": 30,
"pricedef": 0,
"login": true
},
...
]
}
Errors
| Code | Description |
|---|---|
unpaid | Subscription not paid. |
05 Configuring the SMS service
URLhttps://ggl.farm/api/browser/sms.json?id={apitoken}
Saves the SMS service settings, like the SMS service form on the Integration page. First take the service ID and its capabilities from the service list. Send the parameters in the POST request body.
Parameters
| Field | Description |
|---|---|
smstype* | Service ID from the service list. |
smsapi* | Service API key. If the service has a separate username, pass only the key here and the username in smslogin. You can also pass one “username key” value and the service splits it itself. |
smslogin | Service username, for services with a two-part key (textverified.com). |
smsmax | Maximum phone number price, for services that support a price cap. |
smsterm | Number rental term in days, for services with rental. |
smsrenew | Automatic rental renewal (0 or 1), for services that support renewal. |
Warning! The form rewrites all fields at once, and so does the function. A parameter missing from the request resets its setting.
Parameters the service does not support are ignored.
Response
{ "status": "ok" }
Errors
| Code | Description |
|---|---|
unpaid | Subscription not paid. |
bad-type | Unknown service. |
no-api | API key is not specified. |
06 Configuring CapMonster
URLhttps://ggl.farm/api/browser/captcha.json?id={apitoken}
Saves the API key of the CapMonster recognition service, like the CapMonster form on the Integration page. Send the parameters in the POST request body.
Parameters
| Field | Description |
|---|---|
capmonster* | CapMonster API key. |
The key cannot be cleared: the function accepts a non-empty value only.
Response
{ "status": "ok" }
Errors
| Code | Description |
|---|---|
unpaid | Subscription not paid. |
no-capmonster | API key is not specified. |
07 Integration journal
URLhttps://ggl.farm/api/browser/log.json?id={apitoken}
Downloads the integration journal, that is, all the requests GGL sends to the anti-detect browser. These are the same records the Integration journal page shows: request addresses, sent data and browser replies. Records come from newest to oldest, 50 per page.
Parameters
| Field | Description |
|---|---|
page | Page number, 1 by default. Pages are numbered from 1. |
show | How many records to return per page, 50 by default. |
error | Filter by result: 0 — successes only, 1 — errors only. |
acc | Account ID in GGL. Only the records for this account are shown. |
func | Name of the browser function. Only the records for this function are shown. |
Response
| Field | Description |
|---|---|
status | Response status: ok or error. |
page | Page number in the response, usually 1. |
show | Records per page, usually 50. |
total | How many records match the filter. |
data | List of journal records. The fields are described below. |
Record fields:
| Field | Description |
|---|---|
id | Record ID. |
time | Record time, UNIX timestamp. |
error | Whether there was an error: 0 — success, 1 — error. |
acc | ID of the account in GGL the request belongs to. |
func | Browser function the request called. |
code | HTTP code of the browser reply. |
codeok | true when the HTTP code is in the 2xx range. |
timer | How long the request took, in seconds. |
url | Address the request was sent to. |
get | Request parameters from the address, as an array. |
post | POST request body as is. |
postdata | Decoded POST request body, as an array. |
reply | Browser reply as is. |
header | Request HTTP headers. |
cc | Additional CURL request options. |
{
"status": "ok",
"page": 1,
"show": 50,
"total": 100500,
"data": [
{
"id": 100500,
"time": 1754857600,
"error": 0,
"acc": 101,
"func": "start",
"code": 200,
"codeok": true,
"timer": 0.412,
"url": "http:\/\/192.168.105.250:58307\/status",
"get": false,
"post": false,
"postdata": false,
"reply": "{\"code\":0,\"data\":{\"ghost\":0}}",
"header": "X-Octo-Api-Token: 1772f5a9e4c14b8fa3d0c6e85b219d77",
"cc": false
},
...
]
}
Errors
| Code | Description |
|---|---|
unpaid | Subscription not paid. |