Get HTML content.
Fetches rendered HTML content from provided URL or HTML. Check available options like gotoOptions and waitFor* to control page load behaviour.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Accepted Permissions (at least one required)
Query Parameters
Body ParametersJSON
The maximum duration allowed for the browser action to complete after the page has loaded (such as taking screenshots, extracting content, or generating PDFs). If this time limit is exceeded, the action stops and returns a timeout error.
Only allow requests that match the provided regex patterns, eg. ’/^.*.(css)’.
Set the content of the page, eg: <h1>Hello World!!</h1>. Either html or url must be set.
Get HTML content.
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/browser-rendering/content \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"html": "<h1>Hello World!</h1>",
"url": "https://www.example.com/"
}'{
"meta": {
"status": 0,
"title": "title"
},
"success": true,
"errors": [
{
"code": 0,
"message": "message"
}
],
"result": "result"
}{
"errors": [
{
"code": 2001,
"message": "Rate limit exceeded"
}
],
"success": false
}Returns Examples
{
"meta": {
"status": 0,
"title": "title"
},
"success": true,
"errors": [
{
"code": 0,
"message": "message"
}
],
"result": "result"
}{
"errors": [
{
"code": 2001,
"message": "Rate limit exceeded"
}
],
"success": false
}