{
  "openapi": "3.0.1",
  "info": {
    "title": "RedNote Scraper — Xiaohongshu Posts, Comments & Video",
    "description": "Scrape RedNote (Xiaohongshu 小红书) posts, comments, creator profiles & video URLs. Search keywords, track creators, extract sentiment — zero login for posts, profiles & video. Clean JSON, delta mode, proxy ready",
    "version": "0.0",
    "x-build-id": "F3LZctUleYYPAkzMV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapepilot~rednote-xiaohongshu-scraper-all-in-one/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapepilot-rednote-xiaohongshu-scraper-all-in-one",
        "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/scrapepilot~rednote-xiaohongshu-scraper-all-in-one/runs": {
      "post": {
        "operationId": "runs-sync-scrapepilot-rednote-xiaohongshu-scraper-all-in-one",
        "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/scrapepilot~rednote-xiaohongshu-scraper-all-in-one/run-sync": {
      "post": {
        "operationId": "run-sync-scrapepilot-rednote-xiaohongshu-scraper-all-in-one",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Scrape Mode",
            "enum": [
              "user_posts",
              "search",
              "post_details",
              "comments",
              "profile",
              "video"
            ],
            "type": "string",
            "description": "Choose scraping mode: creator posts (zero login), keyword search (with cookie), full post details (with token), post comments, creator profiles, or direct video URLs.",
            "default": "user_posts"
          },
          "searchQuery": {
            "title": "Search Query",
            "type": "string",
            "description": "Keyword to search for on RedNote in 'search' mode. Example: 'skincare routine', 'Nike', or '护肤'.",
            "default": "skincare routine"
          },
          "userUrl": {
            "title": "User / Creator Profile URL",
            "type": "string",
            "description": "Single RedNote creator profile URL (used in 'user_posts' and 'profile' modes). Example: 'https://www.xiaohongshu.com/user/profile/5d5a56c10000000001000813'.",
            "default": "https://www.xiaohongshu.com/user/profile/5d5a56c10000000001000813"
          },
          "userUrls": {
            "title": "More Profile URLs (Bulk)",
            "type": "array",
            "description": "List of creator profile URLs for bulk sweeps in 'user_posts' and 'profile' modes. Sweeps entire watchlist in one run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Post URLs / Short Links",
            "type": "array",
            "description": "List of RedNote post URLs with ?xsec_token= query parameter or xhslink.com short links. Used in 'post_details', 'comments', and 'video' modes.",
            "default": [
              "https://www.xiaohongshu.com/explore/654321000000000001000813?xsec_token=AB123"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of items (posts, comments, or profiles) to return per target.",
            "default": 50
          },
          "cookieString": {
            "title": "Cookie String (Advanced)",
            "type": "string",
            "description": "Your RedNote session cookie (e.g. 'web_session=YOUR_SESSION_COOKIE', full 'Cookie:' header, or Cookie-Editor JSON). Unlocks keyword search and deep comments."
          },
          "sortBy": {
            "title": "Search Sort Order",
            "enum": [
              "general",
              "time_descending",
              "popularity_descending"
            ],
            "type": "string",
            "description": "Sorting criteria for search results.",
            "default": "general"
          },
          "filterByType": {
            "title": "Filter by Note Type",
            "enum": [
              "all",
              "normal",
              "video"
            ],
            "type": "string",
            "description": "Filter notes by content media type in search mode.",
            "default": "all"
          },
          "filterByMinLikes": {
            "title": "Filter by Minimum Likes",
            "minimum": 0,
            "type": "integer",
            "description": "Exclude posts with fewer likes than this threshold.",
            "default": 0
          },
          "sentimentAnalysis": {
            "title": "Sentiment Analysis & Language Tagging",
            "type": "boolean",
            "description": "Enrich output with language tag (zh-CN / en / mixed) and sentiment polarity and score (-1.0 to +1.0) using SnowNLP and lexicon fallback.",
            "default": false
          },
          "liteMode": {
            "title": "Lite Mode (Metadata Only)",
            "type": "boolean",
            "description": "Return compact metadata schema (postId, postUrl with token, title, likes, scrapedAt). Halves payload size for high-volume pipelines.",
            "default": false
          },
          "deltaMode": {
            "title": "Delta Mode (Incremental Scraping)",
            "type": "boolean",
            "description": "Return only posts that have not been delivered by an earlier delta run of the same stream. Ideal for recurring scheduled monitors.",
            "default": false
          },
          "deltaStateKey": {
            "title": "Delta State Key",
            "type": "string",
            "description": "Identifier key for the delta stream memory (e.g. 'nike-daily' or 'beauty-feed').",
            "default": "default"
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of concurrent workers for multi-URL workloads (post_details, comments, video).",
            "default": 4
          },
          "blockResources": {
            "title": "Block Heavy Resources",
            "type": "boolean",
            "description": "Skip downloading media bytes to save bandwidth while still emitting clean asset URLs in output records.",
            "default": true
          },
          "networkCapture": {
            "title": "Network Capture Fast Path (v2.1)",
            "type": "boolean",
            "description": "Use fast extraction path that completes earlier in the page-load lifecycle. Auto-falls back to DOM parsing if needed.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional proxy settings. Apify Datacenter or Residential proxy helps prevent IP blocks and regional throttling."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}