{
  "openapi": "3.0.1",
  "info": {
    "title": "1688 SKU Normalizer & Price Change Detector",
    "description": "Upload authorized 1688 or Chinese supplier CSV/XLSX exports. Normalize SKU attributes, validate identities, and compare price and stock changes between snapshots. No web scraping or login data.",
    "version": "0.12",
    "x-build-id": "yh3zvSFYs1MfPIHJQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crocheted_pipa~catalogdelta-1688-sku-normalizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crocheted_pipa-catalogdelta-1688-sku-normalizer",
        "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/crocheted_pipa~catalogdelta-1688-sku-normalizer/runs": {
      "post": {
        "operationId": "runs-sync-crocheted_pipa-catalogdelta-1688-sku-normalizer",
        "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/crocheted_pipa~catalogdelta-1688-sku-normalizer/run-sync": {
      "post": {
        "operationId": "run-sync-crocheted_pipa-catalogdelta-1688-sku-normalizer",
        "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": [
          "data_authorization_confirmed",
          "input_mode"
        ],
        "properties": {
          "data_authorization_confirmed": {
            "title": "Authorization confirmed",
            "type": "boolean",
            "description": "Confirm that you are authorized to provide and process this product data. Do not include accounts, passwords, cookies, tokens, personal data, or unlicensed data.",
            "default": false
          },
          "validation_only": {
            "title": "Validate only (no SKU output)",
            "type": "boolean",
            "description": "Check parsing, identities, comparison outcomes, and quality flags without writing SKU dataset rows or emitting normalized-current-sku events. A separately priced Actor start event may still apply.",
            "default": false
          },
          "input_mode": {
            "title": "Input mode",
            "enum": [
              "file_upload",
              "json_snapshots"
            ],
            "type": "string",
            "description": "Use file upload for CSV/XLSX exports, or JSON snapshots for API integrations."
          },
          "file_adapter": {
            "title": "File format",
            "enum": [
              "auto_detect_v1",
              "gycharm_1688_export_v1",
              "gycharm_1688_shopify_export_v1",
              "gycharm_1688_tiktok_export_v1",
              "generic_tabular_v1"
            ],
            "type": "string",
            "description": "Auto-detect safely identifies the three verified Gycharm formats or common generic headers. If detection fails, select an exact preset, or select Generic and provide mapped columns. Shopify/TikTok files do not declare currency, so set Currency of file prices before comparing prices.",
            "default": "auto_detect_v1"
          },
          "file_currency": {
            "title": "Currency of file prices",
            "pattern": "^[A-Za-z]{3}$",
            "minLength": 3,
            "maxLength": 3,
            "type": "string",
            "description": "Optional three-letter currency code. Set this for Shopify-target or TikTok-target exports because those files label a local price but do not identify its currency. Do not guess; use the currency configured when the export was produced."
          },
          "current_file": {
            "title": "Current CSV or XLSX",
            "type": "string",
            "description": "Required in file-upload mode. Upload a UTF-8/GB18030 CSV or an unencrypted XLSX file, maximum 15 MB and 10,000 data rows."
          },
          "current_observed_at": {
            "title": "Current observation time",
            "type": "string",
            "description": "Required in file-upload mode. ISO 8601 with timezone, for example 2026-09-12T09:00:00+08:00."
          },
          "previous_file": {
            "title": "Previous CSV or XLSX",
            "type": "string",
            "description": "Optional earlier export in the same format. Upload it to detect price and stock changes."
          },
          "previous_observed_at": {
            "title": "Previous observation time",
            "type": "string",
            "description": "Required only when a previous file is supplied. It must be earlier than the current observation time."
          },
          "field_mapping": {
            "title": "Generic file field mapping",
            "type": "object",
            "description": "Optional for generic files. First select Generic CSV/XLSX, then map standard fields to your exact header names. Auto-detect intentionally rejects a mapping so it cannot silently override a detected preset.",
            "properties": {
              "product_id": {
                "type": "string",
                "minLength": 1,
                "title": "Product ID header",
                "description": "Exact source header containing the product identifier."
              },
              "sku_id": {
                "type": "string",
                "minLength": 1,
                "title": "SKU ID header",
                "description": "Exact source header containing the SKU identifier."
              },
              "price": {
                "type": "string",
                "minLength": 1,
                "title": "Price header",
                "description": "Exact source header containing a single SKU price."
              },
              "price_min": {
                "type": "string",
                "minLength": 1,
                "title": "Minimum price header",
                "description": "Exact source header containing the lower bound of a price range."
              },
              "price_max": {
                "type": "string",
                "minLength": 1,
                "title": "Maximum price header",
                "description": "Exact source header containing the upper bound of a price range."
              },
              "currency": {
                "type": "string",
                "minLength": 1,
                "title": "Currency header",
                "description": "Exact source header containing a three-letter currency code."
              },
              "price_basis": {
                "type": "string",
                "minLength": 1,
                "title": "Price basis header",
                "description": "Exact source header describing how the price should be interpreted."
              },
              "stock_status": {
                "type": "string",
                "minLength": 1,
                "title": "Stock status header",
                "description": "Exact source header containing the stock state."
              },
              "stock_quantity": {
                "type": "string",
                "minLength": 1,
                "title": "Stock quantity header",
                "description": "Exact source header containing a stock quantity used to derive in-stock or out-of-stock."
              },
              "attribute_columns": {
                "type": "object",
                "title": "Attribute headers",
                "description": "Map normalized attribute names to exact source header names.",
                "additionalProperties": true
              },
              "default_currency": {
                "type": "string",
                "pattern": "^[A-Za-z]{3}$",
                "title": "Default currency",
                "description": "Three-letter currency applied when the file has no currency column."
              },
              "default_price_basis": {
                "type": "string",
                "minLength": 1,
                "title": "Default price basis",
                "description": "Price interpretation applied when the file has no price-basis column."
              }
            },
            "additionalProperties": false
          },
          "adapter_version": {
            "title": "Adapter version",
            "enum": [
              "catalogdelta_snapshot_v1",
              "taobao_export_v0_1"
            ],
            "type": "string",
            "description": "Used only in JSON mode. catalogdelta_snapshot_v1 is the stable public JSON contract; the legacy candidate remains for compatibility.",
            "default": "catalogdelta_snapshot_v1"
          },
          "current_snapshot": {
            "title": "Current snapshot",
            "type": "object",
            "description": "Required snapshot with a timezone-aware observed_at and product records containing SKU arrays."
          },
          "previous_snapshot": {
            "title": "Previous snapshot",
            "type": "object",
            "description": "Optional earlier snapshot in the same format. Omit it for normalization only."
          },
          "stale_after_days": {
            "title": "Stale threshold in days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Adds a stale_observation quality flag when the current snapshot is older than this threshold. Keep the 7-day default for live supplier data; larger values are intended for fixed-date demonstrations or documented archival workflows.",
            "default": 7
          },
          "max_current_skus": {
            "title": "Maximum current SKUs",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Actor-side safety limit. A platform charging limit can reduce it further. V1 never exceeds 10,000 current SKUs per run.",
            "default": 10000
          },
          "action_min_price_change_amount": {
            "title": "Action list: minimum absolute price change",
            "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$",
            "maxLength": 30,
            "type": "string",
            "description": "Optional non-negative decimal in each row's own currency. It filters only price-only rows from the convenience action CSV; stock changes, new rows, non-comparable rows, full results, and billing stay unchanged. When both thresholds are set, meeting either available threshold keeps the row."
          },
          "action_min_price_change_percent": {
            "title": "Action list: minimum absolute price change (%)",
            "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$",
            "maxLength": 30,
            "type": "string",
            "description": "Optional non-negative decimal percentage. It filters only price-only rows from the convenience action CSV. A row with an unavailable percentage is retained for review when this is the only threshold."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}