Skip to content

Commit 0afe6e5

Browse files
Update links-endpoint.mdx (#25180)
* Update links-endpoint.mdx update - new parameter for excluding external links * Update links-endpoint.mdx wording changes to new excludeEternalLinks example * Update browser-rendering.yaml changelog entry * Update src/content/docs/browser-rendering/rest-api/links-endpoint.mdx Co-authored-by: Dostrelith <[email protected]> * Update src/content/docs/browser-rendering/rest-api/links-endpoint.mdx Co-authored-by: Dostrelith <[email protected]> * Update browser-rendering.yaml change date * Update browser-rendering.yaml date update * Update browser-rendering.yaml date update --------- Co-authored-by: Dostrelith <[email protected]>
1 parent ba9783b commit 0afe6e5

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ console.log(links);
123123
</TabItem> </Tabs>
124124
## Advanced usage
125125

126-
In this example we can pass a `visibleLinksOnly` parameter to only return links that are visible on the page.
126+
### Retrieve only visible links
127+
128+
Set the `visibleLinksOnly` parameter to `true` to only return links that are visible on the page. By default, this is set to `false`.
127129

128130
```bash
129131
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/links' \
@@ -213,6 +215,20 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
213215
}
214216
```
215217

218+
### Retrieve only links from the same domain
219+
220+
Set the `excludeExternalLinks` parameter to `true` to exclude links pointing to external domains. By default, this is set to `false`.
221+
222+
```bash
223+
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/links' \
224+
-H 'Authorization: Bearer <apiToken>' \
225+
-H 'Content-Type: application/json' \
226+
-d '{
227+
"url": "https://developers.cloudflare.com/",
228+
"excludeExternalLinks": true
229+
}'
230+
```
231+
216232
<Render
217233
file="setting-custom-user-agent"
218234
product="browser-rendering"

src/content/release-notes/browser-rendering.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ link: "/browser-rendering/changelog/"
33
productName: Browser Rendering
44
productLink: "/browser-rendering/"
55
entries:
6+
- publish_date: "2025-09-22"
7+
title: Added `excludeExternalLinks` parameter to `/links` REST endpoint
8+
description: |-
9+
* Added `excludeExternalLinks` parameter when using the [`/links` endpoint](/browser-rendering/rest-api/links-endpoint/). When set to `true`, links pointing to outside the domain of the requested URL are excluded.
610
- publish_date: "2025-09-02"
711
title: Added `X-Browser-Ms-Used` response header
812
description: |-

0 commit comments

Comments
 (0)