{
  "openapi": "3.0.1",
  "info": {
    "title": "Tokopedia Shop Reviews Scraper",
    "description": "Crawls every product of a Tokopedia shop and collects all of its reviews.",
    "version": "1.0",
    "x-build-id": "D9ZNHxiD9fR3AKSmG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/auliax20~tokopedia-reviews/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-auliax20-tokopedia-reviews",
        "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/auliax20~tokopedia-reviews/runs": {
      "post": {
        "operationId": "runs-sync-auliax20-tokopedia-reviews",
        "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/auliax20~tokopedia-reviews/run-sync": {
      "post": {
        "operationId": "run-sync-auliax20-tokopedia-reviews",
        "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": {
          "shopUrls": {
            "title": "Shop URLs",
            "type": "array",
            "description": "Tokopedia shop URLs, e.g. https://www.tokopedia.com/wahanakaryastore . The actor resolves the numeric shop id automatically.",
            "items": {
              "type": "string"
            }
          },
          "shopIds": {
            "title": "Shop IDs (advanced)",
            "type": "array",
            "description": "Numeric Tokopedia shop ids. Use this if URL resolution fails (e.g. 7494083584907249524). Optional alternative/supplement to Shop URLs.",
            "items": {
              "type": "string"
            }
          },
          "maxProductsPerShop": {
            "title": "Max products per shop",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many products per shop. 0 = no limit (all products).",
            "default": 0
          },
          "maxReviewsPerProduct": {
            "title": "Max reviews per product",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many reviews per product. 0 = no limit (all reviews).",
            "default": 0
          },
          "onlyProductsWithReviews": {
            "title": "Skip products flagged with 0 reviews",
            "type": "boolean",
            "description": "If on, skip products whose listing reports reviewCount = 0. NOTE: Tokopedia's listing count is often unreliable, so this is OFF by default and every product is probed for reviews.",
            "default": false
          },
          "reviewSort": {
            "title": "Review sort order",
            "enum": [
              "informative_score desc",
              "create_time desc",
              "create_time asc",
              "rating desc",
              "rating asc"
            ],
            "type": "string",
            "description": "How Tokopedia sorts the reviews it returns. Ignored (forced to Newest) when 'reviewsSince' or 'dedup' is enabled, so early-stop can work.",
            "default": "informative_score desc"
          },
          "reviewsSince": {
            "title": "Only reviews since (date)",
            "type": "string",
            "description": "Only keep reviews posted on/after this date (ISO, e.g. 2026-05-01). Sorts newest-first and STOPS paginating a product once older reviews are reached. Empty = no date filter.",
            "default": ""
          },
          "includeProductSummaries": {
            "title": "Emit a per-product summary",
            "type": "boolean",
            "description": "Push one aggregate row per product (total reviews, average rating, 1-5 star distribution) to a separate 'product-summaries' dataset.",
            "default": true
          },
          "includeSellerReplies": {
            "title": "Emit seller replies as mentions",
            "type": "boolean",
            "description": "When a review has a seller reply, push it as an additional mention (source_label 'Tokopedia Seller Reply') linked to the original review.",
            "default": true
          },
          "dedup": {
            "title": "Incremental dedup",
            "type": "boolean",
            "description": "Remember review ids across runs (in a named key-value store) and skip already-seen reviews. Sorts newest-first and stops at the first seen review. Ideal for scheduled monitoring.",
            "default": false
          },
          "minRating": {
            "title": "Min rating",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Only keep reviews with rating >= this (1-5). 0 = no filter.",
            "default": 0
          },
          "maxRating": {
            "title": "Max rating",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Only keep reviews with rating <= this (1-5). 0 = no filter.",
            "default": 0
          },
          "productConcurrency": {
            "title": "Product concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many products to scrape in parallel. Keep low to avoid anti-bot blocks.",
            "default": 3
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Polite delay added between GraphQL requests within a worker.",
            "default": 400
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Proxy for the requests. Tokopedia is behind Akamai Bot Manager; if you get blocked, enable Apify Proxy (residential RESIDENTIAL group, country ID recommended).",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}