# 用户推荐

## <mark style="color:blue;">GET</mark> /api/v1/recommend

* 说明：Social Graph推荐引擎根据用户twitter关注、以太坊链上交易、持有的nft、当前following的用户等信息进行用户推荐
* Header

| Field         | Type   | Remarks                                                                                        |
| ------------- | ------ | ---------------------------------------------------------------------------------------------- |
| ApiKey        | String | 从管理员获取的[ApiKey](https://relationlabs.gitbook.io/relation-one-api/api-zh/guide/glossary#apikey) |
| Authorization | String | Bearer ${unifiedAuthToken} ,其中unifiedAuthToken来自/api/v1/auth接口的返回                              |

* Request Parameters

| Field  | Type   | Remarks                         |
| ------ | ------ | ------------------------------- |
| limit  | int    | 每次查询数量，上限100                    |
| cursor | string | 上一页返回的 cursor数据,cursor为空表示查询第一页 |

* Request Example

```shell
curl GET 'https://api.relationlabs.ai/api/v1/recommend?cursor=a604fdd8e80142dfaf07af11096d5150&limit=10' \
--header 'Authorization: Bearer ey1JhbGciOiJFUzI1NiJ9.eyJqdGkiOiIyYzAzYTMwZGY4NjY0Mjk5OWZlMDcwODhh1MzVhNGU0YiIsImlzcyI6InJlbGF0aW9ubGFicy5haSIsImlhdCI6MTY2MTQwNTQxOSwic3ViIjoiYmFmMzQta2lhYWEtYWFhYWstYWNnamEtY2FpIiwiZXhwIjoxNjYyMDEwMjE5fQ.1EVbUxmtVCm6aEVZtEAji1KuCM1dsZEOMExcYvT-GdKrHRQ1qzyghXsNZSdSDUAwoSe9jGV48_1zdi2Rlrylw3Q' \
--header 'ApiKey: <ApiKey>'
```

* Response Parameters

| Field | Type              | Remarks |
| ----- | ----------------- | ------- |
| code  | String            | 返回码     |
| desc  | String            | 返回信息    |
| data  | RecommendResponse | 数据      |

The RecommendResponse field consists of the following subfields:

| Field  | Type                 | Remarks    |
| ------ | -------------------- | ---------- |
| cursor | String               | 游标         |
| list   | List\[RecommendUser] | follower列表 |

The RecommendUser field consists of the following subfields:

| Field           | Type    | Remarks                                                                                                   |
| --------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| relationId      | String  | 用户id                                                                                                      |
| name            | String  | 用户姓名                                                                                                      |
| avatar          | String  | 用户头像                                                                                                      |
| recommendReason | String  | 推荐理由:Following on twitterCounterparty on ethereumHolder of ${nft name}Followed by ${followingUser's name} |
| following       | boolean | 是否关注：true-已关注；false-未关注                                                                                   |

* Response Body

```json
{
  "code": "0",
  "desc": "success",
  "data": {
    "cursor": "a8728c5910a04c94b70e18694d72cbb0",
    "list": [
      {
        "relationId": "aoafg-eqaaa-aaaaj-afena-cai",
        "name": "test_user",
        "avatar": "https://3fypb-gqaaa-aaaag-aaedq-cai.ic1.io/avatar/nft/eth/0xed5af388653567af2f388e6224dc7c4b3241c544/1.jpg",
        "recommendReason": "Holder of Azuki",
        "following": false
      },
      ...
    ]
  }
}
```

* Return Code

| code | desc    | Remarks |
| ---- | ------- | ------- |
| 0    | success | 接口调用成功  |
