Skip to content
Hoody.com

The Hoody Browser service exposes a REST API for navigating pages, evaluating JavaScript, extracting rendered content, and exporting the visible document. All endpoints target the in-container Browser service reached through the Hoody proxy at the container hostname — they are not part of the control-plane Hoody API.

Every operation requires a browser_id query parameter selecting the browser instance (a 0-based index). Instance creation is automatic unless explicitly disabled with start=false.

Opens a new tab (or reuses an existing one) and navigates to a URL. Returns the resolved tab ID and final URL.

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
startquerybooleanNoControls instance creation behavior. Instances are created automatically unless set to false. When auto-start is disabled globally, set to true to create an instance.
urlquerystringNoThe URL to navigate to
tabIdqueryintegerNoThe ID of the tab to interact with
activequerybooleanNoMake the tab active (focused) after navigation. Default: true
onlyIfNotExistsquerybooleanNoOnly create a new tab if no tab with the same URL exists. Default: false
ignoreGetParametersquerybooleanNoIgnore query parameters when checking for existing URL. Default: false
Terminal window
curl -X GET "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/api/v1/browser/browse?browser_id=0&url=https%3A%2F%2Fexample.com&active=true" \
-H "Authorization: Bearer $HOODY_TOKEN"

Opens a new tab (or reuses an existing one) and navigates to a URL using a JSON request body. Useful when the URL is long or you prefer POST semantics for navigation requests.

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
startquerybooleanNoControls instance creation behavior. Instances are created automatically unless set to false. When auto-start is disabled globally, set to true to create an instance.
FieldTypeRequiredDescription
urlstringYesThe URL to navigate to
tabIdintegerNoThe ID of the tab to interact with
activebooleanNoMake the tab active (focused) after navigation. Default: true
onlyIfNotExistsbooleanNoOnly create a new tab if no tab with the same URL exists. Default: false
ignoreGetParametersbooleanNoIgnore query parameters when checking for existing URL. Default: false
Terminal window
curl -X POST "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/api/v1/browser/browse?browser_id=0" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"active": true
}'

Executes a JavaScript snippet in the context of the last active tab and returns the result. The script parameter accepts base64-encoded input for binary-safe transport.

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
startquerybooleanNoControls instance creation behavior. Instances are created automatically unless set to false. When auto-start is disabled globally, set to true to create an instance.
scriptquerystringYesJavaScript code to execute (can be base64 encoded)
Terminal window
curl -X GET "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/api/v1/browser/eval?browser_id=0&script=document.title" \
-H "Authorization: Bearer $HOODY_TOKEN"

Executes a JavaScript snippet provided in the request body. The body may be JSON (application/json) with a script field or raw JavaScript (text/plain).

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
startquerybooleanNoControls instance creation behavior. Instances are created automatically unless set to false. When auto-start is disabled globally, set to true to create an instance.

The body is required. It may be sent as JSON or raw text:

  • application/json — object with a script field
  • text/plain — raw JavaScript source
FieldTypeRequiredDescription
scriptstringNoJavaScript code to execute. The server rejects requests that omit this field with the MISSING_SCRIPT error code, so it should always be supplied even though the schema marks it optional.
Terminal window
curl -X POST "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/api/v1/browser/eval?browser_id=0" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"script": "document.querySelectorAll(\"a\").length"
}'

Returns the full HTML content of the active page, equivalent to document.documentElement.outerHTML.

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
tabIdqueryintegerNoThe ID of the tab to interact with
startquerybooleanNoControls instance creation behavior. Instances are created automatically unless set to false. When auto-start is disabled globally, set to true to create an instance.
Terminal window
curl -X GET "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/api/v1/browser/html?browser_id=0" \
-H "Authorization: Bearer $HOODY_TOKEN"

Returns the visible text content of the page, equivalent to document.body.innerText.

Terminal window
curl -X GET "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/api/v1/browser/text?browser_id=0" \
-H "Authorization: Bearer $HOODY_TOKEN"

Generates a PDF of the current page. Supports paper format, orientation, background graphics, and uniform margin control.

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
tabIdqueryintegerNoThe ID of the tab to interact with
startquerybooleanNoControls instance creation behavior. Instances are created automatically unless set to false. When auto-start is disabled globally, set to true to create an instance.
urlquerystringNoOptional URL to navigate to before generating the PDF
formatquerystringNoPaper format (e.g. A4, Letter). Default: "Letter"
landscapequerybooleanNoUse landscape orientation. Default: false
printBackgroundquerybooleanNoInclude background graphics. Default: false
marginquerystringNoUniform margin (e.g. 1cm, 0.5in)
Terminal window
curl -X GET "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/api/v1/browser/pdf?browser_id=0&format=A4&landscape=true&printBackground=true&margin=1cm" \
-H "Authorization: Bearer $HOODY_TOKEN" \
--output page.pdf

Navigates to a URL and/or captures a screenshot of a browser tab. The response format depends on the format parameter:

  • png (default) — raw PNG bytes (image/png)
  • jpeg — raw JPEG bytes (image/jpeg)
  • base64 — JSON envelope with a data field containing the base64-encoded image

When url is provided, the browser navigates first and waits for the page to load before capturing. When url is omitted, a screenshot of the current page state is taken.

NameInTypeRequiredDescription
browser_idquerystringYesUnique identifier for the browser instance (0-based index)
startquerybooleanNoControls instance creation behavior. Instances are created automatically unless set to false. When auto-start is disabled globally, set to true to create an instance.
urlquerystringNoThe URL to navigate to
tabIdqueryintegerNoThe ID of the tab to interact with
onlyIfNotExistsquerybooleanNoOnly create a new tab if no tab with the same URL exists. Default: false
ignoreGetParametersquerybooleanNoIgnore query strings when checking for existing URL. Default: false
formatquerystringNoOutput format. Allowed values: "png", "jpeg", "base64". Default: "png"
qualityqueryintegerNoImage quality for JPEG format (0-100)
fullPagequerybooleanNoCapture the entire scrollable page. Default: false
Terminal window
curl -X GET "https://{projectId}-{containerId}-browser-1.{server}.containers.hoody.com/api/v1/browser/screenshot?browser_id=0&url=https%3A%2F%2Fexample.com&format=base64&fullPage=true" \
-H "Authorization: Bearer $HOODY_TOKEN"