Skip to content

Commit c5a8ff2

Browse files
authored
Update links-endpoint.mdx
- add subheadings - update to same style as pdf endpoint
1 parent 17b56ef commit c5a8ff2

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,29 @@ import { Tabs, TabItem, Render } from "~/components";
99

1010
The `/links` endpoint retrieves all links from a webpage. It can be used to extract all links from a page, including those that are hidden.
1111

12+
## Endpoint
13+
14+
```txt
15+
https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/links
16+
```
17+
18+
## Required fields
19+
You must provide either `url` or `html`:
20+
- `url` (string)
21+
22+
## Common use cases
23+
24+
- Collect only user-visible links for UX or SEO analysis
25+
- Crawl a site by discovering links on seed pages
26+
- Validate navigation/footers and detect broken or external links
27+
1228
## Basic usage
1329

30+
### Get all links on a page
31+
1432
<Tabs syncKey="workersExamples"> <TabItem label="curl">
1533

16-
This example grabs all links from the Cloudflare Developers homepage.
34+
This example grabs all links from the [Cloudflare Developer's homepage](https://developers.cloudflare.com/).
1735
The response will be a JSON array containing the links found on the page.
1836

1937
```bash

0 commit comments

Comments
 (0)