Skip to content

Commit d29d703

Browse files
authored
Update links-endpoint.mdx
update - new parameter for excluding external links
1 parent d1fff10 commit d29d703

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ console.log(links);
123123
</TabItem> </Tabs>
124124
## Advanced usage
125125

126+
### Retrieve only visible links
127+
126128
In this example we can pass a `visibleLinksOnly` parameter to only return links that are visible on the page.
127129

128130
```bash
@@ -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+
In this example we can pass a `excludeExternalLinks` parameter to only return links that are from the same domain of the site. Default setting is `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"

0 commit comments

Comments
 (0)