{
  "openapi": "3.0.1",
  "info": {
    "title": "Zauba Trade Data Scraper: India Import Export",
    "description": "Scrape India customs shipment records from zauba.com by product keyword or HS code, for import or export trade. Get product description, quantity, unit price, and total value in native USD, plus origin country and port. Retries tuned to survive Cloudflare. No fabricated importer or exporter data.",
    "version": "0.1",
    "x-build-id": "bcEK9WIcG9MkFw7e5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/getascraper~zauba-trade-data-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-getascraper-zauba-trade-data-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/getascraper~zauba-trade-data-scraper/runs": {
      "post": {
        "operationId": "runs-sync-getascraper-zauba-trade-data-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/getascraper~zauba-trade-data-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-getascraper-zauba-trade-data-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": {
          "startUrls": {
            "title": "Zauba Category/HS-Code Page URLs",
            "type": "array",
            "description": "Paste one or more zauba.com \"page 1\" category or HS-code result URLs (e.g. https://www.zauba.com/import-mobile+phone/hs-code-85171290-hs-code.html), copied directly from a link on zauba.com's own left-hand HS-code filter list. These are fetched exactly as given (no search form submission). If left empty, the scraper submits the search form using the filters below instead.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "tradeType": {
            "title": "Trade Type",
            "enum": [
              "import",
              "export"
            ],
            "type": "string",
            "description": "Scrape import shipment records or export shipment records. Only used when Start URLs are empty (ignored for pasted Start URLs, which already encode import vs export in their path).",
            "default": "import"
          },
          "hsCode": {
            "title": "HS Code",
            "type": "string",
            "description": "Harmonized System code to search for (e.g. 85176290). zauba.com's live search form has a single free-text field that accepts either a product keyword or an HS code, not separate fields for each — if both HS Code and Product Keyword are set, HS Code is used and Product Keyword is ignored.",
            "default": ""
          },
          "productKeyword": {
            "title": "Product Keyword",
            "type": "string",
            "description": "Free-text product description search (e.g. 'mobile phone'). Used only when HS Code is empty.",
            "default": ""
          },
          "maxItems": {
            "title": "Max Shipment Records",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of shipment records to scrape. IMPORTANT: zauba.com only exposes the first ~20 results of any search for free — viewing further pages requires a logged-in zauba.com account, which this Actor does not support. Set this to 20 or less; a higher value will not produce more results from a single query.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "zauba.com is protected by a genuine Cloudflare JS challenge (confirmed via direct testing: DATACENTER and RESIDENTIAL proxy groups both receive a \"cf-mitigated: challenge\" 403 on every request). Only Apify's UNBLOCKER proxy group — purpose-built to solve JS/anti-bot challenges, not just rotate IP reputation — gets through. Do not switch this to RESIDENTIAL or DATACENTER; it will fail on the very first request.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "UNBLOCKER"
              ],
              "apifyProxyCountry": "IN"
            }
          },
          "maxRequestRetries": {
            "title": "Max Retries Per Request",
            "minimum": 0,
            "type": "integer",
            "description": "How many times to retry a request after a failed anti-bot challenge before giving up. zauba.com sits behind a genuine Cloudflare JS challenge; even through Apify's UNBLOCKER proxy, roughly 1 in 3-4 attempts succeeds, so a healthy retry budget matters more here than for most targets.",
            "default": 8
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum number of parallel requests. Keep this LOW (1-3) — the UNBLOCKER proxy's challenge-solving is resource-intensive per request, and higher concurrency does not speed up a single search (which returns at most one page of results).",
            "default": 2
          },
          "requestDelaySecs": {
            "title": "Minimum Delay Between Requests (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum pacing delay enforced between requests on the same session, in addition to Crawlee's built-in adaptive throttling.",
            "default": 3
          },
          "onlyNewShipments": {
            "title": "Only New Shipments (Monitoring)",
            "type": "boolean",
            "description": "When enabled, the first run builds a baseline of seen shipment IDs. Later runs with the same Monitoring State Key only output shipments not seen before, turning this into an incremental feed for scheduled/recurring runs. Note the free-tier ~20-row cap per query limits how much new data any single run can discover.",
            "default": false
          },
          "monitoringStateKey": {
            "title": "Monitoring State Key",
            "type": "string",
            "description": "Identifies the seen-shipments baseline in the key-value store. Use a distinct key per saved query/schedule so multiple monitors do not share state.",
            "default": "default"
          },
          "resetSeenShipments": {
            "title": "Reset Seen-Shipments Baseline",
            "type": "boolean",
            "description": "Clear the stored baseline for the given Monitoring State Key before this run, so all matching shipments are treated as new again.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}