{
  "openapi": "3.0.1",
  "info": {
    "title": "Mascus Scraper — Used Machinery Listings & Price Monitor",
    "description": "Scrape Mascus used machinery listings: asking prices, make/model/year, hours, dealer phones when published, and images. Browse by category, brand, or country. Details mode adds serials and specs. Monitor new listings and price changes.",
    "version": "0.1",
    "x-build-id": "0Ebvd4WZZOaeEELva"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawloop~mascus-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawloop-mascus-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~mascus-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawloop-mascus-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~mascus-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawloop-mascus-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": "Mascus category, brand, country, or listing detail URLs. Parent categories work (e.g. /construction/excavators). Dealer profile pages do not expose inventory in HTML. Example: https://www.mascus.com/construction/crawler-excavators",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Keep listings whose brand, model, or title contain these words (applied after fetch, before charge). Example: 336 or Volvo EC."
          },
          "mainCategory": {
            "title": "Equipment type",
            "enum": [
              "construction",
              "agriculture",
              "forestry",
              "groundcare",
              "material-handling",
              "transportation"
            ],
            "type": "string",
            "description": "Builds a browse URL when startUrls is empty. Parent listing pages are used (not /main-category hubs)."
          },
          "subcategory": {
            "title": "Category slug",
            "type": "string",
            "description": "Optional leaf or parent slug (e.g. crawler-excavators, excavators, tractors, forklift-trucks). Combined with mainCategory."
          },
          "manufacturer": {
            "title": "Manufacturer",
            "type": "string",
            "description": "Brand slug or name for a built browse URL (e.g. cat, komatsu, john_deere). Full pagination is kept — unlike Store competitors that cap faceted crawls at page 1."
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 code for a built browse URL (e.g. de, us, nl). Uses Mascus /{cc},country.html paths so pagination continues past page 1."
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "relevance",
              "date",
              "priceasc",
              "pricedesc"
            ],
            "type": "string",
            "description": "Result order for paginated browse URLs.",
            "default": "relevance"
          },
          "advertType": {
            "title": "Advert type",
            "enum": [
              "all",
              "sale",
              "auction",
              "rent"
            ],
            "type": "string",
            "description": "Keep sale, auction, or rental listings. Applied after fetch, before charge.",
            "default": "all"
          },
          "yearMin": {
            "title": "Year built (min)",
            "minimum": 1950,
            "maximum": 2030,
            "type": "integer",
            "description": "Drop listings older than this year when year is published. Applied before charge."
          },
          "yearMax": {
            "title": "Year built (max)",
            "minimum": 1950,
            "maximum": 2030,
            "type": "integer",
            "description": "Drop listings newer than this year when year is published. Applied before charge."
          },
          "priceMin": {
            "title": "Price (min, listing currency)",
            "type": "integer",
            "description": "Drop priced listings below this amount. Listings without a price pass unless pricedOnly is set."
          },
          "priceMax": {
            "title": "Price (max, listing currency)",
            "type": "integer",
            "description": "Drop priced listings above this amount. Listings without a price pass unless pricedOnly is set."
          },
          "hoursMax": {
            "title": "Max operating hours",
            "type": "integer",
            "description": "Drop listings with more hours than this when hours are published."
          },
          "pricedOnly": {
            "title": "Only listings with price",
            "type": "boolean",
            "description": "Skip rows with no published asking price.",
            "default": false
          },
          "baseUrl": {
            "title": "Base URL",
            "type": "string",
            "description": "Origin for built browse URLs. Default English mascus.com. Regional hosts in startUrls are kept as-is.",
            "default": "https://www.mascus.com"
          },
          "runMode": {
            "title": "Run Mode",
            "enum": [
              "listings",
              "details"
            ],
            "type": "string",
            "description": "listings = card fields (price, hours, phone when the card publishes one). details = open each PDP for serial, gallery, company website, and specs when shown.",
            "default": "listings"
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum dataset rows to emit (in monitor seed runs: max listings to fingerprint).",
            "default": 50
          },
          "maxPagesPerUrl": {
            "title": "Max Pages per Start URL",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum pagination pages per category / brand / country URL (40 listings per page).",
            "default": 10
          },
          "concurrencyLimit": {
            "title": "Max Concurrency Limit",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Parallel PDP fetches in details mode.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Residential Proxies recommended for stable runs at scale."
          },
          "monitorMode": {
            "title": "Monitoring Mode",
            "type": "boolean",
            "description": "Delta tracking for category, brand, or country 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 (category, brand, or country).",
            "default": "mascus-monitor-state"
          },
          "telegramToken": {
            "title": "Telegram Bot Token",
            "type": "string",
            "description": "Bot token for real-time alerts on new listings and price changes (monitorMode only). Create a bot via @BotFather."
          },
          "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}