{
  "openapi": "3.0.1",
  "info": {
    "title": "1688 Wholesale Analyzer - AI Insights & Smart Labels",
    "description": "Extract and analyze 50+ fields per product from 1688.com with AI-powered smart labels (hot/profitable/new), data cleaning, and enriched supplier intelligence. Search by keyword or offer IDs. Better than raw scraping — get actionable insights for your sourcing decisions.",
    "version": "0.1",
    "x-build-id": "SjUCzgM3Smo65JNJk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/loongge~1688-wholesale-analyzer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-loongge-1688-wholesale-analyzer",
        "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/loongge~1688-wholesale-analyzer/runs": {
      "post": {
        "operationId": "runs-sync-loongge-1688-wholesale-analyzer",
        "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/loongge~1688-wholesale-analyzer/run-sync": {
      "post": {
        "operationId": "run-sync-loongge-1688-wholesale-analyzer",
        "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": [
          "keywords"
        ],
        "properties": {
          "keywords": {
            "title": "Search Keywords",
            "type": "array",
            "description": "Keywords to search on 1688.com. Supports Chinese and English. English keywords tend to return more stable results.",
            "items": {
              "type": "string"
            }
          },
          "offerIds": {
            "title": "Offer IDs",
            "type": "array",
            "description": "Specific 1688 product IDs to fetch directly. Leave empty to use keyword search instead.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of products to return per keyword.",
            "default": 20
          },
          "sortBy": {
            "title": "Sort By",
            "enum": [
              "relevance",
              "sale",
              "price_asc",
              "price_desc",
              "credit"
            ],
            "type": "string",
            "description": "How to sort search results on 1688.",
            "default": "relevance"
          },
          "includeSkuDetails": {
            "title": "Include SKU Details",
            "type": "boolean",
            "description": "Extract SKU/variant details including stock levels and tier pricing.",
            "default": false
          },
          "priceMin": {
            "title": "Min Price (CNY)",
            "minimum": 0,
            "type": "number",
            "description": "Minimum price filter in CNY. Set to 0 for no lower limit.",
            "default": 0
          },
          "priceMax": {
            "title": "Max Price (CNY)",
            "minimum": 0,
            "type": "number",
            "description": "Maximum price filter in CNY. Set to 0 for no upper limit.",
            "default": 0
          },
          "enableAiLabels": {
            "title": "AI Smart Labels & Scoring",
            "type": "boolean",
            "description": "Auto-tag products with smart labels (Hot, High-Profit, New, Best Value, etc.) and generate profitScore, competitionScore, riskLevel, and summary.",
            "default": true
          },
          "enableDataCleaning": {
            "title": "Data Cleaning & Dedup",
            "type": "boolean",
            "description": "Clean data: remove duplicates, normalize prices, filter invalid items.",
            "default": true
          },
          "enableLlmAnalysis": {
            "title": "LLM Deep Analysis",
            "type": "boolean",
            "description": "Enhance each product with LLM-generated insights: English summary, market positioning, and sourcing advice. Requires llmApiKey.",
            "default": false
          },
          "llmApiKey": {
            "title": "LLM API Key",
            "type": "string",
            "description": "API key for OpenAI-compatible LLM service (OpenAI, DeepSeek, etc.). Also accepts LLM_API_KEY env variable.",
            "default": ""
          },
          "llmBaseUrl": {
            "title": "LLM API Base URL",
            "type": "string",
            "description": "Base URL for OpenAI-compatible API. Change this for DeepSeek (https://api.deepseek.com/v1) or other providers.",
            "default": "https://api.openai.com/v1"
          },
          "llmModel": {
            "title": "LLM Model",
            "type": "string",
            "description": "Model name for LLM analysis. Examples: gpt-4o-mini, deepseek-chat, gpt-4o.",
            "default": "gpt-4o-mini"
          },
          "enableCrossPlatformComparison": {
            "title": "Cross-Platform Price Comparison",
            "type": "boolean",
            "description": "Compare 1688 wholesale prices against Taobao and AliExpress retail prices. Shows margin analysis for sourcing decisions. Note: increases Actor run time and compute usage.",
            "default": false
          },
          "compareTaobao": {
            "title": "Compare with Taobao",
            "type": "boolean",
            "description": "Include Taobao (淘宝) retail prices in comparison. Same currency (CNY) as 1688.",
            "default": true
          },
          "compareAliexpress": {
            "title": "Compare with AliExpress",
            "type": "boolean",
            "description": "Include AliExpress retail prices in comparison. Auto-converts USD to CNY for margin calculation.",
            "default": true
          },
          "productWeightGrams": {
            "title": "Product Weight (grams)",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Estimated product weight in grams for shipping cost calculation. Used by Profit Calculator. Default: 50g (small electronics).",
            "default": 50
          },
          "shippingRatePerGram": {
            "title": "Shipping Rate (CNY/gram)",
            "minimum": 0,
            "type": "number",
            "description": "Shipping cost per gram in CNY. Default: 0.35 (economy cross-border). Used by Profit Calculator.",
            "default": 0.35
          },
          "platformFeePercent": {
            "title": "Platform Fee (%)",
            "minimum": 0,
            "maximum": 0.5,
            "type": "number",
            "description": "Platform commission as decimal (0.12 = 12%). Covers AliExpress/Amazon/Shopify fees. Used by Profit Calculator.",
            "default": 0.12
          },
          "customsPercent": {
            "title": "Customs/Duty Rate (%)",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Customs duty as decimal (0 = no duty). Varies by country and product category. Used by Profit Calculator.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}