{
  "openapi": "3.0.1",
  "info": {
    "title": "Ali Express Tracking",
    "description": "AliExpress Tracking Checker tracks shipments using Cainiao, AliExpress logistics, and 17TRACK sources. It returns normalized status, carrier details, delivery flags, event history, locations, and structured tracking data for e-commerce automation.",
    "version": "0.0",
    "x-build-id": "UhurKKBHMwrVyfyv2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sovanza.inc~ali-express-tracking/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sovanza.inc-ali-express-tracking",
        "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/sovanza.inc~ali-express-tracking/runs": {
      "post": {
        "operationId": "runs-sync-sovanza.inc-ali-express-tracking",
        "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/sovanza.inc~ali-express-tracking/run-sync": {
      "post": {
        "operationId": "run-sync-sovanza.inc-ali-express-tracking",
        "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": [
          "trackingInputs"
        ],
        "properties": {
          "trackingInputs": {
            "title": "Tracking inputs",
            "type": "array",
            "description": "List of tracking requests. Each item may include trackingNumber, orderId, carrierHint, sourceHint, and countryHint. Plain strings are accepted as tracking numbers.",
            "items": {
              "type": "object",
              "properties": {
                "trackingNumber": {
                  "title": "Tracking number",
                  "type": "string",
                  "description": "Shipment tracking number.",
                  "editor": "textfield"
                },
                "orderId": {
                  "title": "Order ID",
                  "type": "string",
                  "description": "AliExpress order ID.",
                  "editor": "textfield"
                },
                "carrierHint": {
                  "title": "Carrier hint",
                  "type": "string",
                  "description": "Optional carrier name hint (e.g. Cainiao, DHL).",
                  "editor": "textfield"
                },
                "sourceHint": {
                  "title": "Source hint",
                  "type": "string",
                  "description": "Preferred source adapter to try first (e.g. cainiao_web).",
                  "editor": "textfield"
                },
                "countryHint": {
                  "title": "Country hint",
                  "type": "string",
                  "description": "Destination country code hint (e.g. US, PK).",
                  "editor": "textfield"
                }
              }
            }
          },
          "sourcePriority": {
            "title": "Source priority",
            "type": "array",
            "description": "Ordered list of tracking sources to try. The actor walks this list top-to-bottom and stops at the first source that returns valid data.",
            "default": [
              "cainiao_web",
              "aliexpress_web",
              "seventeen_track_web"
            ]
          },
          "includeEventHistory": {
            "title": "Include event history",
            "type": "boolean",
            "description": "Include the full timeline of tracking events in the output.",
            "default": true
          },
          "includeRawSourcePayload": {
            "title": "Include raw source payload",
            "type": "boolean",
            "description": "Include a sanitized raw source payload or extracted HTML text for debugging purposes.",
            "default": false
          },
          "includeDerivedStatus": {
            "title": "Include derived status",
            "type": "boolean",
            "description": "Compute a normalized high-level status from source-specific status strings.",
            "default": true
          },
          "maxEventsPerTracking": {
            "title": "Max events per tracking",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of tracking events to return per shipment.",
            "default": 50
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "dataset",
              "kv_store",
              "both"
            ],
            "type": "string",
            "description": "Where to write tracking results. dataset: default Apify dataset. kv_store: key-value store JSON bundle. both: write to both.",
            "default": "dataset"
          },
          "outputKvStoreKey": {
            "title": "Output KV store key",
            "type": "string",
            "description": "Key name used when writing results to the key-value store.",
            "default": "TRACKING_OUTPUT"
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 10,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time in seconds to wait for a single page navigation to complete.",
            "default": 45
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of tracking lookups to run in parallel.",
            "default": 5
          },
          "retriesPerSource": {
            "title": "Retries per source",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Number of retry attempts per source adapter before moving to the next source.",
            "default": 2
          },
          "challengeWaitSecs": {
            "title": "Challenge wait (seconds)",
            "minimum": 5,
            "maximum": 60,
            "type": "integer",
            "description": "Maximum time in seconds to wait for a Cloudflare or CAPTCHA challenge page to resolve.",
            "default": 12
          },
          "blockAssets": {
            "title": "Block assets",
            "type": "boolean",
            "description": "Block images, fonts, and other non-essential assets to speed up page loads.",
            "default": true
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Enable debug mode to save HTML snapshots and screenshots for failed or blocked pages.",
            "default": false
          },
          "saveHtmlSnapshot": {
            "title": "Save HTML snapshot",
            "type": "boolean",
            "description": "Save an HTML snapshot to the key-value store when extraction fails.",
            "default": false
          },
          "saveScreenshot": {
            "title": "Save screenshot",
            "type": "boolean",
            "description": "Save a page screenshot to the key-value store when extraction fails.",
            "default": false
          },
          "useCarrierAutoDetect": {
            "title": "Auto-detect carrier",
            "type": "boolean",
            "description": "Reserved for future use. Carrier auto-detection from tracking number format is not yet implemented.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy settings. Residential proxy is recommended for Cainiao, AliExpress, and 17TRACK pages.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          },
          "cookiesText": {
            "title": "Cookies (text)",
            "type": "string",
            "description": "Optional browser cookies in Netscape/tab-separated format. Each line: name<TAB>value<TAB>domain<TAB>path. Stored as a secret input and never written to the dataset."
          },
          "cookiesJson": {
            "title": "Cookies JSON (optional)",
            "type": "string",
            "description": "Optional Playwright cookie array JSON. Alternative to cookiesText. Stored as a secret input and never written to the dataset."
          },
          "seventeenTrackApiKey": {
            "title": "17TRACK API key (optional)",
            "type": "string",
            "description": "Optional 17TRACK API key for future API-based tracking. Currently unused; reserved for API adapter expansion."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}