{
  "openapi": "3.0.1",
  "info": {
    "title": "1688 Wholesale Scraper (Alibaba)",
    "description": "Scrape 1688.com (Alibaba's China wholesale marketplace) by keyword, offer ID or supplier ID — no login. Search returns offers with title, price and quantity ladder; detail adds SKUs, stock, MOQ and images; supplier returns a company card; reviews returns buyer ratings. Export JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "jAZ166k6BaIu5c8zy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/herus13~alibaba-1688-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-herus13-alibaba-1688-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/herus13~alibaba-1688-scraper/runs": {
      "post": {
        "operationId": "runs-sync-herus13-alibaba-1688-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/herus13~alibaba-1688-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-herus13-alibaba-1688-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": "What to scrape",
            "enum": [
              "search",
              "detail",
              "supplier",
              "reviews"
            ],
            "type": "string",
            "description": "Which kind of record to collect: `search` finds offers by keyword; `detail` returns full detail (SKUs, stock, MOQ, images) for specific offers; `supplier` returns a supplier's company card and their offers; `reviews` returns buyer reviews and the rating summary for specific offers. Default search.",
            "default": "search"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search terms, one per entry — for example `蓝牙耳机` (bluetooth earphones). Each term returns up to `max_results` offers. Terms that differ only in surrounding spaces are searched, and billed, once. Used when `mode` is search; leave empty for every other mode.",
            "items": {
              "type": "string"
            }
          },
          "offer_ids": {
            "title": "Offer IDs",
            "type": "array",
            "description": "Offers to work on, one numeric offer id per entry — the number in a `detail.1688.com/offer/123456789.html` URL. Used when `mode` is detail or reviews; leave empty for every other mode.",
            "items": {
              "type": "string"
            }
          },
          "member_ids": {
            "title": "Supplier IDs (member ID)",
            "type": "array",
            "description": "Suppliers to work on, one member id per entry — the seller's `memberId`, as it appears on an offer record. Used when `mode` is supplier; leave empty for every other mode.",
            "items": {
              "type": "string"
            }
          },
          "category_id": {
            "title": "Category ID",
            "type": "string",
            "description": "Restrict a keyword search to one 1688 category, given as its numeric category id. Leave empty to search every category. Used when `mode` is search."
          },
          "country": {
            "title": "Exit country",
            "enum": [
              "cn",
              "sg",
              "hk",
              "tw",
              "vn"
            ],
            "type": "string",
            "description": "Which country the run's residential exit IP sits in, as a two-letter code: cn for China (the default, and fastest for 1688), sg for Singapore, hk for Hong Kong, tw for Taiwan, or vn for Vietnam.",
            "default": "cn"
          },
          "max_results": {
            "title": "Max results per target",
            "minimum": 1,
            "maximum": 4000,
            "type": "integer",
            "description": "How many records to return per keyword, offer or supplier, from 1 to 4000. Default 40.",
            "default": 40
          },
          "max_pages": {
            "title": "Max search pages per keyword",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "How many result pages to read per keyword, from 1 to 3. Anonymous search is capped at 3 pages — a larger number is clamped. Default 3. Used when `mode` is search or supplier.",
            "default": 3
          },
          "page_size": {
            "title": "Results per page",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "How many offers to request per search page, from 1 to 60. Default 20. Used when `mode` is search or supplier.",
            "default": 20
          },
          "include_ads": {
            "title": "Include ads",
            "type": "boolean",
            "description": "Keep sponsored offers (P4P / CPT bids) in search results, labelled with `is_ad` and `ad_block`, instead of dropping them. Default false. Used when `mode` is search or supplier.",
            "default": false
          },
          "include_rating_summary": {
            "title": "Include rating summary",
            "type": "boolean",
            "description": "Also return one rating-summary row per offer (overall good-rate plus tag histograms) alongside the individual reviews. Default true. Used when `mode` is reviews.",
            "default": true
          },
          "proxyUrls": {
            "title": "Your own proxy URLs (optional)",
            "type": "array",
            "description": "Leave empty and the run uses the residential proxy this actor ships with, included in the price of the run. To route the run through your own account instead, add one gateway URL per entry, for example http://user:pass@host:port — works with DataImpulse, Bright Data, Oxylabs, Smartproxy or any provider that issues URLs. When set, only these URLs are used.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}