Urgent.News

What's breaking now, across thousands of outlets.

Tech

Monitor what Xiaohongshu (RedNote) users say about a brand in Python

I build Qovia, the API used in this post. The pipeline itself (search, enrich, collect comments, append to CSV, summarize) works with any Xiaohongshu data source; the CSV and pandas parts are plain Python. Xiaohongshu (小红书, called RedNote outside China) is where Chinese consumers post reviews, shopping hauls, "is it worth it?" comparisons and complaints. For a consumer brand that sells in China,…

This tutorial outlines how to create a Python script to monitor Xiaohongshu (RedNote) users' comments about a specific brand. Xiaohongshu is a platform where Chinese consumers share reviews, shopping hauls, price comparisons, and complaints about products. The comment sections on this platform often contain more honest feedback than the actual notes themselves, as users ask questions like where they purchased the item, if it broke, or if it's an advertisement.

The script utilizes the Qovia API to search for recent Xiaohongshu notes mentioning the brand, fetch the details of the most engaged notes, collect the first pages of comments under those notes, and store the data in CSV files. The script summarizes the results using pandas to provide daily volume, top notes, hashtags, commenters' locations, and a keyword tally.

To set up the script, you need Python 3.9 or higher, along with the requests and pandas libraries. Create an API key from the Qovia console and set it as the environment variable QOVIA_KEY. The script provides a helper function to make requests to the Qovia API, handling authentication and error responses.

The monitoring process involves searching for recent Xiaohongshu notes that mention the brand using the /v1/raw/xiaohongshu/search endpoint. The search parameters can be customized, such as sorting by relevance, the latest notes, most liked, most commented, or most saved. The script also allows filtering notes by type (all, video, or image) and time frame (day, week, month, or year). After collecting the required data, the script stores the results in CSV files and summarizes them using pandas.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The 1280 720 Lesson: Why a Zip Isn't Shippable Until It Has a Cover"**

The 1280×720 Lesson: Why a Zip Isn't Shippable Until It Has a Cover I zipped my first product and uploaded it. Then I looked at it in the store back end and felt something drop in my stomach.

  • Zipping and uploading products without cover is incomplete
  • packproduct.py ensures zip, cover, and thumbnail are created together
  • makemetadata.py generates correct CSV files for each channel

More from Friday 30 October →