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

# Xiaohongshu Post Comments

> Public top-level Xiaohongshu comments from a canonical note URL, optionally carrying its public share token. Returns source order, one to twenty comments per page, up to three pages from a fresh bounded source window. Cursors exclude previously returned IDs. Sorting, nested replies, short links and complete thread history are unavailable. Date filters apply only within that window and exclude unknown absolute dates. Relative source timestamps stay in ext.source_time_display; published_at remains null. Empty or invalid upstream results are failures, not proof that a post has no comments.

Read public top-level comments from a canonical Xiaohongshu note URL. This adapter uses the pinned [Xiaohongshu Comments Scraper on Apify](https://apify.com/khadinakbar/xiaohongshu-comments-scraper). It verifies the note and comment identities before returning canonical comments.

Pass an HTTPS `xiaohongshu.com` URL with an `/explore/`, `/discovery/item/`, or `/user/profile/<user>/<note>` path. A public `xsec_token` and `xsec_source` from the shared note URL may improve source access. Redirecting short links are unavailable. No account cookies or private content are accepted.

`limit` is 1–20, default 20. Follow `next_cursor` with the same note, limit and date filters for at most three pages. Each call reads a fresh bounded source window and excludes IDs from earlier pages. Source changes can still affect coverage; this is not a complete thread export. `window_truncated` indicates that the third page has additional visible source rows.

Comments retain source order. Omit `sort`; every explicit sorting option returns 422 without net charge. Nested replies are unavailable. `since` and `until` are inclusive YYYY-MM-DD filters within the current window, so a filtered page can be empty and still have a cursor. Rows with unknown absolute dates are excluded when a date filter is present.

Absolute source timestamps become `published_at`. Relative text such as `03-10` stays in `ext.source_time_display`, with `published_at: null`. Likes, reply counts, verification and total counts remain null when the source does not expose them. Public IP-location labels are retained as source text in `ext.ip_location`.

Failed or empty source output returns an error with no net SocialQuery charge; it does not prove that a note has no comments. Upstream access and trial capacity can change. Identical cached requests and idempotent replays are free; consult the response for actual credits used.


## OpenAPI

````yaml GET /xiaohongshu/post/comments
openapi: 3.1.0
info:
  title: SocialQuery API
  version: '2026-10-09'
  description: >-
    Documented requests for public-source records. Inspect accepted inputs and
    credit amounts, then verify the selected operation before integrating
    preview coverage.
servers:
  - url: https://socialquery.dev/v1
security:
  - apiKey: []
paths:
  /xiaohongshu/post/comments:
    get:
      tags:
        - Xiaohongshu
      summary: Xiaohongshu Post Comments
      description: >-
        Public top-level Xiaohongshu comments from a canonical note URL,
        optionally carrying its public share token. Returns source order, one to
        twenty comments per page, up to three pages from a fresh bounded source
        window. Cursors exclude previously returned IDs. Sorting, nested
        replies, short links and complete thread history are unavailable. Date
        filters apply only within that window and exclude unknown absolute
        dates. Relative source timestamps stay in ext.source_time_display;
        published_at remains null. Empty or invalid upstream results are
        failures, not proof that a post has no comments.
      operationId: get_xiaohongshu_post_comments
      parameters:
        - name: url
          in: query
          required: true
          example: https://www.xiaohongshu.com/explore/6aac8143000000002a007389
          schema:
            type: string
          description: >-
            Canonical HTTPS xiaohongshu.com note URL: explore, discovery/item or
            user/profile/<user>/<note>. Public xsec_token and xsec_source query
            values are supported; short links are unavailable.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 20
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: >-
            Opaque cursor bound to this note, limit and date filters. Up to
            three pages; source ordering may change between requests.
        - name: sort
          in: query
          required: false
          schema:
            type: string
            enum:
              - relevance
              - latest
              - most_liked
          description: >-
            Not implemented by the current source. Omit; any supplied value
            returns 422 without net charge.
        - name: since
          in: query
          required: false
          schema:
            type: string
          description: >-
            Inclusive YYYY-MM-DD filter applied within the bounded source
            window; rows without an absolute timestamp are excluded.
        - name: until
          in: query
          required: false
          schema:
            type: string
          description: >-
            Inclusive YYYY-MM-DD filter applied within the bounded source
            window; rows without an absolute timestamp are excluded.
        - name: Cache-Control
          in: header
          required: false
          example: no-cache
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: false
          example: 7a5e1b4c-2d8f-4a3b-9c1e-6e8b4d2a1f3c
          schema:
            type: string
        - name: X-Max-Credits
          in: header
          required: false
          description: >-
            Optional nonnegative integer cap on the maximum request hold. A live
            request whose hold exceeds this cap returns 422
            CREDIT_BUDGET_EXCEEDED before spending. Metered holds use the
            requested limit; cache hits and successful idempotent replays cost
            zero.
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: >-
            Public top-level Xiaohongshu comments from a canonical note URL,
            optionally carrying its public share token. Returns source order,
            one to twenty comments per page, up to three pages from a fresh
            bounded source window. Cursors exclude previously returned IDs.
            Sorting, nested replies, short links and complete thread history are
            unavailable. Date filters apply only within that window and exclude
            unknown absolute dates. Relative source timestamps stay in
            ext.source_time_display; published_at remains null. Empty or invalid
            upstream results are failures, not proof that a post has no
            comments.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SocialQueryResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        required:
                          - items
                          - returned_count
                          - total
                          - next_cursor
                          - window_truncated
                          - coverage_note
                        properties:
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                comment:
                                  type: object
                                  required:
                                    - id
                                    - post_id
                                    - parent_id
                                    - url
                                    - text
                                    - author
                                    - engagement
                                    - published_at
                                    - ext
                                  properties:
                                    id:
                                      type: string
                                    post_id:
                                      type: string
                                    parent_id:
                                      type: 'null'
                                    url:
                                      type: 'null'
                                    text:
                                      type: string
                                    author:
                                      type: object
                                      properties:
                                        id:
                                          type:
                                            - string
                                            - 'null'
                                        username:
                                          type:
                                            - string
                                            - 'null'
                                        display_name:
                                          type:
                                            - string
                                            - 'null'
                                        url:
                                          type:
                                            - string
                                            - 'null'
                                        avatar_url:
                                          type:
                                            - string
                                            - 'null'
                                        verified:
                                          type:
                                            - boolean
                                            - 'null'
                                    engagement:
                                      type: object
                                      properties:
                                        likes:
                                          type:
                                            - integer
                                            - 'null'
                                          minimum: 0
                                        replies:
                                          type:
                                            - integer
                                            - 'null'
                                          minimum: 0
                                    published_at:
                                      type:
                                        - string
                                        - 'null'
                                    ext:
                                      type: object
                                      properties:
                                        source_time_display:
                                          type:
                                            - string
                                            - 'null'
                                        ip_location:
                                          type:
                                            - string
                                            - 'null'
                                        source_position:
                                          type:
                                            - integer
                                            - 'null'
                                          minimum: 0
                                        source_provider:
                                          type:
                                            - string
                                            - 'null'
                              required:
                                - comment
                          returned_count:
                            type: integer
                            minimum: 0
                          total:
                            type: 'null'
                          next_cursor:
                            type:
                              - string
                              - 'null'
                          window_truncated:
                            type: boolean
                          coverage_note:
                            type: string
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '402':
          $ref: '#/components/responses/Error402'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '405':
          $ref: '#/components/responses/Error405'
        '409':
          $ref: '#/components/responses/Error409'
        '422':
          $ref: '#/components/responses/Error422'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
        '502':
          $ref: '#/components/responses/Error502'
        '503':
          $ref: '#/components/responses/Error503'
        '504':
          $ref: '#/components/responses/Error504'
components:
  schemas:
    SocialQueryResponse:
      type: object
      required:
        - success
        - platform
        - endpoint
        - credits_used
        - credits_remaining
        - request_id
        - cached
        - data
      properties:
        success:
          type: boolean
          const: true
        platform:
          type: string
        endpoint:
          type: string
        credits_used:
          type: integer
          minimum: 0
        credits_remaining:
          type:
            - integer
            - 'null'
        request_id:
          type: string
        cached:
          type: boolean
        data:
          type: object
          additionalProperties: true
          description: >-
            The selected operation determines the resource fields in this
            object. Source data can omit a metric or report it as null.
    SocialQueryError:
      type: object
      required:
        - success
        - platform
        - endpoint
        - credits_used
        - credits_remaining
        - request_id
        - cached
        - error
      properties:
        success:
          type: boolean
          const: false
        platform:
          type: string
        endpoint:
          type: string
        credits_used:
          type: integer
          minimum: 0
        credits_remaining:
          type:
            - integer
            - 'null'
        request_id:
          type: string
        cached:
          type: boolean
        error:
          type: object
          required:
            - code
            - type
            - message
            - status
            - doc_url
          properties:
            code:
              type: string
            type:
              type: string
            message:
              type: string
            status:
              type: integer
            doc_url:
              type: string
              format: uri
  responses:
    Error400:
      description: Upstream rejected the request.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
    Error401:
      description: Missing, expired, invalid, or revoked API key.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
    Error402:
      description: Insufficient SocialQuery credits.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
    Error403:
      description: Key scope or provider policy denied access.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
    Error404:
      description: Endpoint or upstream resource not found.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
    Error405:
      description: HTTP method is not supported.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
    Error409:
      description: Idempotency conflict or request in progress.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
    Error422:
      description: Invalid parameters.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
    Error429:
      description: Request limit reached.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
    Error500:
      description: Request processing failed.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
    Error502:
      description: Upstream service failed.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
    Error503:
      description: Provider or required service is unavailable.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
    Error504:
      description: Upstream service timed out.
      headers:
        X-Request-Id:
          schema:
            type: string
        X-Credits-Used:
          schema:
            type: integer
        X-Credits-Remaining:
          schema:
            type: string
        X-Cache:
          schema:
            type: string
            enum:
              - HIT
              - MISS
              - BYPASS
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SocialQueryError'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````

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