{
  "openapi": "3.0.1",
  "info": {
    "title": "Xiaohongshu (RED) Note Tracker - Likes, Comments, Changes",
    "description": "Paste Xiaohongshu note links and get likes, collects, comments and shares per note, with the change since your last run. One flat row per link, no login, no browser.",
    "version": "0.2",
    "x-build-id": "RHe8drPAfssZCoZAc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/magenta_courser~xiaohongshu-note-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-magenta_courser-xiaohongshu-note-tracker",
        "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/magenta_courser~xiaohongshu-note-tracker/runs": {
      "post": {
        "operationId": "runs-sync-magenta_courser-xiaohongshu-note-tracker",
        "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/magenta_courser~xiaohongshu-note-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-magenta_courser-xiaohongshu-note-tracker",
        "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": [
          "noteUrls"
        ],
        "properties": {
          "noteUrls": {
            "title": "Note links",
            "type": "array",
            "description": "Required. Xiaohongshu note links, one per line, copied from the app or website with Share -> Copy link. Accepted: full links with xsec_token (xiaohongshu.com/explore/..., /discovery/item/..., /user/profile/<userId>/<noteId>...), the whole share text the app copies (the link is extracted), and xhslink.com / xhslink.cn short links (followed once). A bare 24-character note ID or a link without xsec_token is accepted but returns a needs_token row without a request, because Xiaohongshu only serves a note page to a link that carries the xsec_token from a share link.",
            "items": {
              "type": "string"
            }
          },
          "compareWithLastRun": {
            "title": "Compare with last run",
            "type": "boolean",
            "description": "Add previousLikeCount / likeChange, previousCollectCount / collectChange, previousCommentCount / commentChange, previousShareCount / shareChange, previousScrapedAt and isFirstSeen to every note, compared with the last run that read the same note successfully. The previous values are kept in a named key-value store in your account, so scheduled daily runs line up automatically.",
            "default": true
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "all",
              "changesOnly"
            ],
            "type": "string",
            "description": "\"changesOnly\" saves (and charges) only notes seen for the first time or whose like, collect, comment or share count changed since the last run; rows with a problem (needs_token, not_found, blocked, error) are always saved and never charged. Needs \"Compare with last run\".",
            "default": "all"
          },
          "columnFormat": {
            "title": "Column format",
            "enum": [
              "tracker",
              "socialdatax"
            ],
            "type": "string",
            "description": "Shape of each output row. Use socialdatax if your sheets already use socialdatax/socialdatax-xhs-data-api get_note_detail column names: the row then has exactly their keys (operation, item_index, query_note_url, note_id, note_url, note_type, title, content, cover_image_url, image_items, video, like_count, collect_count, comment_count, share_count, publish_time, update_time, ip_location, topic_tags, mentioned_users, author_user_id, author_name, author_avatar_url, author_profile_url) followed by our status, raw-count and change columns (status, status_message, like_count_raw, ..., scraped_at, previous_scraped_at, like_change, ..., is_first_seen). Change tracking and the history store work the same in both formats.",
            "default": "tracker"
          },
          "historyStoreName": {
            "title": "History store name",
            "type": "string",
            "description": "Named key-value store that keeps the last counts per note. Use a different name for each separate campaign if you want independent baselines.",
            "default": "xiaohongshu-note-history"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Keep the default (Apify datacenter proxy): in our tests every note page loaded through it. When a request comes back blocked, that note is retried once through an Apify RESIDENTIAL proxy (more expensive, used only for that retry). Choose RESIDENTIAL here only if a whole run was blocked.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxRequests": {
            "title": "Max requests per run",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Optional. Upper limit on HTTP requests for the whole run, retries and short-link hops included. 0 = unlimited (default). Each note needs at least one request; a blocked note takes one more, a short link one more. When the limit is used up the run stops and the remaining links get an error row.",
            "default": 0
          },
          "maxRunMinutes": {
            "title": "Max run time (minutes)",
            "minimum": 1,
            "maximum": 1440,
            "type": "integer",
            "description": "Optional. The run stops sending new requests after this many minutes, default 60, and the remaining links get an error row. Independent of this, the run also stops after 5 blocked requests in a row.",
            "default": 60
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}