API Basics
Data Tools
WWW
★  Browser Bot
HTML Clean
URL Info
Telephony
Geolocation
Security and Networking
E-commerce
Imaging
Legacy APIs

Browser Bot

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.

End Point

https://neutrinoapi.net/browser-bot
Test API
API Request
ParameterRequiredTypeDefaultDescription
urlyesstringThe URL to load
timeoutnointeger30Timeout in seconds. Give up if still trying to load the page after this number of seconds
delaynointeger3Delay in seconds to wait before capturing any page data, executing selectors or JavaScript
selectornostringExtract content from the page DOM using this selector. Commonly known as a CSS selector, you can find a good reference here
execnostringExecute 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-agentnostringOverride the browsers default user-agent string with this one
ignore-certificate-errorsnobooleanfalseIgnore any TLS/SSL certificate errors and load the page anyway
API Response
ParameterTypeDescription
urlstringThe 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-validbooleanTrue if the URL supplied is valid
url-componentsmapMap containing the URL components for a valid URL:
ParameterTypeDescription
urlstringThe complete and final URL
hoststringThe host of the URL. Will be either a domain name, sub-domain or IP address
protocolstringThe protocol of the URL. For a website URL this will be either 'https' or 'http'
pathstringThe path of the URL. This is the part coming after the host and specifies which resource to load
portintegerThe port of the URL. This is usually 443 for HTTPS and 80 for HTTP unless otherwise specified in the URL
querymapThe query of the URL. Contains a key/value map of any HTTP GET query parameters present in the URL
is-http-redirectbooleanTrue if the URL responded with an HTTP redirect
http-redirect-urlstringThe redirected URL if the URL responded with an HTTP redirect
is-http-okbooleanTrue if the HTTP status is OK (200)
http-status-codeintegerThe HTTP status code the URL returned
http-status-messagestringThe HTTP status message the URL returned
contentstringThe complete raw, decompressed and decoded page content. Usually will be either HTML, JSON or XML
content-sizeintegerThe size of the returned content in bytes
mime-typestringThe document MIME type
titlestringThe document title
language-codestringThe ISO 2-letter language code of the page. Extracted from either the HTML document or via HTTP headers
server-ipstringThe HTTP servers IP address
server-hostnamestringThe HTTP servers hostname (PTR/RDNS record)
load-timefloatThe number of seconds taken to load the page (from initial request until DOM ready)
response-headersmapMap containing all the HTTP response headers the URL responded with
is-securebooleanTrue if the page is secured using TLS/SSL
security-detailsmapMap containing details of the TLS/SSL setup
is-errorbooleanTrue if an error has occurred loading the page. Check the 'error-message' field for details
is-timeoutbooleanTrue if a timeout occurred while loading the page. You can set the timeout with the request parameter 'timeout'
error-messagestringContains the error message if an error has occurred ('is-error' will be true)
elementsarrayArray containing all the elements matching the supplied selector:
ParameterTypeDescription
classstringThe 'class' attribute of the element
hrefstringThe 'href' attribute of the element
htmlstringThe raw HTML of the element
idstringThe 'id' attribute of the element
textstringThe plain-text content of the element with normalized whitespace
exec-resultsarrayIf you executed any JavaScript this array holds the results as objects:
ParameterTypeDescription
statementstringThe JavaScript statement that was executed
resultstringThe result of the executed JavaScript statement. Will be empty if the statement returned nothing
API Performance
CharacteristicValueDescription
Avg Latency1-10s (variable)This API has a non-deterministic latency based on outside factors
Max Rate1/secondMaximum inbound request rate. Exceeding this will result in request throttling
Max Concurrency25Maximum concurrent/simultaneous requests. Exceeding this will result in error code 06 [TOO MANY CONNECTIONS]

API Example
curl https://neutrinoapi.net/browser-bot \ --header "User-ID: <your-user-id>" \ --header "API-Key: <your-api-key>" \ --data-urlencode "delay=3" \ --data-urlencode "ignore-certificate-errors=false" \ --data-urlencode "selector=.button" \ --data-urlencode "url=https://www.neutrinoapi.com/" \ --data-urlencode "timeout=30" \ --data-urlencode "exec=[click('#button-id'), sleep(1), click('.class'), keys('1234'), enter()]" \ --data-urlencode "user-agent="
{ content: "\n \n \n \n \n \n \n \n \n \n \n \n \n..." elements: [ { class: "button button-selected", href: "https://www.neutrinoapi.com/", html: "Overview", id: "", text: "Overview" }, { class: "button ", href: "https://www.neutrinoapi.com/api/api-basics/", html: "API Docs", id: "", text: "API Docs" }, { class: "button ", href: "https://www.neutrinoapi.com/plans/", html: "Plans", id: "", text: "Plans" }, { class: "button ", href: "https://www.neutrinoapi.com/signup/", html: "Sign Up", id: "", text: "Sign Up" }, { class: "button ", href: "https://www.neutrinoapi.com/updates/", html: "Updates", id: "", text: "Updates" }, { class: "button ", href: "https://www.neutrinoapi.com/status/", html: "Status", id: "", text: "Status" }, { class: "button ", href: "https://www.neutrinoapi.com/about-us/", html: "About", id: "", text: "About" }, { class: "button ", href: "https://www.neutrinoapi.com/contact-us/", html: "Contact", id: "", text: "Contact" }, { class: "button ", href: "https://www.neutrinoapi.com/account/login/", html: "Login", id: "", text: "Login" }, { class: "button button-selected", href: "https://www.neutrinoapi.com/", html: "Overview", id: "", text: "Overview" }, { class: "button ", href: "https://www.neutrinoapi.com/api/api-basics/", html: "API Docs", id: "", text: "API Docs" }, { class: "button ", href: "https://www.neutrinoapi.com/plans/", html: "Plans", id: "", text: "Plans" }, { class: "button ", href: "https://www.neutrinoapi.com/signup/", html: "Sign Up", id: "", text: "Sign Up" }, { class: "button ", href: "https://www.neutrinoapi.com/updates/", html: "Updates", id: "", text: "Updates" }, { class: "button ", href: "https://www.neutrinoapi.com/status/", html: "Status", id: "", text: "Status" }, { class: "button ", href: "https://www.neutrinoapi.com/about-us/", html: "About", id: "", text: "About" }, { class: "button ", href: "https://www.neutrinoapi.com/contact-us/", html: "Contact", id: "", text: "Contact" }, { class: "button ", href: "https://www.neutrinoapi.com/account/login/", html: "Login", id: "", text: "Login" } ], error-message: "", exec-results: [], http-redirect-url: "", http-status-code: 200, http-status-message: "OK", is-error: false, is-http-ok: true, is-http-redirect: false, is-secure: true, is-timeout: false, language-code: "en", load-time: 0.734146792, mime-type: "text/html", response-headers: { alt-svc: "h3=\ content-encoding: "gzip", content-security-policy: "default-src 'self'; base-uri 'none'; object-src 'none'; frame-ancestors 'none'..." content-type: "text/html; charset=UTF-8", date: "Sun, 04 Aug 2024 22:55:05 GMT", referrer-policy: "strict-origin", server: "nginx", strict-transport-security: "max-age=31536000", via: "1.1 google", x-content-type-options: "nosniff" }, security-details: { cipher: "AES_128_GCM", issuer: "GlobalSign RSA OV SSL CA 2018", protocol: "TLS 1.3", subject-name: "*.neutrinoapi.com" }, server-ip: "35.244.243.139", title: "Neutrino API - Power tools for Developers", url: "https://www.neutrinoapi.com/" }