{
  "openapi": "3.0.1",
  "info": {
    "title": "Tiebaobei Used Machinery Scraper",
    "description": "Scrapes used construction machinery listings from int.tiebaobei.com (Iron Armour / cehome.com). Extracts excavators, loaders, cranes, pumps and mixer trucks with prices, specs, photos and seller info.",
    "version": "0.1",
    "x-build-id": "rmySI2Nb0TaYlkcgl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rastriq~tiebaobei-machinery-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rastriq-tiebaobei-machinery-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/rastriq~tiebaobei-machinery-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rastriq-tiebaobei-machinery-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/rastriq~tiebaobei-machinery-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rastriq-tiebaobei-machinery-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",
        "properties": {
          "mode": {
            "title": "🔧 Scraping mode",
            "enum": [
              "inventory",
              "full",
              "incremental"
            ],
            "type": "string",
            "description": "Choose how much data to extract per listing:<br><br>• <b>inventory</b> — Fast. Uses the public API only (~87 requests for 8,600+ machines). Returns: id, title, brand, model, category, hours, year, location, photo count, status flags. No price or seller.<br>• <b>full</b> — Slower. Fetches each listing page for enriched data: numeric price (CNY), tonnage, annotated photos, seller contact, inspection report flags.<br>• <b>incremental</b> — Like 'inventory' but only returns listings updated since the last run (compares updateTimeInfo). Ideal for daily monitoring.",
            "default": "inventory"
          },
          "keyword": {
            "title": "🔍 Search keyword",
            "type": "string",
            "description": "Optional keyword to filter listings (e.g. <code>caterpillar</code>, <code>komatsu 320</code>). Leave empty to scrape the full catalog."
          },
          "categories": {
            "title": "📂 Equipment categories",
            "uniqueItems": true,
            "type": "array",
            "description": "Select one or more categories. Leave empty to scrape all categories.",
            "items": {
              "type": "string",
              "enum": [
                "wajueji",
                "zhuangzaiji",
                "qizhongji",
                "bengche",
                "jiaobanche"
              ],
              "enumTitles": [
                "🏗️ Excavators (挖掘机)",
                "🚜 Loaders (装载机)",
                "🏗️ Cranes (起重机)",
                "🚿 Pump trucks (泵车)",
                "🚛 Mixer trucks (搅拌车)"
              ]
            }
          },
          "maxItems": {
            "title": "Max listings",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum number of listings to extract. Use a low value (5-10) for your first test run. Set to <code>0</code> for unlimited.",
            "default": 100
          },
          "includePhotos": {
            "title": "Include photo URLs",
            "type": "boolean",
            "description": "If enabled, includes an array of photo URLs (CDN thumbnail 320x240) for each listing. Only available in <b>full</b> mode.",
            "default": true
          },
          "includeSeller": {
            "title": "Include seller info",
            "type": "boolean",
            "description": "If enabled, includes seller name and manager ID. Only available in <b>full</b> mode. <b>Note:</b> Treat seller data with care — do not publish personal contact information.",
            "default": false
          },
          "currency": {
            "title": "Price currency",
            "enum": [
              "CNY",
              "USD"
            ],
            "type": "string",
            "description": "Currency for the price field. The site stores prices in CNY. If USD is selected, the actor fetches the live exchange rate from tiebaobei's own API.",
            "default": "CNY"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum parallel requests for detail page scraping (full mode). Higher = faster but more load on the server. The API phase always runs sequentially.",
            "default": 3
          },
          "requestDelay": {
            "title": "Request delay (ms)",
            "minimum": 200,
            "maximum": 10000,
            "type": "integer",
            "description": "Base delay between requests in milliseconds. A random jitter of ±50% is added automatically.",
            "default": 1000
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Enable verbose logging for troubleshooting. Logs every request URL and response status.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}