{
  "openapi": "3.0.1",
  "info": {
    "title": "AliExpress Product Search Scraper (Crawlee, Proxy-Ready)",
    "description": "Scrape AliExpress search results by keywords with proxy support, session rotation, and cost guardrails. Outputs a clean, typed dataset (type: product) plus optional suggestion/unknown entries.\n\nAlso available as Pay-per-event version (better for automation/MCP).",
    "version": "1.3",
    "x-build-id": "dSh7Zj7PezWwp8IvL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/opalescent_junior~aliexpress-product-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-opalescent_junior-aliexpress-product-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/opalescent_junior~aliexpress-product-scraper/runs": {
      "post": {
        "operationId": "runs-sync-opalescent_junior-aliexpress-product-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/opalescent_junior~aliexpress-product-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-opalescent_junior-aliexpress-product-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",
        "required": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "List of search keywords to scrape on AliExpress. Example: [\"LED strip lights\", \"wireless earbuds\", \"phone case iPhone 15\"].",
            "items": {
              "type": "string"
            }
          },
          "maxQueries": {
            "title": "Max queries",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum number of queries to process from the list. Queries beyond this limit are silently dropped.",
            "default": 10
          },
          "maxPages": {
            "title": "Max pages per query",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many search result pages to scrape per query. AliExpress shows ~48 products per page. More pages = more products but higher cost and block risk.",
            "default": 3
          },
          "maxItemsTotal": {
            "title": "Max items total",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on total items pushed to the dataset across ALL queries. The Actor stops enqueueing new pages once this limit is reached. This is your main cost-control lever.",
            "default": 200
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Number of browser pages open simultaneously. AliExpress is sensitive to concurrent requests — keep this at 1-2 for reliability. Higher values increase speed but also block risk.",
            "default": 2
          },
          "throttleMs": {
            "title": "Throttle (ms)",
            "minimum": 1000,
            "maximum": 10000,
            "type": "integer",
            "description": "Minimum delay in milliseconds between page loads (plus random jitter). Lower = faster but higher block risk. Recommended: 2500+ for AliExpress.",
            "default": 2500
          },
          "maxRequestRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many times a failed/blocked request is retried with a new session before being marked as failed.",
            "default": 3
          },
          "headless": {
            "title": "Headless browser",
            "type": "boolean",
            "description": "Run browser without a visible window. Set to false for debugging only (increases cost).",
            "default": true
          },
          "enrich": {
            "title": "Enable enrichment",
            "type": "boolean",
            "description": "Visit individual product detail pages to extract more accurate prices, ratings, and order counts. Significantly increases run time and cost — use selectively.",
            "default": false
          },
          "enrichLimit": {
            "title": "Enrichment limit",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum number of products to enrich (visit detail pages). Only relevant when enrichment is enabled.",
            "default": 20
          },
          "includeSuggestions": {
            "title": "Include suggestions",
            "type": "boolean",
            "description": "Capture related-search / suggestion blocks from search result pages. When enabled, suggestions are added to the dataset with type='suggestion'. Products always have type='product'.",
            "default": false
          },
          "includeUnknown": {
            "title": "Include unknown items",
            "type": "boolean",
            "description": "Include items that have a valid product URL but no commerce signals (no price, rating, orders, storeName) and no valid image. These are likely suggestion anchors. When enabled, they appear in the dataset with type='unknown'.",
            "default": false
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings for AliExpress scraping. STRONGLY RECOMMENDED — scraping without proxy will almost certainly get blocked. Use RESIDENTIAL group for best reliability.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [],
              "apifyProxyCountry": "US",
              "proxyUrls": []
            }
          },
          "debugLog": {
            "title": "Debug logging",
            "type": "boolean",
            "description": "Enable verbose debug-level logs. Useful for troubleshooting but generates a lot of output.",
            "default": false
          },
          "saveHtmlOnError": {
            "title": "Save HTML on error",
            "type": "boolean",
            "description": "When a request is blocked or enrichment fails, save the page HTML to the Key-Value store for debugging. Limited to a few pages to avoid storage bloat.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}