Xiaohongshu API: note search, comments and replies

Based on the 2026-10-25 specification snapshot

Quick answer

The Xiaohongshu (RedNote) API exposes three asynchronous task types: keyword search of notes (/xhs/search/task), comments collected from a note URL (/xhs/pushs/task), and public account timelines (/xhs/users/task). Every Xiaohongshu endpoint in the specification uses the xhs abbreviation. Comment tasks let you choose a sort order and include second-layer replies. Data is collected by web crawlers from content publicly published on Xiaohongshu.

Data you get

Fields follow the 2026-10-25 specification snapshot. The snapshot does not enumerate search-result post fields, so rows marked "illustrative sample" are taken from the sample data below; confirm the production fields against your trial data. The snapshot also does not mark linking fields such as post_id and parent_id as required, so confirm their presence with trial data.

DataFieldsEndpoint
Keyword search notes (illustrative sample) url, mblogid, author, author_id, content, tm, metadata_tags, like_count, comment_count, share_count GET /xhs/search/task/{task_id}
Note comments and second-layer replies id, post_id, author, author_id, content, push_type, sentiment, tm, tm_crawler, region GET /xhs/pushs/task/{task_id}
Public account timeline profile, timelines, task GET /xhs/users/task/{task_id}

Endpoints

Base URL: https://api.infominer.io/api/v2. Send your API key in the auth-header request header. Parameters marked * are required.

MethodPathWhat it doesMain parameters
POST /xhs/search/task Creates a note keyword search task with an optional date range and page limit. keyword* end_date max_pages start_date
GET /xhs/search/task/{task_id} Polls a note search task; once DONE it returns notes and total_count, up to 100 per page. task_id* page pageSize
POST /xhs/pushs/task Creates a comment task from a note URL, with sort order, second-layer replies and a duplicate-check switch. post_url* crawl_second_layer get_all order_type
GET /xhs/pushs/task/{task_id} Polls a note comment task; once DONE it returns comments, up to 1000 per page. task_id* page pageSize
POST /xhs/users/task Creates a public account timeline task for an account ID and date range. author_id* endDate* startDate*
GET /xhs/users/task/{task_id} Polls a timeline task; once DONE it returns the profile and the note timeline. task_id*

How to get the data

  1. POST /xhs/search/task with keyword and optional start_date, end_date and max_pages to get a task id.
  2. Poll GET /xhs/search/task/{task_id}: keep waiting at INIT or RUNNING; at DONE the same response carries the notes (data) and total_count (pageSize up to 100); at FAILED, stop and handle the failure.
  3. Pick the notes whose comments you need and POST /xhs/pushs/task with the note URL. order_type can be hot, time or both; crawl_second_layer=true adds second-layer replies; get_all=true turns off the duplicate check and collects every comment.
  4. Read the comments with GET /xhs/pushs/task/{task_id}, up to 1000 per page.
  5. For the posting history of a specific public account, POST /xhs/users/task with author_id, startDate and endDate; once DONE it returns profile and timelines.

curl examples

Create a keyword search task

curl -X POST https://api.infominer.io/api/v2/xhs/search/task \
  -H "auth-header: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"keyword": "护肤日常", "start_date": "2026-06-01", "end_date": "2026-06-30", "max_pages": 3}'

Poll the task by ID

curl "https://api.infominer.io/api/v2/xhs/search/task/$TASK_ID?page=1&pageSize=100" \
  -H "auth-header: YOUR_API_KEY"

Create a comment task from a note URL

curl -X POST https://api.infominer.io/api/v2/xhs/pushs/task \
  -H "auth-header: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"post_url": "https://www.xiaohongshu.com/explore/000000000000000000000001", "order_type": "time", "crawl_second_layer": true}'

Sample JSON

Illustrative data written by hand: accounts are sample_user_n and IDs are obviously fake. These are not real posts.

Task creation response (Illustrative data)

{
  "id": "00000000-0000-4000-8000-000000000001",
  "keyword": "护肤日常",
  "status": "INIT"
}

Poll response once the task is DONE (Illustrative data)

{
  "keyword": "护肤日常",
  "status": "DONE",
  "total_count": 2,
  "task": {
    "id": "00000000-0000-4000-8000-000000000001",
    "status": "DONE"
  },
  "data": [
    {
      "source": "xhs_note",
      "platform": "rednote",
      "url": "https://www.xiaohongshu.com/explore/000000000000000000000001",
      "mblogid": "000000000000000000000001",
      "content": "换季之后我把早晚的护肤步骤简化成四步,记录一下这个月的肤况 #护肤日常",
      "author": "sample_user_1",
      "author_id": "0000000000000001",
      "tm": 1781056800,
      "metadata_tags": [
        "护肤日常",
        "换季保养"
      ],
      "like_count": 120,
      "comment_count": 14,
      "share_count": 6
    },
    {
      "source": "xhs_note",
      "platform": "rednote",
      "url": "https://www.xiaohongshu.com/explore/000000000000000000000002",
      "mblogid": "000000000000000000000002",
      "content": "夜间保湿面膜的使用心得,敏感肌可以先小范围试用",
      "author": "sample_user_2",
      "author_id": "0000000000000002",
      "tm": 1781060400,
      "metadata_tags": [
        "保湿",
        "敏感肌"
      ],
      "like_count": 48,
      "comment_count": 5,
      "share_count": 2
    }
  ]
}

How posts and comments link

Comment tasks are created from the note URL (post_url). Comment records link back to their note through the post_id field and also have push_type, author, author_id and tm. With crawl_second_layer enabled, second-layer replies are collected too; the snapshot does not describe how they are nested in the response or linked to the parent comment, so confirm that with trial data. In the samples, notes are identified by url and mblogid, and authors by author and author_id.

History and limits

  • pageSize caps: 100 for search results, 1000 for comments.
  • Comment tasks run a duplicate check by default; set get_all to true to collect every comment again.
  • Public account timeline tasks require both startDate and endDate (YYYY-MM-DD).
  • How far back keyword search can go, note volume and refresh frequency are confirmed per project scope.
Collection: web crawlers collect content publicly published on each platform. Whether this suits your use depends on the purpose and jurisdiction and is for the buyer's legal team to assess; we can provide a description of sources and collection methods.

Delivery format

All endpoints return JSON. Search and comment tasks carry their data in the poll response once DONE, paged with page and pageSize; timeline polls return profile and timelines. Batch files or other delivery methods are confirmed per project scope.

Request a trial

Tick Xiaohongshu in the form below and tell us the keywords or categories to search, whether you need comments and second-layer replies, and the expected volume. We confirm the scope and reply with the arrangements for the trial and API key.

We use the details you provide only to reply to this inquiry. See our privacy policy. Or email us at [email protected]

FAQ

Why do the Xiaohongshu endpoints start with /xhs/?
Every Xiaohongshu endpoint in the specification uses the xhs abbreviation, for example /xhs/search/task and /xhs/pushs/task.
Can I get the comments and replies under a note?
Yes. Create /xhs/pushs/task with the note URL; set crawl_second_layer to true to include second-layer replies.
Can I search notes within a date range?
Pass start_date and end_date (YYYY-MM-DD) when you create the search task. How far back you can go is confirmed per project scope.
Can I follow the notes of a specific account?
Create a public account timeline task with /xhs/users/task, passing the account ID and a start and end date.
How is the Xiaohongshu data collected?
By web crawlers, from content publicly published on Xiaohongshu. Whether this suits your use depends on the purpose and jurisdiction and is for the buyer's legal team to assess; we can provide a description of sources and collection methods.