{
  "openapi": "3.0.1",
  "info": {
    "title": "1688 Factory Matcher & TikTok Shop / Amazon Profit Scout",
    "description": "Stop losing money on 'GMV Illusion'! Converts English product titles or TikTok Shop/Amazon URLs into authentic 1688 Chinese factory keywords, filters out middlemen, and calculates real landed USD Net Contribution Margin (after DDP freight, tariffs, affiliate cuts & refunds).",
    "version": "1.0",
    "x-build-id": "0x33RckoJfwOYP8p0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aitruelabs~truemargin-1688-profit-scout/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aitruelabs-truemargin-1688-profit-scout",
        "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/aitruelabs~truemargin-1688-profit-scout/runs": {
      "post": {
        "operationId": "runs-sync-aitruelabs-truemargin-1688-profit-scout",
        "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/aitruelabs~truemargin-1688-profit-scout/run-sync": {
      "post": {
        "operationId": "run-sync-aitruelabs-truemargin-1688-profit-scout",
        "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": {
          "items": {
            "title": "Products to Audit (Keywords, URLs, or JSON SKU lines)",
            "type": "array",
            "description": "List of English product names (e.g. 'Magnetic Neck Phone Mount | 29.99 | 240g'), marketplace URLs, or product queries.",
            "default": [
              "Magnetic POV Neck Phone Holder | 27.99 | 260g",
              "Portable Mini Thermal Pocket Printer | 24.99 | 210g",
              "Electric Gua Sha Heated Facial Massager | 34.99 | 180g"
            ],
            "items": {
              "type": "string"
            }
          },
          "salesChannel": {
            "title": "Target Sales Channel",
            "enum": [
              "tiktok_shop_us",
              "shopify_dtc",
              "amazon_fba_us"
            ],
            "type": "string",
            "description": "Platform fee & fulfillment model used to compute real Net Contribution Margin.",
            "default": "tiktok_shop_us"
          },
          "shippingMode": {
            "title": "Cross-Border Logistics Mode (China -> US/EU)",
            "enum": [
              "direct_packet_3pl",
              "air_ddp_fast",
              "sea_ddp_bulk"
            ],
            "type": "string",
            "description": "Determines landed per-unit freight & customs clearance cost.",
            "default": "direct_packet_3pl"
          },
          "creatorAffiliatePct": {
            "title": "Creator Affiliate Commission (%)",
            "minimum": 0,
            "maximum": 50,
            "type": "number",
            "description": "Creator commission rate (typically 10% - 20% on TikTok Shop).",
            "default": 15
          },
          "expectedRefundRatePct": {
            "title": "Expected Return / Refund Rate (%)",
            "minimum": 0,
            "maximum": 60,
            "type": "number",
            "description": "Realistic apparel/gadget return rate on impulse social commerce (typically 10% - 20%).",
            "default": 14
          },
          "adSpendCpaUsd": {
            "title": "Paid Ad / Sample Burn Per Order (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Blended paid ad CPA + amortized free creator sample cost per order.",
            "default": 3.5
          },
          "minFactoryRepurchaseRatePct": {
            "title": "Min 1688 Factory Repurchase Rate (%)",
            "minimum": 0,
            "maximum": 80,
            "type": "integer",
            "description": "Filters out Taobao middlemen by requiring repeat B2B buyer rate >= threshold.",
            "default": 20
          },
          "usdCnyRate": {
            "title": "USD to CNY Exchange Rate",
            "type": "number",
            "description": "FX rate used to convert 1688 RMB factory quotes into USD.",
            "default": 7.22
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional Apify Proxy configuration for live marketplace scraping."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}