How to get Xiaohongshu (RedNote) data in Python
Disclosure: I built the Xiaohongshu Scraper used in this tutorial. It's a paid Actor on Apify (pay per result), and the pricing is listed at the end. Xiaohongshu (小红书), known abroad as RedNote, is where Chinese consumers go to decide what to buy. People post reviews, "what I bought" hauls, travel guides and café lists, and other people save those notes to come back to later. For brand research,…
Xiaohongshu (RedNote) is a popular platform in China where consumers share reviews, hauls, travel guides, and café lists. Due to its value for brand and product research, obtaining data from Xiaohongshu can be challenging. This tutorial focuses on extracting data from Xiaohongshu using Python in just 20 lines of code.
The script begins by setting up the environment, requiring Python 3.10 or higher and an Apify account. Replace 'your-token-here' with your personal Apify API token. Install necessary libraries using pip install apify-client pandas and export the API token as APIFY_TOKEN.
The search function starts by querying Xiaohongshu for a specified keyword, like 咖啡 (coffee). Chinese keywords are essential for obtaining accurate results. After running the search, the script loads the results into a pandas DataFrame and ranks the notes based on the save count (collects) versus like count. This ratio helps identify useful content, such as guides or reviews.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.