{
  "openapi": "3.0.1",
  "info": {
    "title": "MachineryTrader Scraper — Dealer Inventory & Price Monitor",
    "description": "Scrape MachineryTrader heavy equipment listings for dealers and buyers: asking prices, make/model/year, hours, serials, dealer phones, and images. Monitor mode tracks new inventory and price changes.",
    "version": "0.2",
    "x-build-id": "sohDfTxeOLYOJkQ5E"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawloop~machinerytrader-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawloop-machinerytrader-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/crawloop~machinerytrader-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawloop-machinerytrader-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/crawloop~machinerytrader-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawloop-machinerytrader-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": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Search results, category SEO pages, dealer inventory URLs (AccountCRMID / LocationID), or direct listing detail pages. Example: https://www.machinerytrader.com/listings/search?ListingType=For%20Retail&Category=1031",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchQuery": {
            "title": "Search keywords",
            "type": "string",
            "description": "Optional keyword search appended as a built search URL (e.g. excavator, D6, skid steer)."
          },
          "listingType": {
            "title": "Listing type",
            "enum": [
              "For Retail",
              "For Rent",
              "Auction Results"
            ],
            "type": "string",
            "description": "Used when building a search URL from filters (or when startUrls is empty). Auction Results metadata is public; sold prices are often login-gated.",
            "default": "For Retail"
          },
          "manufacturer": {
            "title": "Manufacturer",
            "type": "string",
            "description": "Filter by brand when building a search URL (e.g. CATERPILLAR, JOHN DEERE, KOMATSU, BOBCAT)."
          },
          "category": {
            "title": "Category ID",
            "type": "string",
            "description": "MachineryTrader category id (e.g. 1031 excavators, 1025 dozers, 1001 aggregate). Used when building a search URL."
          },
          "accountCrmId": {
            "title": "Dealer AccountCRMID",
            "type": "string",
            "description": "Watch a single dealer inventory by AccountCRMID (from listing cards). Builds /listings/search?...&AccountCRMID=..."
          },
          "state": {
            "title": "US state",
            "type": "string",
            "description": "Optional state filter when building a search URL (e.g. TX, CA, FL)."
          },
          "sort": {
            "title": "Sort",
            "type": "string",
            "description": "Optional sort key for built search URLs (9 = Recently Added, 2 = Price Low→High, 3 = Price High→Low, 5 = Year High→Low)."
          },
          "baseUrl": {
            "title": "Base URL",
            "type": "string",
            "description": "Site origin for built search URLs. Default MachineryTrader US.",
            "default": "https://www.machinerytrader.com"
          },
          "runMode": {
            "title": "Run Mode",
            "enum": [
              "listings",
              "details"
            ],
            "type": "string",
            "description": "listings = fast card fields (price, make/model, hours, dealer phone, images). details = also visit each PDP for ld+json address enrichment.",
            "default": "listings"
          },
          "pricedOnly": {
            "title": "Only listings with price",
            "type": "boolean",
            "description": "Skip Call-for-price / zero-price rows (and gated Auction Results sold prices that show as 0).",
            "default": false
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum dataset rows to emit (in monitor seed runs: max listings to fingerprint).",
            "default": 100
          },
          "maxPagesPerUrl": {
            "title": "Max Pages per Start URL",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum pagination pages per search / dealer inventory URL (28 listings per page).",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Residential Proxies recommended — MachineryTrader uses Cloudflare."
          },
          "concurrencyLimit": {
            "title": "Max Concurrency Limit",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Parallel PDP fetches in details mode.",
            "default": 5
          },
          "monitorMode": {
            "title": "Monitoring Mode",
            "type": "boolean",
            "description": "Delta tracking for category, search, or dealer inventory URLs. First run seeds a named Key-Value store (no dataset rows / alerts). Later runs output only new listings and price changes. Pair with an Apify Schedule.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor Store Name",
            "type": "string",
            "description": "Named Key-Value store for fingerprints across scheduled runs. Use a distinct name per watch target (dealer or category).",
            "default": "machinerytrader-monitor-state"
          },
          "telegramToken": {
            "title": "Telegram Bot Token",
            "type": "string",
            "description": "Bot token for real-time alerts on new listings and price changes (monitorMode only)."
          },
          "telegramChatId": {
            "title": "Telegram Chat ID",
            "type": "string",
            "description": "Telegram user or group chat ID that receives monitor alerts."
          },
          "resetMonitorState": {
            "title": "Reset Monitor State",
            "type": "boolean",
            "description": "Clear stored listing fingerprints before this run (forces a fresh seed run).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}