{
  "openapi": "3.0.1",
  "info": {
    "title": "Xiaohongshu (RedNote) Scraper — Notes, Profiles & Search",
    "description": "Scrape Xiaohongshu (RedNote) notes, creator profiles, comments, and keyword search. Get likes, collects, images, video URLs, and hashtags — explore and note pages work with no login. Export JSON via API, Python, Node.js, or MCP.",
    "version": "0.1",
    "x-build-id": "jdD2CP1hXyVeSddeO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawloop~xiaohongshu-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawloop-xiaohongshu-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/crawloop~xiaohongshu-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawloop-xiaohongshu-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/crawloop~xiaohongshu-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawloop-xiaohongshu-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "explore",
              "note_detail",
              "user_profile",
              "user_notes",
              "search_notes",
              "search_users",
              "comments"
            ],
            "type": "string",
            "description": "What to scrape. Explore, note detail, and profiles work without a login cookie. Keyword search, user search, and comments need a logged-in web_session cookie.",
            "default": "explore"
          },
          "startUrls": {
            "title": "Note URLs / IDs",
            "type": "array",
            "description": "Note pages for note_detail and comments. Prefer the full URL with ?xsec_token=… (copy from the address bar or from explore/search output). Also accepts xhslink.com share links and bare 24-character note IDs.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "userUrls": {
            "title": "Profile URLs / user IDs",
            "type": "array",
            "description": "Creator profiles for user_profile and user_notes (https://www.xiaohongshu.com/user/profile/… or a 24-character user ID).",
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Single search term (Chinese or English) for search_notes / search_users. Merged with Keywords.",
            "default": ""
          },
          "keywords": {
            "title": "Keywords (multi)",
            "type": "array",
            "description": "Extra search terms. Each keyword is scraped independently up to Max items.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "channel": {
            "title": "Explore channel",
            "enum": [
              "recommend",
              "fashion",
              "food",
              "cosmetics",
              "movie_and_tv",
              "career",
              "emotion",
              "household",
              "gaming",
              "travel",
              "fitness",
              "video"
            ],
            "type": "string",
            "description": "Public SSR explore feed is Xiaohongshu's recommend homefeed. Other channels need a cookie (signed homefeed); without one this Actor falls back to recommend.",
            "default": "recommend"
          },
          "xsecToken": {
            "title": "xsec_token (fallback)",
            "type": "string",
            "description": "Used when a note URL has no token. Explore/search output already includes xsecToken on every note — pipe those URLs instead of typing this.",
            "default": ""
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "general",
              "popular",
              "latest"
            ],
            "type": "string",
            "description": "Ranking for search_notes: comprehensive, most popular, or newest.",
            "default": "general"
          },
          "noteType": {
            "title": "Note type filter",
            "enum": [
              "all",
              "image",
              "video"
            ],
            "type": "string",
            "description": "Filter search_notes by image notes, video notes, or both.",
            "default": "all"
          },
          "fullDetail": {
            "title": "Hydrate full note detail",
            "type": "boolean",
            "description": "Explore / search / user_notes: open each discovered note and replace the card with full title, body, images, video URL, tags, and all engagement counts. Slower (one HTML request per note).",
            "default": false
          },
          "includeNotes": {
            "title": "Include creator notes (profile)",
            "type": "boolean",
            "description": "user_profile: also emit that creator's public note cards (anonymous access often strips per-note IDs; add a cookie for IDs you can pipe into note_detail).",
            "default": false
          },
          "includeComments": {
            "title": "Include comments (note detail)",
            "type": "boolean",
            "description": "note_detail: also scrape comments. Needs a cookie for a non-empty thread.",
            "default": false
          },
          "includeReplies": {
            "title": "Include comment replies",
            "type": "boolean",
            "description": "When scraping comments, emit nested replies as separate rows with parentCommentId set.",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap on dataset rows for the whole run. 0 = no cap (Actor still stops at a safety limit). Default 50.",
            "default": 50
          },
          "maxPages": {
            "title": "Explore pages",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many times to reload the public explore feed. The recommend feed rotates, so extra pages usually add new unique notes (deduped by note ID).",
            "default": 1
          },
          "maxComments": {
            "title": "Max comments per note",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap on comment rows per note (including replies when Include comment replies is on).",
            "default": 50
          },
          "cookie": {
            "title": "Cookie (web_session)",
            "type": "string",
            "description": "Optional. Logged-in www.xiaohongshu.com cookies as `name=value; name2=value2`. Must include web_session and a1 for search, user search, comments, and extra user-notes pages. DevTools → Application → Cookies → copy. Never stored outside this run."
          },
          "requestDelaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Throttle HTML/API calls. Raise if you see captchas (461/471) or empty SSR.",
            "default": 0.45
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify RESIDENTIAL is recommended. Datacenter IPs often hit Xiaohongshu's 安全限制 / 300011 wall.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}