Skip to main content

json

Creates, updates, deletes, gets or lists a json resource.

Overview

Namejson
TypeResource
Idcloudflare.browser_rendering.json

Fields

The following fields are returned by SELECT queries:

List of targets.

NameDatatypeDescription
idstringTarget ID.
descriptionstringTarget description.
devtoolsFrontendUrlstringDevTools frontend URL.
titlestringTitle of the target.
typestringTarget type (page, background_page, worker, etc.).
urlstringURL of the target.
webSocketDebuggerUrlstringWebSocket URL for debugging this target.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_id, session_idReturns a list of all debuggable targets including tabs, pages, service workers, and other browser contexts.
createinsertaccount_idcacheTTLGets json from a webpage from a provided URL or HTML. Pass prompt or schema in the body. Control page loading with gotoOptions and waitFor* options.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
session_idstringThe session ID.
cacheTTLnumberCache TTL default is 5s. Set to 0 to disable.

SELECT examples

Returns a list of all debuggable targets including tabs, pages, service workers, and other browser contexts.

SELECT
id,
description,
devtoolsFrontendUrl,
title,
type,
url,
webSocketDebuggerUrl
FROM cloudflare.browser_rendering.json
WHERE account_id = '{{ account_id }}' -- required
AND session_id = '{{ session_id }}' -- required
;

INSERT examples

Gets json from a webpage from a provided URL or HTML. Pass prompt or schema in the body. Control page loading with gotoOptions and waitFor* options.

INSERT INTO cloudflare.browser_rendering.json (
actionTimeout,
addScriptTag,
addStyleTag,
allowRequestPattern,
allowResourceTypes,
authenticate,
bestAttempt,
cookies,
custom_ai,
emulateMediaType,
gotoOptions,
html,
prompt,
rejectRequestPattern,
rejectResourceTypes,
response_format,
setExtraHTTPHeaders,
setJavaScriptEnabled,
userAgent,
viewport,
waitForSelector,
waitForTimeout,
url,
account_id,
cacheTTL
)
SELECT
{{ actionTimeout }},
'{{ addScriptTag }}',
'{{ addStyleTag }}',
'{{ allowRequestPattern }}',
'{{ allowResourceTypes }}',
'{{ authenticate }}',
{{ bestAttempt }},
'{{ cookies }}',
'{{ custom_ai }}',
'{{ emulateMediaType }}',
'{{ gotoOptions }}',
'{{ html }}',
'{{ prompt }}',
'{{ rejectRequestPattern }}',
'{{ rejectResourceTypes }}',
'{{ response_format }}',
'{{ setExtraHTTPHeaders }}',
{{ setJavaScriptEnabled }},
'{{ userAgent }}',
'{{ viewport }}',
'{{ waitForSelector }}',
{{ waitForTimeout }},
'{{ url }}',
'{{ account_id }}',
'{{ cacheTTL }}'
RETURNING
errors,
result,
success
;