Skip to content

Commit 17b56ef

Browse files
authored
Update json-endpoint.mdx
- update to same style as pdf endpoint
1 parent 11db532 commit 17b56ef

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/content/docs/browser-rendering/rest-api/json-endpoint.mdx

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,33 @@ By default, the `/json` endpoint leverages [Workers AI](/workers-ai/) for data e
1717

1818
:::
1919

20-
## Basic Usage
20+
## Endpoint
2121

22-
<Tabs syncKey="workersExamples"> <TabItem label="curl">
22+
```txt
23+
https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/json
24+
```
25+
26+
## Required fields
27+
You must provide either `url` or `html`:
28+
- `url` (string)
29+
- `html` (string)
30+
31+
And at least one of:
32+
- `prompt` (string), or
33+
- `response_format` (object with a JSON Schema)
34+
35+
## Common use cases
36+
37+
- Extract product info (title, price, availability) or listings (jobs, rentals)
38+
- Normalize article metadata (title, author, publish date, canonical URL)
39+
- Convert unstructured pages into typed JSON for downstream pipelines
40+
41+
## Basic Usage
2342

2443
### With a Prompt and JSON schema
2544

45+
<Tabs syncKey="workersExamples"> <TabItem label="curl">
46+
2647
This example captures webpage data by providing both a prompt and a JSON schema. The prompt guides the extraction process, while the JSON schema defines the expected structure of the output.
2748

2849
```bash

0 commit comments

Comments
 (0)