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

# Links API

> gRPC API for retrieving links representing relationships between users

A Link represents a relationship between two users (e.g. follow)

## API

| Method Name                     | Request Type         | Response Type    | Description                                                    |
| ------------------------------- | -------------------- | ---------------- | -------------------------------------------------------------- |
| GetLink                         | LinkRequest          | Message          | Returns a specific Link                                        |
| GetLinksByFid                   | LinksByFidRequest    | MessagesResponse | Returns Links made by an fid in reverse chron order            |
| GetLinksByTarget                | LinksByTargetRequest | MessagesResponse | Returns LinkAdds for a given target in reverse chron order     |
| GetLinkCompactStateMessageByFid | FidRequest           | MessagesResponse | Returns compact state messages for Links by an fid             |
| GetAllLinkMessagesByFid         | FidTimestampRequest  | MessagesResponse | Returns Links made by an fid with optional timestamp filtering |

## Link Request

| Field       | Type   | Label | Description                                     |
| ----------- | ------ | ----- | ----------------------------------------------- |
| fid         | uint64 |       | Farcaster ID of the user who generated the Link |
| link\_type  | string |       | Type of the Link being requested                |
| target\_fid | uint64 |       | Fid of the target                               |

## LinksByFid Request

| Field       | Type    | Label    | Description                                     |
| ----------- | ------- | -------- | ----------------------------------------------- |
| fid         | uint64  |          | Farcaster ID of the user who generated the Link |
| link\_type  | string  | optional | Type of the Link being requested                |
| page\_size  | uint32  | optional | Number of results to return per page            |
| page\_token | bytes   | optional | Token for pagination                            |
| reverse     | boolean | optional | Whether to return results in reverse order      |

## LinksByTarget Request

| Field       | Type    | Label    | Description                                |
| ----------- | ------- | -------- | ------------------------------------------ |
| target\_fid | uint64  |          | Target Farcaster ID to find links for      |
| link\_type  | string  | optional | Type of the Link being requested           |
| page\_size  | uint32  | optional | Number of results to return per page       |
| page\_token | bytes   | optional | Token for pagination                       |
| reverse     | boolean | optional | Whether to return results in reverse order |

## FidTimestampRequest

| Field            | Type   | Label    | Description                                |
| ---------------- | ------ | -------- | ------------------------------------------ |
| fid              | uint64 |          | Farcaster ID                               |
| page\_size       | uint32 | optional | Number of results to return per page       |
| page\_token      | bytes  | optional | Token for pagination                       |
| reverse          | bool   | optional | Whether to return results in reverse order |
| start\_timestamp | uint64 | optional | Optional timestamp to start filtering from |
| stop\_timestamp  | uint64 | optional | Optional timestamp to stop filtering at    |
