{
  "openapi": "3.0.1",
  "info": {
    "title": "Temu Products Scraper",
    "description": "Analyse Temu products from your own export or an Apify dataset: explainable Product Score, filters, price/review history and a visual report. Public temu.com pages are tried politely; when Temu requires sign-in they are reported and never charged.",
    "version": "0.1",
    "x-build-id": "4xdU5KBCrDrA2uIpa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/badr_xba~temu-products-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-badr_xba-temu-products-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/badr_xba~temu-products-scraper/runs": {
      "post": {
        "operationId": "runs-sync-badr_xba-temu-products-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/badr_xba~temu-products-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-badr_xba-temu-products-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": {
          "source": {
            "title": "Data source",
            "enum": [
              "public",
              "import"
            ],
            "type": "string",
            "description": "<b>public</b>: temu.com product URLs, ids, searches and category pages (product pages: a few per run; searches and listings: blocked by Temu; blocked inputs are reported and not charged). <b>import</b>: your own file URLs or Apify datasets. Leave empty to choose automatically: <i>import</i> when import inputs are filled in, else <i>public</i>."
          },
          "productUrls": {
            "title": "Temu product URLs",
            "type": "array",
            "description": "temu.com product pages, any locale, e.g. <code>https://www.temu.com/...-g-601099645243854.html</code>.",
            "items": {
              "type": "string"
            }
          },
          "productIds": {
            "title": "Temu product ids (goods_id)",
            "type": "array",
            "description": "6-20 digit goods ids; each becomes <code>https://www.temu.com/goods.html?goods_id=…</code>.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "One search per line (temu.com search page).",
            "items": {
              "type": "string"
            }
          },
          "categoryUrls": {
            "title": "Category / listing URLs",
            "type": "array",
            "description": "temu.com category or listing pages.",
            "items": {
              "type": "string"
            }
          },
          "importUrls": {
            "title": "Import file URLs",
            "type": "array",
            "description": "http(s) URLs of your own Temu product data: a JSON array (or an object with <code>items</code>/<code>data</code>/<code>products</code>), JSON Lines or CSV with a header row. Common Temu field names are mapped (goods_id, goods_name, price / price_str / *_cents, market_price, currency, thumb_url / images, goods_score, comment_num, mall_name, sku_list…); unknown fields are kept under <code>extra</code>.",
            "items": {
              "type": "string"
            }
          },
          "importDatasetIds": {
            "title": "Apify dataset ids",
            "type": "array",
            "description": "Datasets you can read with your account (e.g. from another Temu Actor run). Read with this run's own token.",
            "items": {
              "type": "string"
            }
          },
          "importPriceUnit": {
            "title": "Unit of numeric prices in imported files",
            "enum": [
              "auto",
              "decimal",
              "cents"
            ],
            "type": "string",
            "description": "Price texts like <code>$12.99</code> and fields named <code>*_cents</code> are always understood. <b>auto</b> reads other numbers as decimal amounts (and notes large integers in dataNotes); choose <b>cents</b> if your file stores 1299 for 12.99.",
            "default": "auto"
          },
          "maxItems": {
            "title": "Maximum products to save",
            "minimum": 0,
            "type": "integer",
            "description": "Saved (and charged) after filters and sorting. <code>0</code> = no limit.",
            "default": 100
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "productScore",
              "priceAsc",
              "priceDesc",
              "discountDesc",
              "ratingDesc",
              "reviewsDesc",
              "newest",
              "recentlyCollected"
            ],
            "type": "string",
            "description": "Order of the saved products. Missing values go last.",
            "default": "productScore"
          },
          "minProductScore": {
            "title": "Minimum Product Score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "0-100. 70+ needs at least 2 signal groups, 90+ at least 3.",
            "default": 0
          },
          "minPrice": {
            "title": "Minimum price",
            "minimum": 0,
            "type": "number",
            "description": "In the product's own currency (no conversion). Products without a price are excluded when a price filter is set."
          },
          "maxPrice": {
            "title": "Maximum price",
            "minimum": 0,
            "type": "number",
            "description": "In the product's own currency."
          },
          "priceCurrency": {
            "title": "Currency for the price filter",
            "type": "string",
            "description": "3-letter ISO code (e.g. USD). Products in other currencies are excluded by the price filter."
          },
          "minDiscountPercent": {
            "title": "Minimum discount %",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Discount computed only from a real original price above the price."
          },
          "minRating": {
            "title": "Minimum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "0-5."
          },
          "minReviews": {
            "title": "Minimum reviews",
            "minimum": 0,
            "type": "integer",
            "description": "Products without a review count count as 0."
          },
          "minVariants": {
            "title": "Minimum variants",
            "minimum": 0,
            "type": "integer",
            "description": "Number of SKU variants in the data."
          },
          "onlyAvailable": {
            "title": "Only products in stock",
            "type": "boolean",
            "description": "Products with unknown availability are excluded too.",
            "default": false
          },
          "onlyNewProducts": {
            "title": "Only products new since the last run",
            "type": "boolean",
            "description": "Keep only products that no earlier run of the history store has seen (needs Track history between runs). The first run keeps everything, since there is nothing to compare with. Products dropped by this filter are not charged.",
            "default": false
          },
          "categories": {
            "title": "Categories contain",
            "type": "array",
            "description": "Keep products whose category contains one of these texts (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "sellers": {
            "title": "Sellers",
            "type": "array",
            "description": "Exact seller (mall) names or ids.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep products whose title, description or category contains one of these.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop products containing one of these.",
            "items": {
              "type": "string"
            }
          },
          "includeDescription": {
            "title": "Include description",
            "type": "boolean",
            "description": "Plain-text description (HTML removed, max 2,000 characters).",
            "default": true
          },
          "useHistory": {
            "title": "Track history between runs",
            "type": "boolean",
            "description": "Keeps price / review / availability snapshots in a named key-value store, so scheduled runs show price drops and review growth. Records labelled synthetic are never stored.",
            "default": true
          },
          "historyStoreName": {
            "title": "History store name",
            "type": "string",
            "description": "Named key-value store for the snapshots.",
            "default": "temu-products-history"
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Per request. At most one retry per input.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}