{
  "openapi": "3.0.1",
  "info": {
    "title": "AliExpress Product Scraper API: Prices, Variants & Stock (速卖通)",
    "description": "Scrape AliExpress (速卖通) search and product pages at one moment: current price, discount, sold count, rating, and optional SKU price and stock. Not a price or discount history. Pin a ship-to country. For product research and price checks.",
    "version": "0.10",
    "x-build-id": "CDbIf941AHXpcAhOk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dheerajitbhu~aliexpress-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dheerajitbhu-aliexpress-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/dheerajitbhu~aliexpress-scraper/runs": {
      "post": {
        "operationId": "runs-sync-dheerajitbhu-aliexpress-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/dheerajitbhu~aliexpress-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-dheerajitbhu-aliexpress-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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "product",
              "selftest"
            ],
            "type": "string",
            "description": "What to scrape. No login needed.",
            "default": "search"
          },
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Used in 'search' mode. If left empty, the run uses 'phone case' as a sample keyword.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max products per keyword",
            "minimum": 1,
            "maximum": 3600,
            "type": "integer",
            "description": "AliExpress shows 60 products per search page.",
            "default": 60
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "best_match",
              "orders",
              "price_asc",
              "price_desc"
            ],
            "type": "string",
            "description": "Search result order.",
            "default": "best_match"
          },
          "fetchDetails": {
            "title": "Fetch full product details",
            "type": "boolean",
            "description": "Also open each product for all variants (SKUs) with prices and stock, properties, all images, review count, store and shipping info. Same price per product, but slower (2 extra requests per product).",
            "default": false
          },
          "excludeAds": {
            "title": "Skip sponsored results",
            "type": "boolean",
            "description": "Skip products marked as ads in the search results (they're flagged isAd otherwise).",
            "default": false
          },
          "productUrls": {
            "title": "Product links or ids",
            "type": "array",
            "description": "Used in 'product' mode. Example: https://www.aliexpress.com/item/1005006609906038.html or 1005006609906038.",
            "items": {
              "type": "string"
            }
          },
          "shipTo": {
            "title": "Ship-to country",
            "type": "string",
            "description": "Two-letter country code. Prices, shipping and delivery estimates are for this country (pinned, independent of the proxy location).",
            "default": "US"
          },
          "currency": {
            "title": "Currency",
            "type": "string",
            "description": "Three-letter currency code, e.g. USD, EUR, GBP.",
            "default": "USD"
          },
          "maxVariants": {
            "title": "Max variants per product",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Caps the variants list in detailed rows (variantCount always shows the full number).",
            "default": 100
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "standard",
              "compact"
            ],
            "type": "string",
            "description": "Dataset rows are always pushed and charged the same either way. 'compact' additionally writes OUTPUT_COMPACT to the run's key-value store: our lossless, token-optimized copy of the same rows, cheaper to hand to an LLM.",
            "default": "standard"
          },
          "maxChargeUsd": {
            "title": "Maximum charge per run (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Hard spending cap. The run stops cleanly before going over it; rows already delivered are kept.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Default: Apify datacenter proxy. The actor handles the site's access protections automatically and is maintained against site changes. Pick RESIDENTIAL to use residential IPs from the start.",
            "default": {
              "useApifyProxy": true
            }
          },
          "requestIntervalSecs": {
            "title": "Seconds between requests",
            "minimum": 0.5,
            "maximum": 10,
            "type": "number",
            "description": "Polite pacing between requests.",
            "default": 1.5
          },
          "detailConcurrency": {
            "title": "Parallel detail fetches",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "With 'Fetch full product details' on (or in 'product' mode), how many products to fetch at once. Each worker gets its own proxy session, so one blocked session doesn't stall the others. Higher is faster but hits AliExpress harder; 1 disables parallel fetching.",
            "default": 4
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "all",
              "changesOnly"
            ],
            "type": "string",
            "description": "Default 'all' exports every product, every run. 'changesOnly' remembers the last run (by product id) and exports only products that are new, changed, or no longer found — handy on a schedule. Works with mode='product' only (a fixed list of productUrls); mode='search' results reshuffle every run, so there's no stable set to diff, and 'changesOnly' there fails the run immediately with an input error, before any charge. Example: 'changesOnly' with mode='product' to get a daily diff instead of a full re-export.",
            "default": "all"
          },
          "monitorKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Only used with 'changesOnly'. Names the saved baseline so scheduled runs compare against the right one. Leave blank to derive it automatically from your other inputs. Example: 'phone-case-daily' if you run several monitors."
          },
          "includeRemoved": {
            "title": "Report removed products",
            "type": "boolean",
            "description": "Only used with 'changesOnly'. When true (default), products no longer found are reported once as removed. Example: false to only see new/changed products.",
            "default": true
          },
          "ignoreFields": {
            "title": "Fields to ignore when detecting changes (optional)",
            "type": "array",
            "description": "Only used with 'changesOnly'. Field names that should not, by themselves, trigger a 'changed' result. Example: [\"soldCount\"] to ignore sold-count drift and only react to price/stock/etc.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}