Dynamic Script - execute code in an existing browser session.
POST/accounts/{account_id}/browser-rendering/script/{session_id}
Runs the provided code in an existing browser session. The session stays open; 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)
Body ParametersJSON
Dynamic Script - execute code in an existing browser session.
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/browser-rendering/script/$SESSION_ID \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"code": "code"
}'{
"result": "string",
"success": true
}Returns Examples
{
"result": "string",
"success": true
}