---
title: /links - Retrieve links from a webpage · Browser Rendering docs
description: 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.
lastUpdated: 2025-04-29T16:56:49.000Z
source_url:
  html: https://b37efaf9.preview.developers.cloudflare.com/browser-rendering/rest-api/links-endpoint/index.md
  md: https://b37efaf9.preview.developers.cloudflare.com/browser-rendering/rest-api/links-endpoint/
---

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.

## Basic usage

* curl

  This example grabs all links from the Cloudflare Developers homepage. The response will be a JSON array containing the links found on the page.

  ```bash
  curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/links' \
    -H 'Authorization: Bearer <apiToken>' \
    -H 'Content-Type: application/json' \
    -d '{
      "url": "https://developers.cloudflare.com/"
    }'
  ```

  ```json
  {
    "success": true,
    "result": [
      "https://developers.cloudflare.com/",
      "https://developers.cloudflare.com/products/",
      "https://developers.cloudflare.com/api/",
      "https://developers.cloudflare.com/fundamentals/api/reference/sdks/",
      "https://dash.cloudflare.com/",
      "https://developers.cloudflare.com/fundamentals/subscriptions-and-billing/",
      "https://developers.cloudflare.com/api/",
      "https://developers.cloudflare.com/changelog/",
  ```

* TypeScript SDK

  ```typescript
  import Cloudflare from "cloudflare";


  const client = new Cloudflare({
    apiEmail: process.env["CLOUDFLARE_EMAIL"], // This is the default and can be omitted
    apiKey: process.env["CLOUDFLARE_API_KEY"], // This is the default and can be omitted
  });


  const links = await client.browserRendering.links.create({
    account_id: "account_id",
  });


  console.log(links);
  ```

## Advanced usage

In this example we can pass a `visibleLinksOnly` parameter to only return links that are visible on the page.

```bash
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/links' \
  -H 'Authorization: Bearer <apiToken>' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://developers.cloudflare.com/",
    "visibleLinksOnly": true
  }'
```

```json
{
  "success": true,
  "result": [
    "https://developers.cloudflare.com/",
    "https://developers.cloudflare.com/products/",
    "https://developers.cloudflare.com/api/",
    "https://developers.cloudflare.com/fundamentals/api/reference/sdks/",
    "https://dash.cloudflare.com/",
    "https://developers.cloudflare.com/fundamentals/subscriptions-and-billing/",
    "https://developers.cloudflare.com/api/",
    "https://developers.cloudflare.com/changelog/",
```
