Skip to content

Create window browser

Request method and path

html
POST http://localhost:[post]/openapi/window/browser/create?ticket=[OpenApiToken]

Interface function description

Used to create window browsers

Request parameter

Header Request Data

namevaluerequiredtypeExplanation
Content-Typeapplication/jsonYStringapplication/json

Body Request parameter

Parameter NameRequiredtypeExplanation
windowNameYstringCustom window names (between 2 and 30 characters in length)
ipProxySettingYobjectConfiguration information object about the proxy View the detailed description of configuration objects
browserSettingInfoYobjectConfiguration information object about the browser kernel View the detailed description of configuration objects
advancedSettingInfoYobjectAdvanced configuration information object about Windows View the detailed description of configuration objects
shouldChangeFingerprintNboolThe default is true; true: The fingerprint needs to be replaced. Note: When false, the Settings for browserSettingInfo and advancedSettingInfo are invalid because the last opened fingerprint is to be continued
openUrlArrayNstringDefault open links (write only one URL in a line '\r\n', after the URL do not have any modifier added by yourself! And the character length is between 0 and 200)
notesNstringRemarks for the window (characters between 0 and 16)

Request parameter example

json
{
  "windowName": "bj111y",
  "ipProxySetting": {
    "type": "null",
    "host": "11",
    "port": "2324",
    "account": "",
    "password": ""
  },
  "browserSettingInfo": {
    "brand": "chrome",
    "version": "122.0.6261.95"
  },
  "advancedSettingInfo": {
    "webRTC": "disabled",
    "platform": "Win32",
    "useragentMode": "strict"
  },
  "shouldChangeFingerprint": true,
  "openUrlArray": "https://www.baidu.com\r\nhttps://www.51job.com",
  "notes": "窗口的备注信息"
}

Parameter detail

ipProxySetting Description of key values of configuration parameter objects

Parameter NameRequiredtypeExplanation
typeYstring | nullAgent types: [socks5 | HTTPS | HTTP | null]
null for direct mode, don't use the proxy
hostYstringProxy host (200characters or less)
protYstringProxy port (no more than a positive integer string of 65535 or ''
accountNstringAgent's account number (200 characters or less)
passwordNstringAgent's password ( 100characters or less)

browserSettingInfo Description of key values of configuration parameter objects

Parameter Name RequiredtypeExplanation
brandYstring Kernel types and supported kernel versions can be dynamically obtained through interfaces. Click to obtain documents
versionYstring

advancedSettingInfo Description of key values of configuration parameter objects

Parameter NameRequiredtypeExplanation
webRTCYstringwebRTC value:[disabled | really]
platformYstringplatform value:[Win32 | MacIntel| iPhone | iPad| Android]
useragentModeYstringuseragentMode value:[really | common| strict]

openUrlArray Parameter detail

openUrlArray is string type data, the length is between 0 and 200, multiple urls are separated by '\r\n'.

Example of Interface Response Result

Successful Response Example

return parameters

newWindowBrowserKey is the unique identifier of the newly created window.

json
{
  "code": "00000",
  "message": "Success",
  "data": {
    "status": "success",
    "errorCode": "",
    "errorMsg": "",
    "result": {
      "newWindowBrowserKey": 123
    }
  }
}

Example of failed response



Failed to call interface

When the interface response status code is not '00000', the interface call fails.
The specific interface call Reason for error can be queried by viewing the Interface Response Status Code Information Comparison Table.

json
{
  "code": "00001",
  "message": "产生未知错误,请反馈给官方客服!",
  "data": {}
}

This operation failed

json
{
  "code": "00000",
  "message": "Success",
  "data": {
    "status": "failed",
    "errorCode": "E01",
    "errorMsg": "缺少参数(xxx)",
    "result": {}
  }
}

Operation failure errorCode error code information comparison table

Error codeReason for error
E00The format of parameter (xxx) is incorrect!
E01Missing parameter (xxx).
E02The parameters are redundant.
E03Missing parameter (xxx) in ipProxySetting.
E04The parameters in ipProxySetting are redundant.
E05The unique window number key is about to exceed the maximum allowed value of 1000. Please delete some of the later list items and try again!
E06The string length of windowName must be between 2 and 30.
E07ipProxySetting. type [proxy type] must be one of: socks5, https, http, or null and must be filled in (null indicates: direct connection mode, i.e.: no proxy is used).
E08The character length of ipProxySetting.host [proxy host] must be between 1 and 200, and ipProxySetting.host can only be an empty string when ipProxySetting.type is null .
E09ipProxySetting.port The proxy port must be a positive integer string, and ipProxySetting. host can only be an empty string if ipProxySetting. type is null .
E10ipProxySetting.port The proxy port cannot exceed 65535!
E11ipProxySetting.account The character length of the proxy account must be less than or equal to 200 and can be an empty string.
E12ipProxySetting.password The proxy password must be less than or equal to 100 characters in length and can be an empty string.
E13openUrlArray The default open link must have a character length of 200 or less and can be an empty string.
E14Notes: The character length must be less than or equal to 20 and can be an empty string.
E15We are about to exceed the maximum window capacity of 200. Please delete some lists and try again!