# 获取用户信息

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v2/crawler/user/info:
    get:
      summary: 获取用户信息
      deprecated: false
      description: >-
        获取用户主页信息。


        返回昵称、头像、简介、性别、IP 属地、粉丝/关注/获赞与收藏数等。


        ### 参数


        | 参数 | 必填 | 形态 | 从哪来 |

        |---|---|---|---|

        | `user_id` | 是 | 24 位十六进制，如 `61b46d790000000010008153` | 主页链接
        `xiaohongshu.com/user/profile/{user_id}`；或 `/search/users` 结果 |


        ### 示例


        ```bash

        curl
        'https://rnote.dev/api/v2/crawler/user/info?user_id=61b46d790000000010008153'
        -H 'X-API-Key: sk-你的Key'

        ```


        ### 返回


        `$.data.data` 主要字段：


        | 字段 | 说明 |

        |---|---|

        | `result` | 基础资料（昵称、头像、简介、性别等） |

        | `ip_location` | IP 属地 |

        | `follows` / `collected` / `liked` | 关注数 / 收藏数 / 获赞数 |

        | `share_link` | 主页分享链接 |

        | `tab_visible` | 主页各 Tab 的可见性 |


        ### 相关


        要拿这个人发过的笔记用 `/user/posted`，收藏的用 `/user/faved`。
      operationId: get_user_info_api_v2_crawler_user_info_get
      tags:
        - 小红书数据接口 V2
        - 小红书数据接口 V2
      parameters:
        - name: user_id
          in: query
          description: 用户ID
          required: true
          example: 61b46d790000000010008153
          schema:
            type: string
            description: 用户ID
            title: User Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: string
          headers: {}
          x-apifox-name: ''
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          headers: {}
          x-apifox-name: ''
      security:
        - API Key: []
          x-apifox:
            schemeGroups:
              - id: 4H00ps_y2oWN0NGjYeLI6
                schemeIds:
                  - API Key
            required: true
            use:
              id: 4H00ps_y2oWN0NGjYeLI6
            scopes:
              4H00ps_y2oWN0NGjYeLI6:
                API Key: []
      x-apifox-folder: 小红书数据接口 V2
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/7909900/apis/api-456970838-run
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
      x-apifox-orders:
        - detail
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          type: string
        ctx:
          type: object
          title: Context
          x-apifox-orders: []
          properties: {}
          x-apifox-ignore-properties: []
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
      x-apifox-orders:
        - loc
        - msg
        - type
        - input
        - ctx
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    API Key:
      type: apikey
      description: '在此输入 API Key (格式: sk-xxx)，所有 /api/v1/* 接口需要携带'
      in: header
      name: X-API-Key
    InternalKey:
      type: apikey
      description: 内部调用方服务密钥（机器平面），形如 `thk-int-{id}-{secret}`。
      in: header
      name: X-Internal-Key
    UserSession:
      type: apikey
      description: 终端用户会话令牌（门户平面），登录后由门户签发。
      in: header
      name: X-User-Session
    StaffSession:
      type: apikey
      description: 管理后台员工会话 cookie（管理平面），登录后种下。
      in: cookie
      name: admin_session
    Combination:
      group:
        - id: 1724839
        - id: 1724840
      type: combination
servers:
  - url: https://rnote.dev
    description: 正式环境
security: []

```
