{
  "openapi": "3.0.1",
  "info": {
    "title": "DHgate Scraper - Prices, MOQ, Sold Counts & Stores ($0.50/1K)",
    "description": "Scrape DHgate.com search and category results: wholesale price ranges, MOQ, sold counts, ratings and store data, plus optional quantity price tiers. $0.50 per 1,000 products, platform usage included; failed pages and duplicates are free.",
    "version": "0.1",
    "x-build-id": "h3ro82il7OMZQzA7G"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ragnum~dhgate-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ragnum-dhgate-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/ragnum~dhgate-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ragnum-dhgate-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/ragnum~dhgate-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ragnum-dhgate-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": {
          "keywords": {
            "title": "Search keywords",
            "type": "array",
            "description": "What to search for on DHgate.com, one keyword per line, in English (for example \"yoga mat\", \"led strip\", \"bluetooth earbuds\"). Each keyword runs its own search. If you leave this and the listing URLs below empty, the scraper searches \"yoga mat\".",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Search or category URLs (optional)",
            "type": "array",
            "description": "Alternative to keywords: DHgate listing URLs. Supported: search pages like https://www.dhgate.com/wholesale/search.do?searchkey=yoga+mat (a pageNum or sort in the URL is kept) and category pages like https://www.dhgate.com/wholesale/yoga-mats/c024064004009.html or ...c024064004009-2.html to start at page 2. Category pages are read through DHgate's search page filtered to that category, which has the full product data. Product, store and promotion pages are not supported and make the run fail with a clear message before any request is made.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "default",
              "orders",
              "priceAsc",
              "priceDesc",
              "newest"
            ],
            "type": "string",
            "description": "Order of the results, as on DHgate's sort bar: Best match (default), Most orders, Price low to high, Price high to low, Newest. A sort given inside a start URL wins over this setting.",
            "default": "default"
          },
          "shipToCountry": {
            "title": "Ship to",
            "enum": [
              "US"
            ],
            "type": "string",
            "description": "Destination country DHgate uses for prices and shipping labels. Only the United States is supported in this version; prices come in US dollars.",
            "default": "US"
          },
          "includeDetails": {
            "title": "Include price tiers (product pages)",
            "type": "boolean",
            "description": "Also open each product's page and add its wholesale price tiers (quantity ranges with unit prices, e.g. 1–9 pcs $34.33, 1000+ pcs $16.39) and category path. Costs $0.002 per product on top of the $0.0005 listing price, and is slower (one extra page per product). If a product page can't be loaded, the product is still delivered with detailFetched=false and is not charged for details.",
            "default": false
          },
          "maxItemsPerKeyword": {
            "title": "Max products per keyword",
            "minimum": 1,
            "maximum": 3000,
            "type": "integer",
            "description": "Stop a keyword (or start URL) after this many unique products (default 20). One results page has about 40–50 products, so 100 needs about 2–3 pages. This is the main control of how much a run costs: 100 products = $0.05 (or $0.25 with price tiers).",
            "default": 20
          },
          "maxPagesPerKeyword": {
            "title": "Max results pages per keyword",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Upper limit of results pages tried per keyword or start URL (default 2, max 50; DHgate itself shows at most 3,000 results = 75 pages). A keyword stops at whichever comes first: this limit, Max products per keyword, or the last results page. A page that stays blocked after all retries does not stop the keyword (the next page is still fetched), but it counts toward this limit.",
            "default": 2
          },
          "maxRetriesPerPage": {
            "title": "Max retries per blocked page",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "DHgate sometimes refuses automated requests. The scraper never tries to get around this: a refused page is retried later, up to this many times. Retries are free for you. Lower values finish faster but can return fewer products.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Managed for you and included in the price. Keep the default: other settings mostly return blocked pages.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}