{
  "openapi": "3.0.1",
  "info": {
    "title": "Tokopedia Scraper - Products, Prices, Shops, Reviews",
    "description": "[💰$0.02/1K] Scrape Tokopedia search, category and shop listings, product pages and reviews. Every row keeps rupiah price, discount, rating, stock, sold count and shop badge with a stable resultId for dedupe. Public GraphQL gateway, no proxy, no cookies, no login.",
    "version": "0.8",
    "x-build-id": "AchXi2nu5fQ1Ny8pQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ai-lead-gen-tools~tokopedia-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ai-lead-gen-tools-tokopedia-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/ai-lead-gen-tools~tokopedia-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ai-lead-gen-tools-tokopedia-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/ai-lead-gen-tools~tokopedia-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ai-lead-gen-tools-tokopedia-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",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "category",
              "shop",
              "product",
              "all"
            ],
            "type": "string",
            "description": "What to scrape. `search` reads keyword results, `category` reads a category listing, `shop` reads a shop catalogue, `product` reads the product URLs you list, `all` runs every group you filled in, in this order: keywords, categories, shops, products.",
            "default": "search"
          },
          "queries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Keywords to search, one target per keyword. Each keyword keeps its own position numbering, so rank 1 always means the first product Tokopedia returned for that keyword. Without a language prefix Tokopedia defaults to Indonesian results.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "categoryIds": {
            "title": "Category ids",
            "type": "array",
            "description": "Numeric Tokopedia category ids, one target per id. This is a leaf category id such as 3231, not the department number that search rows report, and the two are different: a department id returns the whole catalogue instead of the category. Retrieve ids from Tokopedia's own category URLs. A wrong or stale id returns an explicit no_results row rather than a silent empty run.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "shops": {
            "title": "Shops",
            "type": "array",
            "description": "Shop domains, one target per shop, as they appear in tokopedia.com/<domain>. A full shop URL is accepted and reduced to its first path segment. The domain is resolved to the numeric shop id through the shop page before listing, and a reserved or non-existent domain leaves an explicit shop_not_found row.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "productUrls": {
            "title": "Product URLs",
            "type": "array",
            "description": "Full product links, one target per product. The numeric product id is read from the URL tail. Each product yields its PDP row, its listing row reconstructed from search when the product is still findable, and its reviews when review collection is on.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxItems": {
            "title": "Max products",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on product rows for the whole run, shared across every target. The run stops requesting as soon as the cap is reached, so a large keyword list under a small cap reads the first keyword only.",
            "default": 100
          },
          "maxPages": {
            "title": "Max pages per target",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Page cap per target, counted in listing requests. A target also stops earlier when the gateway reports no further products.",
            "default": 10
          },
          "rowsPerPage": {
            "title": "Products per request",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Products requested per listing call. The gateway accepts up to 200; the default of 60 matches what the website itself asks for. Raising it cuts the number of requests needed for the same page cap.",
            "default": 60
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "relevance",
              "priceAsc",
              "priceDesc",
              "newest"
            ],
            "type": "string",
            "description": "Listing order passed to the gateway. `relevance` is Tokopedia's default ranking and is what the website shows. The price orders are absolute price, so `priceAsc` puts the cheapest out-of-stock oddity first. `newest` sorts by listing recency.",
            "default": "relevance"
          },
          "minPrice": {
            "title": "Min price (IDR)",
            "minimum": 0,
            "type": "integer",
            "description": "Lower price bound in rupiah, passed to the gateway as its own filter. Leave empty for no bound. The bound is applied by Tokopedia before ranking, so it changes which products appear, not only which rows are kept."
          },
          "maxPrice": {
            "title": "Max price (IDR)",
            "minimum": 0,
            "type": "integer",
            "description": "Upper price bound in rupiah. Leave empty for no bound."
          },
          "officialOnly": {
            "title": "Official stores only",
            "type": "boolean",
            "description": "Restricts the listing to Tokopedia's official stores. The gateway filter is real and shrinks the result set sharply: on one probe the same keyword went from 13.8 million products to 71 thousand.",
            "default": false
          },
          "cod": {
            "title": "Cash on delivery only",
            "type": "boolean",
            "description": "Restricts the listing to products that support cash on delivery.",
            "default": false
          },
          "includeDetails": {
            "title": "Collect product details",
            "type": "boolean",
            "description": "Fetches each product page and emits an additional product_detail row with the full PDP payload: stock, minimum order, shipping weight, campaign discount, description text, media gallery, view count and units sold. This doubles the request count, since every product costs one extra page load.",
            "default": false
          },
          "includeReviews": {
            "title": "Collect reviews",
            "type": "boolean",
            "description": "Fetches reviews for every product found, one review row each. The Tokopedia review API caps a single request at 50 reviews and pages with a hasNext flag, so the per-product cap below decides how deep the run goes.",
            "default": false
          },
          "reviewsPerProduct": {
            "title": "Max reviews per product",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Cap on review rows per product. The API rejects a single request above 50 reviews, so the value is split into pages of at most 50.",
            "default": 10
          },
          "requestDelayMs": {
            "title": "Delay between requests",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Pause in milliseconds between listing pages of the same target. The gateway answered probes without throttling, so this is politeness rather than a hard limit.",
            "default": 300
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Timeout of one HTTP request in seconds.",
            "default": 30
          },
          "runBudgetSecs": {
            "title": "Run budget",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Soft time budget for the whole run, in seconds. The run stops requesting before the platform timeout, keeps the rows it already pushed and reports the budget as exhausted in the summary. Leave empty to use the whole platform allowance."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}