Integration API

Connect GGL to the anti-detect browser, the SMS service and CapMonster without the interface, for example when you move the farm to another server. If something does not work, the journal shows what GGL asked the browser for and what the browser answered. Parameters, errors and sample responses are below.

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/info returns 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/save saves 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, use accs/status.
  • Connect an SMS service. browser/services shows which services there are and what each can do: number rental, sending SMS, a price cap, rental terms and renewal. browser/sms saves 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/captcha saves the API key. You cannot clear it, only replace it.
  • Find out what went wrong. browser/log downloads 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).
Back to contents

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:

FieldDescription
typeBrowser type: 1 — Vision, 2 — OctoBrowser, 3 — AdsPower, 0 — not configured.
nameName of the browser type.
apiBrowser API key.
ipIP address of the server running the browser.
portPort of the browser local daemon. 0 when not set.
headWhether the browser runs in headless mode.
wrapWhether the browser management server is installed. It is also called the GGL connector.
codeManagement key for that server. It stands in the path of the browser link, so do not show it to others.
limitsThread limits: total — overall, reg — for registration, farm — for farming.

Fields of the sms block, the SMS service settings:

FieldDescription
typeService ID. 0 when not configured.
nameService name.
apiService API key.
loginService username. Needed by services with a two-part key.
maxMaximum phone number price.
termNumber rental term in days.
renewWhether automatic rental renewal is on.
balanceBalance at the service. false when no key is set.
capsWhat 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:

FieldDescription
apiCapMonster API key.
balanceCapMonster 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

CodeDescription
unpaidSubscription not paid.
Back to contents

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

FieldDescription
type*Browser type: 1 — Vision, 2 — OctoBrowser, 3 — AdsPower.
api*Browser API key.
ipIP address of the server the browser is installed on. If the IP is wrong, an empty value is saved.
portPort of the browser local daemon. If you do not know what it is, leave it empty.
headWhether to run the browser in headless mode: 0 or 1, 0 by default.
wrapWhether the browser management server, also called the GGL connector, is installed: 0 or 1, 0 by default.
limTotal thread limit on the server.
lim1Thread limit for registration.
lim2Thread 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

CodeDescription
unpaidSubscription not paid.
bad-typeUnknown browser type.
no-apiAPI key is not specified.
Back to contents

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

FieldDescription
currentID of the service selected now. 0 when not configured.
dataList of services. The fields are described below.

Service fields:

FieldDescription
idService ID.
nameService name.
rentThe service can rent phone numbers.
sendThe service can send SMS.
priceThe service supports a number price cap.
termRental terms: an empty string — no term, * — any term from 1 to 365 days, a comma-separated list of days — only those options.
renewThe service supports automatic rental renewal.
termdefDefault rental term, in days.
pricedefDefault maximum price.
loginThe 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

CodeDescription
unpaidSubscription not paid.
Back to contents

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

FieldDescription
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.
smsloginService username, for services with a two-part key (textverified.com).
smsmaxMaximum phone number price, for services that support a price cap.
smstermNumber rental term in days, for services with rental.
smsrenewAutomatic 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

CodeDescription
unpaidSubscription not paid.
bad-typeUnknown service.
no-apiAPI key is not specified.
Back to contents

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

FieldDescription
capmonster*CapMonster API key.

The key cannot be cleared: the function accepts a non-empty value only.

Response

{ "status": "ok" }

Errors

CodeDescription
unpaidSubscription not paid.
no-capmonsterAPI key is not specified.
Back to contents

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

FieldDescription
pagePage number, 1 by default. Pages are numbered from 1.
showHow many records to return per page, 50 by default.
errorFilter by result: 0 — successes only, 1 — errors only.
accAccount ID in GGL. Only the records for this account are shown.
funcName of the browser function. Only the records for this function are shown.

Response

FieldDescription
statusResponse status: ok or error.
pagePage number in the response, usually 1.
showRecords per page, usually 50.
totalHow many records match the filter.
dataList of journal records. The fields are described below.

Record fields:

FieldDescription
idRecord ID.
timeRecord time, UNIX timestamp.
errorWhether there was an error: 0 — success, 1 — error.
accID of the account in GGL the request belongs to.
funcBrowser function the request called.
codeHTTP code of the browser reply.
codeoktrue when the HTTP code is in the 2xx range.
timerHow long the request took, in seconds.
urlAddress the request was sent to.
getRequest parameters from the address, as an array.
postPOST request body as is.
postdataDecoded POST request body, as an array.
replyBrowser reply as is.
headerRequest HTTP headers.
ccAdditional 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

CodeDescription
unpaidSubscription not paid.
Back to contents