Skip to main content
POST
/
v1
/
browsers
/
{id}
/
fetch-html
Fetch HTML
curl --request POST \
  --url https://api.example.com/v1/browsers/{id}/fetch-html/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "selector": "<string>"
}
'
{
  "html": "<html>...</html>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.rustybrowser.com/llms.txt

Use this file to discover all available pages before exploring further.

Description

Returns the HTML source of the current page or a specific element.

Authentication

Authorization: Bearer YOUR_API_KEY
Self-hosted open source deployments do not require authentication.

Path Parameters

id
string
required
The browser ID returned from Create Session.

Request Body

selector
string
CSS selector to scope the HTML to a specific element. If omitted, returns the full page HTML.

Response

html
string
The HTML content of the page or matched element.

Example

curl -X POST https://api.rustybrowser.com/v1/browsers/exc-b9534e98-c3ce-4d1b-9671-b563ac66adc3/fetch-html/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "selector": "body" }'
{
  "html": "<html>...</html>"
}