Browser bot can extract content, interact with keyboard and mouse events, and execute JavaScript on a website.
This API is based on the Chromium web browser so works exactly like the desktop browser.
To extract live content from the page DOM use the "selector" option which will find page elements by CSS selector and
return the results in the "elements" array. To automate user interactions on a page use the "exec" option, this takes an array of commands
which can be either the special interaction functions (see docs below) or just plain old JavaScript code.
Browser bot will also return useful HTTP status and response data for the given URL so can be handy for monitoring and analysis tasks too.
Timeout in seconds. Give up if still trying to load the page after this number of seconds
delay
no
integer
3
Delay in seconds to wait before capturing any page data, executing selectors or JavaScript
selector
no
string
Extract content from the page DOM using this selector. Commonly known as a CSS selector, you can find a good reference here
exec
no
string
Execute JavaScript on the website. This parameter accepts JavaScript as either a string containing JavaScript or for sending multiple separate statements a JSON array or POST array can also be used. If a statement returns any value it will be returned in the 'exec-results' response. You can also use the following specially defined user interaction functions:
sleep(seconds); Just wait/sleep for the specified number of seconds. click('selector'); Click on the first element matching the given selector. focus('selector'); Focus on the first element matching the given selector. keys('characters'); Send the specified keyboard characters. Use click() or focus() first to send keys to a specific element. enter(); Send the Enter key. tab(); Send the Tab key.
user-agent
no
string
Override the browsers default user-agent string with this one
ignore-certificate-errors
no
boolean
false
Ignore any TLS/SSL certificate errors and load the page anyway
API Response
Parameter
Type
Description
url
string
The requested URL. This may not be the same as the final destination URL, if the URL redirects then it will be set in 'http-redirect-url' and 'is-http-redirect' will also be true
url-valid
boolean
True if the URL supplied is valid
url-components
map
Map containing the URL components for a valid URL:
Parameter
Type
Description
url
string
The complete and final URL
host
string
The host of the URL. Will be either a domain name, sub-domain or IP address
protocol
string
The protocol of the URL. For a website URL this will be either 'https' or 'http'
path
string
The path of the URL. This is the part coming after the host and specifies which resource to load
port
integer
The port of the URL. This is usually 443 for HTTPS and 80 for HTTP unless otherwise specified in the URL
query
map
The query of the URL. Contains a key/value map of any HTTP GET query parameters present in the URL
is-http-redirect
boolean
True if the URL responded with an HTTP redirect
http-redirect-url
string
The redirected URL if the URL responded with an HTTP redirect
is-http-ok
boolean
True if the HTTP status is OK (200)
http-status-code
integer
The HTTP status code the URL returned
http-status-message
string
The HTTP status message the URL returned
content
string
The complete raw, decompressed and decoded page content. Usually will be either HTML, JSON or XML
content-size
integer
The size of the returned content in bytes
mime-type
string
The document MIME type
title
string
The document title
language-code
string
The ISO 2-letter language code of the page. Extracted from either the HTML document or via HTTP headers
server-ip
string
The HTTP servers IP address
server-hostname
string
The HTTP servers hostname (PTR/RDNS record)
load-time
float
The number of seconds taken to load the page (from initial request until DOM ready)
response-headers
map
Map containing all the HTTP response headers the URL responded with
is-secure
boolean
True if the page is secured using TLS/SSL
security-details
map
Map containing details of the TLS/SSL setup
is-error
boolean
True if an error has occurred loading the page. Check the 'error-message' field for details
is-timeout
boolean
True if a timeout occurred while loading the page. You can set the timeout with the request parameter 'timeout'
error-message
string
Contains the error message if an error has occurred ('is-error' will be true)
elements
array
Array containing all the elements matching the supplied selector:
Parameter
Type
Description
class
string
The 'class' attribute of the element
href
string
The 'href' attribute of the element
html
string
The raw HTML of the element
id
string
The 'id' attribute of the element
text
string
The plain-text content of the element with normalized whitespace
exec-results
array
If you executed any JavaScript this array holds the results as objects:
Parameter
Type
Description
statement
string
The JavaScript statement that was executed
result
string
The result of the executed JavaScript statement. Will be empty if the statement returned nothing
API Performance
Characteristic
Value
Description
Avg Latency
1-10s (variable)
This API has a non-deterministic latency based on outside factors
Max Rate
1/second
Maximum inbound request rate. Exceeding this will result in request throttling
Max Concurrency
25
Maximum concurrent/simultaneous requests. Exceeding this will result in error code 06 [TOO MANY CONNECTIONS]