{
  "openapi": "3.0.1",
  "info": {
    "title": "RedNote API",
    "description": "RedNote API scrapes Xiaohongshu / RedNote keyword search results and extracts posts, authors, engagement metrics, images, video URLs, and optional detail data with proxy, cookies, storage state, and dataset export support.",
    "version": "0.0",
    "x-build-id": "ZQrgrClOri4OKoU5Q"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sovanza.inc~rednote-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sovanza.inc-rednote-api",
        "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/sovanza.inc~rednote-api/runs": {
      "post": {
        "operationId": "runs-sync-sovanza.inc-rednote-api",
        "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/sovanza.inc~rednote-api/run-sync": {
      "post": {
        "operationId": "run-sync-sovanza.inc-rednote-api",
        "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": {
          "keywords": {
            "title": "Single/Multiple Keywords",
            "type": "array",
            "description": "Enter one or more Xiaohongshu / RedNote search keywords (one per line).",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items per keyword",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum number of posts to collect per keyword (1–200).",
            "default": 20
          },
          "proxyCountry": {
            "title": "Proxy Country",
            "enum": [
              "DISABLED",
              "AUTO_SELECT_PROXY_COUNTRY",
              "US",
              "GB",
              "DE",
              "FR",
              "JP",
              "CA",
              "IT",
              "AU",
              "SG"
            ],
            "type": "string",
            "description": "Residential proxy country (uses Apify Proxy). AUTO uses any country.",
            "default": "AUTO_SELECT_PROXY_COUNTRY"
          },
          "baseDomain": {
            "title": "Base domain",
            "enum": [
              "www.xiaohongshu.com",
              "www.rednote.com"
            ],
            "type": "string",
            "description": "Which web domain to use for navigation and search. If one domain is blocked, try the other.",
            "default": "www.xiaohongshu.com"
          },
          "locale": {
            "title": "Locale (optional)",
            "type": "string",
            "description": "Browser locale (advanced).",
            "default": "en-US"
          },
          "acceptLanguage": {
            "title": "Accept-Language (optional)",
            "type": "string",
            "description": "Extra header Accept-Language (advanced).",
            "default": "en-US,en;q=0.9"
          },
          "storageState": {
            "title": "Playwright storage state (optional)",
            "description": "Playwright storage_state JSON (cookies + localStorage). Most reliable way to reuse a logged-in session."
          },
          "storageStatePath": {
            "title": "Storage state path (optional)",
            "type": "string",
            "description": "Path to a local storage state JSON file (for local debugging).",
            "default": ""
          },
          "exportStorageState": {
            "title": "Export storage state (local only)",
            "type": "boolean",
            "description": "Local-only helper: opens a headed browser, lets you log in, then saves storage_state.json and exits.",
            "default": false
          },
          "exportStorageStateWaitSec": {
            "title": "Export wait time (seconds)",
            "minimum": 10,
            "maximum": 900,
            "type": "integer",
            "description": "How long to wait for you to log in during export mode.",
            "default": 120
          },
          "cookies": {
            "title": "Session cookies (optional)",
            "type": "array",
            "description": "Optional cookies for authenticated scraping. Each item: { \"name\": \"...\", \"value\": \"...\", \"domain\": \".xiaohongshu.com\", \"path\": \"/\" }."
          },
          "sortBy": {
            "title": "Sort (optional)",
            "enum": [
              "general",
              "latest"
            ],
            "type": "string",
            "description": "Optional sort mode, e.g. \"general\" or \"latest\". If not supported by the current DOM, it is ignored safely.",
            "default": "general"
          },
          "searchType": {
            "title": "Search type (future-safe)",
            "type": "string",
            "description": "Future-safe input. Default is \"note\".",
            "default": "note"
          },
          "includeDetails": {
            "title": "Include detail pages",
            "type": "boolean",
            "description": "If true, opens each note detail page for richer fields (slower). If false, uses search-card data only (faster).",
            "default": false
          },
          "includeAuthor": {
            "title": "Include author fields",
            "type": "boolean",
            "description": "If true, attempts to extract author info (nickname, avatar, id when available).",
            "default": true
          },
          "includeMedia": {
            "title": "Include media fields",
            "type": "boolean",
            "description": "If true, attempts to extract images/video fields.",
            "default": true
          },
          "headless": {
            "title": "Headless",
            "type": "boolean",
            "description": "Run browser in headless mode.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum number of keywords processed concurrently. Higher values may increase blocking risk.",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}