# Xiaohongshu Search Result Scraper (by keyword)

Scrape Xiaohongshu (Red Note) post title, image, post URL, author, and author URL from xiaohongshu.com by search result URL.

- Template page: [https://www.octoparse.com/template/xiaohongshu-search-result-scraper-by-keyword](https://www.octoparse.com/template/xiaohongshu-search-result-scraper-by-keyword)
- Categories: Social Media
- Status: `PUBLISHED`
- Run mode: `BOTH`

## Pricing

Free.

## What is an Octoparse template?

An Octoparse template is a ready-to-use scraping workflow with predefined inputs and structured outputs. Use the exact parameter keys below; do not invent parameters.

## Overview

This ready-to-use template collects structured data from search-results pages.

## Output

The current workflow extracts 9 fields, including `Author`, `Author_URL`, `Datetime`, `Details_page_URL`, `Image_URL`, `Input_keywords`, `Like_count`, `Recommended_reason`, `Title`.

## Use Cases

- Use structured results for research, comparison, and monitoring.
- Collect rows without building the extraction workflow from scratch.
- Combine results with other templates for downstream enrichment.
- Review a representative result before starting a large batch.

## Why Octoparse

- **No coding required:** complete Pre-login, Keywords (up to 100 per run) and start the template in local or cloud mode.
- **Flexible export:** review and export results as CSV, Excel, or JSON.

## Input

### Pre-login

Required. 预登录

### Keywords (up to 100 per run)

Required. 听说一个账号每天最多搜索50个关键词，所以先设置100试试。 Constraints: minItems=1; maxItems=100; items.minLength=1; items.maxLength=5000.

## How to Use

# Xiaohongshu Search Result Scraper (by keyword)

Collects search-result records from [Xiaohongshu](https://www.xiaohongshu.com/) with fields: `Input_keywords`, `Title`, `Image_URL`, `Details_page_URL`, `Author`, `Author_URL`, `Datetime`, `Like_count`, `Recommended_reason`.

## Input

- **Pre-login** (Required) – Enable pre-login before searching.
- **Keywords** (Required) – Enter keywords, one per line. Up to 100 entries per run.

## How to Use

1. Open the template and click **Try it!**.
2. Fill **Pre-login** and **Keywords** (see limits above).
3. Choose a local or cloud run in Octoparse and start the task.
4. Export the data in your preferred format.

## Output Fields

- `Input_keywords`
- `Title`
- `Image_URL`
- `Details_page_URL`
- `Author`
- `Author_URL`
- `Datetime`
- `Like_count`
- `Recommended_reason`

## Notes

- This template is **free of charge**; no per-line usage fee. Octoparse plan or resource limits may still apply.
- Keep `Details_page_URL` in exports for traceability.

## Limitations

Results depend on what the source site exposes at run time. Fields may be empty when a source page does not provide a value. The template enforces the input limits shown above.

## Tips

Use specific, valid inputs and review a representative result before starting a large batch. Remove duplicate inputs when repeated records are not needed.

## FAQ

### What do I need to enter?

Use the exact inputs and limits listed above.

### What data does this template return?

See Output Schema below; availability can vary by source record.

### How is usage billed?

See the Pricing section above for current pricing and billing details.

## Related Templates

- [Xiaohongshu Search Results Scraper (by URL)](https://www.octoparse.com/template/xiaohongshu-search-results-scraper)
- [AOL Search Result Scraper](https://www.octoparse.com/template/aol-search-result-scraper)
- [eBay Listing Page Scraper (by keyword)](https://www.octoparse.com/template/ebay-product-list-scraper-by-keyword)
- [Airbnb Scraper (by Keyword)](https://www.octoparse.com/template/airbnb-scraper-by-keyword)
- [Zillow Listing Scraper (by keyword)](https://www.octoparse.com/template/zillow-scraper-by-keywords)

## Input Schema

```json
{
  "title": "Xiaohongshu Search Result Scraper (by keyword) input",
  "description": "Input parameters configured for the current published template version.",
  "type": "object",
  "schemaVersion": 1,
  "additionalProperties": false,
  "properties": {
    "pre-login": {
      "title": "Pre-login",
      "description": "预登录",
      "type": "string",
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "keywords": {
      "title": "Keywords (up to 100 per run)",
      "description": "听说一个账号每天最多搜索50个关键词，所以先设置100试试。",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 5000
      },
      "minItems": 1,
      "maxItems": 100,
      "x-octoparse": {
        "apiEnabled": true
      }
    }
  },
  "required": [
    "pre-login",
    "keywords"
  ]
}
```

## Input JSON Example

Example 1

```json
{
  "keywords": [
    "https://www.xiaohongshu.com/search_result_ai?keyword=%25E9%259D%259E%25E9%2581%2597%25E4%25BD%2593%25E9%25AA%258C&source=web_explore_feed"
  ],
  "pre-login": "acw_tc=0a00daeb17874757377095133e0358238e55d5c7262abcba2e200efd49b4f0;abRequestId=a1220a78-c40e-58f2-9beb-b26483b9eb80;ets=1787476285406;webBuild=6.45.1;xsecappid=xhs-pc-web;loadts=1787476285486;a1=1a02de39835p3gefb6bgqox19991748oyl8czn1i130000375768;webId=8c925c5ae6eb807930787b167534a160;websectiga=3fff3a6f9f07284b62c0f2ebf91a3b10193175c06e4f71492b60e056edcdebb2;sec_poison_id=bcd3cd71-d341-4881-be4a-505c96e0e255;unread={%22ub%22:%226a5ee32e0000000011011553%22%2C%22ue%22:%226a41d35a000000001603cc95%22%2C%22uc%22:27};gid=y08JffD4dKvKy08JfdqjY1Iyq2UqkdiDKDkAY3ylCyjjjSq8yW4Ylu888qW2WKY8y4D0yD0i;web_session=040069b7d9e7d9244cc443ffbf384ba0f3700c;id_token=VjEAAA4nCx4DDQtfcUCUb1tMtwRhu/r89d8x/FzG+w4cPHqxuNNCDnvNJB3xsba5Nn+T5MCZ+JOnz4rAoSc7RGEHCsddHehEaWnyehfkyM1LXPJ7kKIHSkHv0qJQFGZCLFugP6E5;x-rednote-datactry=CN;x-rednote-holderctry=CN"
}
```

Example 2

```json
{
  "keywords": [
    "https://www.xiaohongshu.com/search_result_ai?keyword=%25E9%259D%259E%25E9%2581%2597%25E4%25BD%2593%25E9%25AA%258C&source=web_explore_feed"
  ],
  "pre-login": "acw_tc=0a00daeb17874757377095133e0358238e55d5c7262abcba2e200efd49b4f0;abRequestId=a1220a78-c40e-58f2-9beb-b26483b9eb80;ets=1787476285406;webBuild=6.45.1;xsecappid=xhs-pc-web;loadts=1787476285486;a1=1a02de39835p3gefb6bgqox19991748oyl8czn1i130000375768;webId=8c925c5ae6eb807930787b167534a160;websectiga=3fff3a6f9f07284b62c0f2ebf91a3b10193175c06e4f71492b60e056edcdebb2;sec_poison_id=bcd3cd71-d341-4881-be4a-505c96e0e255;unread={%22ub%22:%226a5ee32e0000000011011553%22%2C%22ue%22:%226a41d35a000000001603cc95%22%2C%22uc%22:27};gid=y08JffD4dKvKy08JfdqjY1Iyq2UqkdiDKDkAY3ylCyjjjSq8yW4Ylu888qW2WKY8y4D0yD0i;web_session=040069b7d9e7d9244cc443ffbf384ba0f3700c;id_token=VjEAAA4nCx4DDQtfcUCUb1tMtwRhu/r89d8x/FzG+w4cPHqxuNNCDnvNJB3xsba5Nn+T5MCZ+JOnz4rAoSc7RGEHCsddHehEaWnyehfkyM1LXPJ7kKIHSkHv0qJQFGZCLFugP6E5;x-rednote-datactry=CN;x-rednote-holderctry=CN"
}
```

Example 3

```json
{
  "keywords": [
    "https://www.xiaohongshu.com/search_result_ai?keyword=%25E9%259D%259E%25E9%2581%2597%25E4%25BD%2593%25E9%25AA%258C&source=web_explore_feed"
  ],
  "pre-login": "acw_tc=0a00daeb17874757377095133e0358238e55d5c7262abcba2e200efd49b4f0;abRequestId=a1220a78-c40e-58f2-9beb-b26483b9eb80;ets=1787476285406;webBuild=6.45.1;xsecappid=xhs-pc-web;loadts=1787476285486;a1=1a02de39835p3gefb6bgqox19991748oyl8czn1i130000375768;webId=8c925c5ae6eb807930787b167534a160;websectiga=3fff3a6f9f07284b62c0f2ebf91a3b10193175c06e4f71492b60e056edcdebb2;sec_poison_id=bcd3cd71-d341-4881-be4a-505c96e0e255;unread={%22ub%22:%226a5ee32e0000000011011553%22%2C%22ue%22:%226a41d35a000000001603cc95%22%2C%22uc%22:27};gid=y08JffD4dKvKy08JfdqjY1Iyq2UqkdiDKDkAY3ylCyjjjSq8yW4Ylu888qW2WKY8y4D0yD0i;web_session=040069b7d9e7d9244cc443ffbf384ba0f3700c;id_token=VjEAAA4nCx4DDQtfcUCUb1tMtwRhu/r89d8x/FzG+w4cPHqxuNNCDnvNJB3xsba5Nn+T5MCZ+JOnz4rAoSc7RGEHCsddHehEaWnyehfkyM1LXPJ7kKIHSkHv0qJQFGZCLFugP6E5;x-rednote-datactry=CN;x-rednote-holderctry=CN"
}
```


## Output Schema

```json
{
  "schemaVersion": 1,
  "type": "object",
  "properties": {
    "Author": {
      "type": "string",
      "description": ""
    },
    "Author_URL": {
      "type": "string",
      "description": ""
    },
    "Datetime": {
      "type": "string",
      "description": ""
    },
    "Details_page_URL": {
      "type": "string",
      "description": ""
    },
    "Image_URL": {
      "type": "string",
      "description": ""
    },
    "Input_keywords": {
      "type": "string",
      "description": ""
    },
    "Like_count": {
      "type": "string",
      "description": ""
    },
    "Recommended_reason": {
      "type": "string",
      "description": ""
    },
    "Title": {
      "type": "string",
      "description": ""
    }
  },
  "title": "Xiaohongshu Search Result Scraper (by keyword) output",
  "description": "Initial output fields derived from the current published implementation. Field descriptions are maintained by Data Center; production field names and types should be refreshed from recent successful runs.",
  "additionalProperties": false
}
```

## Output Example

Example 1

```json
{
  "Author": "小鱼游阿游",
  "Author_URL": "https://www.rednote.com/user/profile/65211b1e0000000024014cef?channel_type=explore_feed&parent_page_channel_type=web_profile_board&xsec_token=ABgUM5xfm2DXaZJ_ja5XBHwPMz64aSoFYuhmduM5cvvUI=&xsec_source=pc_feed",
  "Datetime": "",
  "Details_page_URL": "https://www.rednote.com/discovery/item/69bbaefb000000001b02166f",
  "Image_URL": "https://sns-web-i10.rednotecdn.com/202611240131/583a8c8f64f3536aab54414eb8ac012e/1f448091-7a7a-7407-810d-bb9604e603c1!nc_n_webp_mw_1",
  "Input_keywords": "https://www.xiaohongshu.com/search_result_ai?keyword=%25E9%259D%259E%25E9%2581%2597%25E4%25BD%2593%25E9%25AA%258C&source=web_explore_feed",
  "Like_count": "1203",
  "Recommended_reason": "",
  "Title": "越南｜9天8晚行程分享，共花费3000元💰"
}
```

Example 2

```json
{
  "Author": "-伊慧",
  "Author_URL": "https://www.rednote.com/user/profile/5be07a387a343a00012d8fa5?channel_type=explore_feed&parent_page_channel_type=web_profile_board&xsec_token=ABuoiBVUnShsR27-rli9p42XapXNdYlWPsEQo60APuMHc=&xsec_source=pc_feed",
  "Datetime": "",
  "Details_page_URL": "https://www.rednote.com/discovery/item/69f5e62d000000001e00c51e",
  "Image_URL": "https://sns-web-i10.rednotecdn.com/202611132343/d42e6e013badccf5a4a42145a09a957c/c1aa2d6e-5489-9b52-5f26-dbc11b0a0814!nc_n_webp_mw_1",
  "Input_keywords": "https://www.xiaohongshu.com/search_result_ai?keyword=%25E9%259D%259E%25E9%2581%2597%25E4%25BD%2593%25E9%25AA%258C&source=web_explore_feed",
  "Like_count": "2158",
  "Recommended_reason": "",
  "Title": "最喜欢的旅行照往往不在打卡点"
}
```

Example 3

```json
{
  "Author": "李中凌🐰",
  "Author_URL": "https://www.rednote.com/user/profile/5a6396d511be1075957429f7?channel_type=explore_feed&parent_page_channel_type=web_profile_board&xsec_token=ABDC5YUSps8XB3XctSk4DNzIrg1tX3lDtpynuWgfVZMBA=&xsec_source=pc_feed",
  "Datetime": "",
  "Details_page_URL": "https://www.rednote.com/discovery/item/6a3cef8d000000001700bd1a",
  "Image_URL": "https://sns-web-i10.rednotecdn.com/202611111507/9fbf638229d5beba96cbb38e503c4d18/notes_pre_post/1040g3k8321r6fbud7a004a0vnfbdaafn3hkcfg0!nc_n_webp_mw_1",
  "Input_keywords": "https://www.xiaohongshu.com/search_result_ai?keyword=%25E9%259D%259E%25E9%2581%2597%25E4%25BD%2593%25E9%25AA%258C&source=web_explore_feed",
  "Like_count": "1201",
  "Recommended_reason": "",
  "Title": "Maldives time🐬✨🐚🏖️"
}
```

## API

`POST https://openapi.octoparse.com/api/agentTools/executeTask`

This is the OpenAPI Agent Tools `executeTask` endpoint. Authenticate with a Bearer token.

Request body:

`templateName` is the template slug; `parameters` is a JSON object string whose keys match Input Schema; `taskName`, `idempotencyKey`, and `maxCollectedRows` are optional.

Obtain a token:

```http
POST https://openapi.octoparse.com/token
Content-Type: application/json

{
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD",
  "grant_type": "password"
}
```

Use `data.access_token` as `Authorization: Bearer <token>`. After starting, poll `getTaskStatus` and export with `exportData`.

```json
{
  "templateName": "xiaohongshu-search-result-scraper-by-keyword",
  "taskName": "Xiaohongshu Search Result Scraper (by keyword)",
  "parameters": "{\"keywords\":[\"https://www.xiaohongshu.com/search_result_ai?keyword=%25E9%259D%259E%25E9%2581%2597%25E4%25BD%2593%25E9%25AA%258C&source=web_explore_feed\"],\"pre-login\":\"acw_tc=0a00daeb17874757377095133e0358238e55d5c7262abcba2e200efd49b4f0;abRequestId=a1220a78-c40e-58f2-9beb-b26483b9eb80;ets=1787476285406;webBuild=6.45.1;xsecappid=xhs-pc-web;loadts=1787476285486;a1=1a02de39835p3gefb6bgqox19991748oyl8czn1i130000375768;webId=8c925c5ae6eb807930787b167534a160;websectiga=3fff3a6f9f07284b62c0f2ebf91a3b10193175c06e4f71492b60e056edcdebb2;sec_poison_id=bcd3cd71-d341-4881-be4a-505c96e0e255;unread={%22ub%22:%226a5ee32e0000000011011553%22%2C%22ue%22:%226a41d35a000000001603cc95%22%2C%22uc%22:27};gid=y08JffD4dKvKy08JfdqjY1Iyq2UqkdiDKDkAY3ylCyjjjSq8yW4Ylu888qW2WKY8y4D0yD0i;web_session=040069b7d9e7d9244cc443ffbf384ba0f3700c;id_token=VjEAAA4nCx4DDQtfcUCUb1tMtwRhu/r89d8x/FzG+w4cPHqxuNNCDnvNJB3xsba5Nn+T5MCZ+JOnz4rAoSc7RGEHCsddHehEaWnyehfkyM1LXPJ7kKIHSkHv0qJQFGZCLFugP6E5;x-rednote-datactry=CN;x-rednote-holderctry=CN\"}"
}
```

## Python Example

```python
import json
import requests

OPENAPI_BASE = "https://openapi.octoparse.com"
ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"

parameters = json.loads("{\"keywords\":[\"https://www.xiaohongshu.com/search_result_ai?keyword=%25E9%259D%259E%25E9%2581%2597%25E4%25BD%2593%25E9%25AA%258C&source=web_explore_feed\"],\"pre-login\":\"acw_tc=0a00daeb17874757377095133e0358238e55d5c7262abcba2e200efd49b4f0;abRequestId=a1220a78-c40e-58f2-9beb-b26483b9eb80;ets=1787476285406;webBuild=6.45.1;xsecappid=xhs-pc-web;loadts=1787476285486;a1=1a02de39835p3gefb6bgqox19991748oyl8czn1i130000375768;webId=8c925c5ae6eb807930787b167534a160;websectiga=3fff3a6f9f07284b62c0f2ebf91a3b10193175c06e4f71492b60e056edcdebb2;sec_poison_id=bcd3cd71-d341-4881-be4a-505c96e0e255;unread={%22ub%22:%226a5ee32e0000000011011553%22%2C%22ue%22:%226a41d35a000000001603cc95%22%2C%22uc%22:27};gid=y08JffD4dKvKy08JfdqjY1Iyq2UqkdiDKDkAY3ylCyjjjSq8yW4Ylu888qW2WKY8y4D0yD0i;web_session=040069b7d9e7d9244cc443ffbf384ba0f3700c;id_token=VjEAAA4nCx4DDQtfcUCUb1tMtwRhu/r89d8x/FzG+w4cPHqxuNNCDnvNJB3xsba5Nn+T5MCZ+JOnz4rAoSc7RGEHCsddHehEaWnyehfkyM1LXPJ7kKIHSkHv0qJQFGZCLFugP6E5;x-rednote-datactry=CN;x-rednote-holderctry=CN\"}")

response = requests.post(
    f"{OPENAPI_BASE}/api/agentTools/executeTask",
    headers={
        "Authorization": f"Bearer {ACCESS_TOKEN}",
        "Content-Type": "application/json",
    },
    json={
        "templateName": "xiaohongshu-search-result-scraper-by-keyword",
        "taskName": "Xiaohongshu Search Result Scraper (by keyword)",
        "parameters": json.dumps(parameters, ensure_ascii=False),
    },
    timeout=60,
)
print(response.status_code)
print(response.json())
```

## HTTP/cURL Example

```bash
curl -X POST "https://openapi.octoparse.com/api/agentTools/executeTask" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "templateName": "xiaohongshu-search-result-scraper-by-keyword",
  "taskName": "Xiaohongshu Search Result Scraper (by keyword)",
  "parameters": "{\"keywords\":[\"https://www.xiaohongshu.com/search_result_ai?keyword=%25E9%259D%259E%25E9%2581%2597%25E4%25BD%2593%25E9%25AA%258C&source=web_explore_feed\"],\"pre-login\":\"acw_tc=0a00daeb17874757377095133e0358238e55d5c7262abcba2e200efd49b4f0;abRequestId=a1220a78-c40e-58f2-9beb-b26483b9eb80;ets=1787476285406;webBuild=6.45.1;xsecappid=xhs-pc-web;loadts=1787476285486;a1=1a02de39835p3gefb6bgqox19991748oyl8czn1i130000375768;webId=8c925c5ae6eb807930787b167534a160;websectiga=3fff3a6f9f07284b62c0f2ebf91a3b10193175c06e4f71492b60e056edcdebb2;sec_poison_id=bcd3cd71-d341-4881-be4a-505c96e0e255;unread={%22ub%22:%226a5ee32e0000000011011553%22%2C%22ue%22:%226a41d35a000000001603cc95%22%2C%22uc%22:27};gid=y08JffD4dKvKy08JfdqjY1Iyq2UqkdiDKDkAY3ylCyjjjSq8yW4Ylu888qW2WKY8y4D0yD0i;web_session=040069b7d9e7d9244cc443ffbf384ba0f3700c;id_token=VjEAAA4nCx4DDQtfcUCUb1tMtwRhu/r89d8x/FzG+w4cPHqxuNNCDnvNJB3xsba5Nn+T5MCZ+JOnz4rAoSc7RGEHCsddHehEaWnyehfkyM1LXPJ7kKIHSkHv0qJQFGZCLFugP6E5;x-rednote-datactry=CN;x-rednote-holderctry=CN\"}"
}
JSON
```

## MCP Setup

Connect an MCP-compatible AI client to `https://mcp.octoparse.com` using browser OAuth or an Octoparse API key. Find `xiaohongshu-search-result-scraper-by-keyword`, inspect its inputs, create a cloud task with the exact Input Schema keys, and export JSON results.

## Machine-readable Resources

- [Template contract](https://www.octoparse.com/templates/xiaohongshu-search-result-scraper-by-keyword.json)
- [Manifest](https://www.octoparse.com/templates/xiaohongshu-search-result-scraper-by-keyword-manifest.json)
