Dynamic Script - execute code and return browser session details.
POST/accounts/{account_id}/browser-rendering/script
Acquires a browser session and runs the provided code in it. The session stays open for reuse; close it with DELETE /devtools/browser/:sessionId or browser.close(), otherwise it ends at the idle timeout.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Query Parameters
Body ParametersJSON
Dynamic Script - execute code and return browser session details.
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/browser-rendering/script \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"code": "code"
}'{
"result": "string",
"success": true
}{
"errors": [
{
"code": 2001,
"message": "Rate limit exceeded"
}
],
"success": false
}Returns Examples
{
"result": "string",
"success": true
}{
"errors": [
{
"code": 2001,
"message": "Rate limit exceeded"
}
],
"success": false
}