> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getclean.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> getclean's own MCP server is at https://mcp.getclean.ai/mcp. The /mcp path of this docs site is Mintlify's search over these pages, not getclean.
> Every answer of the API opens with outcome. A page that could not be read is a record whose outcome says why, never an HTTP error; read outcome before anything else.
> The API's contract is the OpenAPI 3.1 file at https://docs.getclean.ai/openapi.yaml; the SDKs are generated from it.
> The product's name is written getclean, in lower case.

# Follow a page to the documents it links to

> List every link of a stored page with its kind and its place on the page. Take the links to files, and fetch each file as a record. A deadline inside a linked PDF is then read, not missed.

A funding call is a short web page. The rules and the deadline are in a PDF that the page links to, and an agent that reads only the page reports the call without them. `list_links` returns the links of a record, which is the copy of a source that getclean stores after a fetch or an upload. Each link has a kind, so the links to files can be told from the links to other pages.

## List the links to files

Send the id of the record and the kind of link you want.

```bash cURL theme={"theme":"css-variables"}
curl "https://api.getclean.ai/v1/contents/CONTENTS_ID/links?link_kinds=file" \
  --header "Authorization: Bearer $GETCLEAN_API_KEY"
```

```python Python theme={"theme":"css-variables"}
from getclean import GetClean

client = GetClean()

links = client.list_links(contents_id="CONTENTS_ID", link_kinds=["file"])
for link in links:
    print(link.text, link.url)
```

```typescript TypeScript theme={"theme":"css-variables"}
import { GetClean } from "getclean";

const client = new GetClean();

const links = await client.listLinks("CONTENTS_ID", { link_kinds: ["file"] });
for await (const link of links) {
    console.log(link.text, link.url);
}
```

Replace `CONTENTS_ID` with the id of a record.

The links come in the order of the page. This response is cut to its one link, and the link to the fields that say what it is.

```json 200 OK theme={"theme":"css-variables"}
{
  "links": [
    {
      "url": "https://example.com/q3/report.pdf",
      "text": "Full report",
      "kind": "file",
      "external": false
    }
  ]
}
```

A link also names the block and the section it is in, so you know whether it is in the text of the call or in a list of related pages.

## Choose the kinds of link

`link_kinds` takes any of 7 values.

| Kind | What the link points to |
| - | - |
| `file` | A file, such as a PDF. |
| `page` | Another page. |
| `fragment` | A place on the same page. |
| `mail` | An email address. |
| `phone` | A phone number. |
| `feed` | An RSS or Atom feed. |
| `other` | Anything else. |

The kind is read from the link's address. No request is made to the address, so a link has no size and no type as served, and a file behind an address without a file ending comes as `page`. The fetch of the link says what it is.

`external` set to `true` returns only the links that leave the site, and `false` only the links that stay on it. `section_id` returns only the links of one section.

## Fetch the linked files

Each file is a source of its own. Fetch the addresses in one batch of up to 20, and each comes back as a record with its outline, its sections, and its pages. For the request, see [Fetch 20 sources at once and know what came back before you read a word](https://docs.getclean.ai/read/many-pages-at-once.md).

A fetch can also return the links itself. With `links` in `formats`, the response has up to 1,000 links of the page. `list_links` has all of them.

## Check what a list of links costs

`list_links` reads the stored record, so it costs nothing. The key needs the scope `contents:read`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.