{
  "openapi": "3.0.1",
  "info": {
    "title": "Xiaohongshu (Rednote) Note scraper (Keyword search)",
    "description": "Use your own browser cookies to search xiaohongshu.com for keywords with a logged-in browser session and extracts note title, description, author, engagement counts, images, tags and publish date.",
    "version": "0.2",
    "x-build-id": "VdLWaVCykDzxSh9qr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lexac94~xiaohongshu-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lexac94-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/lexac94~xiaohongshu-scraper/runs": {
      "post": {
        "operationId": "runs-sync-lexac94-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/lexac94~xiaohongshu-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-lexac94-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",
        "required": [
          "keywords"
        ],
        "properties": {
          "site": {
            "title": "Site",
            "enum": [
              "xiaohongshu",
              "rednote"
            ],
            "type": "string",
            "description": "Which front end your account uses. Accounts registered with a mainland China number use xiaohongshu.com (Chinese UI). Accounts registered overseas are routed to rednote.com (international UI). Export cookies from the same site you select here.",
            "default": "xiaohongshu"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search terms, one search each. Chinese and English both work, e.g. 咖啡店 推荐, 装修 灵感, skincare routine, lululemon. Add a place name to anchor results to a region.",
            "items": {
              "type": "string"
            }
          },
          "keywords_per_run": {
            "title": "Keywords per run (rotation)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "For long keyword lists: search only this many keywords per run, cycling through the list across runs (position remembered in the state store). 0 = search every keyword every run.",
            "default": 0
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "general",
              "latest",
              "most_liked",
              "most_commented",
              "most_collected"
            ],
            "type": "string",
            "description": "Search result ordering. Ignored when 'Sweep all sort orders' is on.",
            "default": "general"
          },
          "sweep_sorts": {
            "title": "Sweep all sort orders",
            "type": "boolean",
            "description": "Run each keyword under every sort order and merge the results. Finds more unique notes per keyword at the cost of a few extra search page loads (no extra note opens).",
            "default": false
          },
          "note_type": {
            "title": "Note type",
            "enum": [
              "all",
              "video",
              "image"
            ],
            "type": "string",
            "description": "Restrict results to one note format.",
            "default": "all"
          },
          "time_window": {
            "title": "Time window",
            "enum": [
              "all",
              "1d",
              "1w",
              "6mo"
            ],
            "type": "string",
            "description": "Only notes published within this window.",
            "default": "all"
          },
          "location": {
            "title": "Location filter",
            "enum": [
              "all",
              "same_city",
              "nearby"
            ],
            "type": "string",
            "description": "XHS's 位置距离 filter. 'Same city' (同城) and 'Nearby' (附近) are relative to the browsing session's location, which on the web is its IP. Combine with a residential proxy in your target country to restrict search to local notes.",
            "default": "all"
          },
          "region_keywords": {
            "title": "Region keywords",
            "type": "array",
            "description": "Words that mark a note as being about your target region. Each record gets region_marker = true when its title, text, tags or IP region contain any of them. Defaults are for Singapore; replace for another market.",
            "default": [
              "新加坡",
              "🇸🇬",
              "HDB",
              "BTO",
              "组屋",
              "Singapore",
              "SG",
              "狮城",
              "坡县",
              "坡岛",
              "condo"
            ],
            "items": {
              "type": "string"
            }
          },
          "max_notes_per_keyword": {
            "title": "Max new notes to discover per keyword",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop scrolling search once this many NEW (unseen) notes are found for a keyword. A single sort order usually exhausts at 200–300.",
            "default": 40
          },
          "max_note_opens_per_run": {
            "title": "Max note opens per run",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on note detail pages opened in one run. This is the account-exposure dial: ~40 per run on an hourly schedule is a reasonable ceiling for one account. Notes discovered but not opened stay pending for the next run.",
            "default": 40
          },
          "max_run_minutes": {
            "title": "Run time budget (minutes)",
            "minimum": 0,
            "maximum": 1440,
            "type": "integer",
            "description": "Stop searching and opening notes once the run has used this many minutes, then save state and exit cleanly. Keep it below the schedule interval so runs never overlap (two sessions on one account at once is the pattern to avoid). 0 = no budget.",
            "default": 45
          },
          "scrape_details": {
            "title": "Open each note for full details",
            "type": "boolean",
            "description": "If off, only search-card data (id, title, author, likes) is saved and no note pages are opened. Much lighter on the account.",
            "default": true
          },
          "delay_min_ms": {
            "title": "Minimum delay between actions (ms)",
            "minimum": 500,
            "type": "integer",
            "description": "Random pause lower bound between page actions. Keep it human-like; the account is the bottleneck, not the machine.",
            "default": 2000
          },
          "delay_max_ms": {
            "title": "Maximum delay between actions (ms)",
            "minimum": 500,
            "type": "integer",
            "description": "Random pause upper bound between page actions.",
            "default": 5000
          },
          "cookies": {
            "title": "Session cookies",
            "type": "string",
            "description": "Logged-in cookies exported from the site selected above (xiaohongshu.com or rednote.com). Accepts Cookie-Editor JSON export, Netscape cookies.txt, or a raw Cookie header string. Paste once: the actor stores them in its private state store and later runs can leave this empty."
          },
          "proxy_configuration": {
            "title": "Proxy",
            "type": "object",
            "description": "Off by default. Switch on Apify Proxy with the RESIDENTIAL group and your target country code so the session's location matches the account and the 'Same city' filter means that country. Also the fix if datacenter IPs start hitting captchas."
          },
          "block_media": {
            "title": "Block image/video downloads",
            "type": "boolean",
            "description": "Do not download images, video or fonts; URLs are still captured. Cuts proxy traffic by most of its volume. Turn off only for debugging screenshots.",
            "default": true
          },
          "skip_seen": {
            "title": "Skip notes scraped in earlier runs",
            "type": "boolean",
            "description": "Uses the state store below to avoid re-opening notes already scraped. Turn off to re-scrape everything (e.g. to refresh engagement counts).",
            "default": true
          },
          "state_store_name": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store that holds seen note IDs and the pending queue. Use a different name per project to keep their histories separate.",
            "default": "xiaohongshu-scraper-state"
          },
          "debug_raw": {
            "title": "Debug: save screenshots and raw state",
            "type": "boolean",
            "description": "Saves a screenshot after each filter click (filter-*.png) and the raw page state for video notes missing a stream URL (raw-note-<id>.json) to the run key-value store. Off in production.",
            "default": false
          },
          "headless": {
            "title": "Headless browser",
            "type": "boolean",
            "description": "Turn off only for local debugging so you can watch the browser.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}