{
  "openapi": "3.0.1",
  "info": {
    "title": "HKTDC Sourcing Scraper: Products & Suppliers",
    "description": "Extract products and suppliers from HKTDC Sourcing: prices, MOQ, specs, certifications, verified level. Fast API-based scraper, no browser or login. Export JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "trLHTgxpJxMDo3LSj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rastriq~hktdc-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rastriq-hktdc-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/rastriq~hktdc-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rastriq-hktdc-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/rastriq~hktdc-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rastriq-hktdc-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": {
          "searchType": {
            "title": "Search mode",
            "enum": [
              "keyword",
              "category",
              "startUrls"
            ],
            "type": "string",
            "description": "How to find items.<br><br><b>Keyword search</b>: search terms such as <code>LED light</code>.<br><b>Category browsing</b>: HKTDC category URLs.<br><b>Direct URLs</b>: HKTDC product pages or search/category URLs.",
            "default": "keyword"
          },
          "keyword": {
            "title": "Search keyword",
            "type": "string",
            "description": "Search term for products and suppliers. Used in <b>Keyword search</b> mode. Example: <code>LED light</code>, <code>GPS tracker</code>. Leave empty to list everything (up to ~10,000 items)."
          },
          "categoryUrls": {
            "title": "Category URLs",
            "type": "array",
            "description": "One or more HKTDC category page URLs. Only used when Search mode is <b>category</b>.<br><br>Example: <code>https://sourcing.hktdc.com/en/Categories/Electronics/c/06000000</code>",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "HKTDC product detail pages, category pages or other sourcing.hktdc.com URLs. Used in <b>Direct URLs</b> mode. Supplier profile URLs are not supported; use keyword search with suppliers enabled instead.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "scrapeProducts": {
            "title": "Scrape products",
            "type": "boolean",
            "description": "Extract product listings with details, images, specifications, and pricing info.",
            "default": true
          },
          "scrapeSuppliers": {
            "title": "Scrape suppliers",
            "type": "boolean",
            "description": "Extract supplier profiles: country, verified level, business type, OEM/ODM skills, exhibitor status, major categories, certifications and rating.",
            "default": true
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of items (products + suppliers combined). Each item is billed once. HKTDC caps each search at ~10,000 items. Start with 10 for a test.",
            "default": 100
          },
          "sortType": {
            "title": "Sort by",
            "enum": [
              "BEST_MATCH",
              "NEWEST",
              "PRICE_ASC",
              "PRICE_DESC"
            ],
            "type": "string",
            "description": "How to order search results.",
            "default": "BEST_MATCH"
          },
          "supplierType": {
            "title": "Supplier type",
            "enum": [
              "",
              "Manufacturer",
              "Exporter",
              "Trading Company",
              "Service Provider",
              "OEM",
              "ODM"
            ],
            "type": "string",
            "description": "Filter by supplier type. Leave on 'All' for no filter.",
            "default": ""
          },
          "countryRegion": {
            "title": "Country / Region",
            "type": "string",
            "description": "Filter by supplier country or region, e.g. <code>Hong Kong</code>. Leave empty for all."
          },
          "factoryLocation": {
            "title": "Factory location",
            "type": "string",
            "description": "Filter by factory location (e.g. 'Guangdong', 'Shenzhen')."
          },
          "productCertification": {
            "title": "Product certification",
            "type": "string",
            "description": "Filter by product certification (e.g. 'CE', 'UL', 'RoHS')."
          },
          "companyCertification": {
            "title": "Company certification",
            "type": "string",
            "description": "Filter by company certification (e.g. 'ISO 9001', 'BSCI')."
          },
          "onlinePurchase": {
            "title": "Online purchase available",
            "type": "boolean",
            "description": "Only show products available for online purchase.",
            "default": false
          },
          "scrapeProductDetails": {
            "title": "Scrape full product details",
            "type": "boolean",
            "description": "Fetch full product details (all specifications, rich description, lead time, shipping) with one extra API call per product. Disabled = listing data only (faster). Items are billed the same either way.",
            "default": false
          },
          "maxImages": {
            "title": "Max images per product",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of image URLs to extract per product. Set to 0 to skip images.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Select proxies. The Actor calls HKTDC's public API directly (no browser). Datacenter proxies from the US work well. Residential proxies are NOT needed.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyCountry": "US"
            }
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Concurrent API requests. Start with 5; raise only if you see no blocking.",
            "default": 5
          },
          "maxRequestRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Number of times to retry a failed request before giving up.",
            "default": 3
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Verbose logging and raw unexpected API responses saved to the key-value store. Not needed for normal runs.",
            "default": false
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time in seconds to wait for an API response.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}