Answers

Is collecting Xiaohongshu comments legal under China's personal information law?

Short answer

China's PIPL lets you handle personal information that people made public themselves, but only within a reasonable scope, not where the person has clearly refused, and with consent where the handling significantly affects them. This is general information, so check your project with a lawyer. For aggregate research the lower-risk pattern is to keep comment text without identities: Xiaohongshu comments cost $0.02 a page on okdata, and a fields filter leaves authors out.

The question comes up whenever someone plans a study of what Xiaohongshu users say about a product, a city or a policy. A V2EX thread asks it in exactly those words: is scraping Xiaohongshu comments legal? What follows is general information about the law, not legal advice.

What the law says

The Personal Information Protection Law (full text on the CAC site) is the main reference:

  • Article 4. Personal information is any information about an identified or identifiable person; properly anonymised information is not. A comment with a nickname, avatar and IP location can identify someone.
  • Article 13(6) and Article 27. You may handle information a person made public themselves, or that was otherwise lawfully made public, within a reasonable scope, unless the person clearly refuses. Where the handling significantly affects their rights, you need consent.
  • Article 3. The law also reaches handling outside China when it analyses the behaviour of people in China, which matters for overseas researchers.
  • Articles 19 and 51. Keep data no longer than the purpose needs, and protect it.

Separately from PIPL, platforms have taken data collectors to court for unfair competition, and their user agreements restrict automated collection.

A lower-risk way to run the study

  1. Collect only the fields the research question needs. Comment text, likes and time answer most questions about opinion.
  2. Do not build profiles of individual commenters or link their accounts across platforms.
  3. Report in aggregate and paraphrase quotes so they cannot be searched back to a person.
  4. Set a deletion date for raw data and keep it access-controlled.
import os, requests

URL = "https://api.okdata.online/v1/xiaohongshu/notes/comments/list"
H = {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}

body = requests.get(URL, headers=H, timeout=60, params={
    "id": "6650a1b2000000001e00abcd",
    "fields": "text,likes,published_at",   # no author fields at all
}).json()
comments = body["data"]["items"]

The same filter works on Douyin video comments, $0.002 a page. On Xiaohongshu note comments, 1,000 comments cost $2.00.

Where okdata sits

It returns public data only, with no login, cookie or Xiaohongshu account involved. It does not decide for you what is a reasonable scope for your purpose; you are the one handling the data, so the PIPL questions above are yours to answer with counsel and, for academic work, your ethics review. If your study needs consent anyway, a survey or interviews may serve it better. For turning comments into themes without identities, see word-of-mouth research.

Updated