{
  "openapi": "3.0.1",
  "info": {
    "title": "LeaseCosts Canada",
    "description": "Extract Canadian lease takeover listings, payments, terms, and incentives from LeaseCosts.",
    "version": "1.3",
    "x-build-id": "g47EnLKFzDkJmjtnP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/canadesk~leasecosts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-canadesk-leasecosts",
        "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/canadesk~leasecosts/runs": {
      "post": {
        "operationId": "runs-sync-canadesk-leasecosts",
        "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/canadesk~leasecosts/run-sync": {
      "post": {
        "operationId": "run-sync-canadesk-leasecosts",
        "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": "Operation",
            "enum": [
              "listing",
              "search",
              "location",
              "detail"
            ],
            "type": "string",
            "description": "Choose the source listing operation.",
            "default": "listing"
          },
          "queries": {
            "title": "Search several keywords",
            "type": "array",
            "description": "Optional list of up to 100 inputs in one run. Replaces the single input and selects its corresponding operation. Use only one batch list.",
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "Vehicle or location keywords",
            "type": "string",
            "description": "Optional case-insensitive match against vehicle make/model/trim and location within collected pages. Search mode requires this or at least one filter."
          },
          "urls": {
            "title": "Listing URLs",
            "type": "array",
            "description": "Optional list of up to 100 inputs in one run. Replaces the single input and selects its corresponding operation. Use only one batch list.",
            "items": {
              "type": "string"
            }
          },
          "url": {
            "title": "Public listing URL",
            "type": "string",
            "description": "Required in Listing detail mode unless Listing ID is provided. Must be a public LeaseCosts listing URL."
          },
          "listingIds": {
            "title": "Listing IDs",
            "type": "array",
            "description": "Optional list of up to 100 inputs in one run. Replaces the single input and selects its corresponding operation. Use only one batch list.",
            "items": {
              "type": "string"
            }
          },
          "listingId": {
            "title": "Listing ID",
            "pattern": "^#?\\d+$",
            "type": "string",
            "description": "Required in Listing detail mode when URL is not supplied. A numeric public LeaseCosts listing ID."
          },
          "province": {
            "title": "Province",
            "type": "string",
            "description": "Optional source province label or source ID."
          },
          "location": {
            "title": "Metro Area",
            "type": "string",
            "description": "Exact Metro Area label from LeaseCosts, such as a city area. Used by Location mode; the source resolves the matching option."
          },
          "maxResults": {
            "title": "Maximum listings",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum real records across the entire run, shared by all inputs.",
            "default": 100
          },
          "maxResultsPerInput": {
            "title": "Maximum results per input",
            "minimum": 1,
            "type": "integer",
            "description": "Optional limit per batch input, within the run-wide Maximum results limit. Inputs are processed in order."
          },
          "area": {
            "title": "Metro Area source value",
            "type": "string",
            "description": "Optional LeaseCosts area label or source area ID."
          },
          "year": {
            "title": "Vehicle year",
            "type": "string",
            "description": "Optional vehicle year or source option ID."
          },
          "make": {
            "title": "Make",
            "type": "string",
            "description": "Optional manufacturer name or source make value."
          },
          "vehicleType": {
            "title": "Vehicle type",
            "type": "string",
            "description": "Optional vehicle type label or source option ID."
          },
          "traction": {
            "title": "Drivetrain",
            "type": "string",
            "description": "Optional drivetrain label or source option ID."
          },
          "transmission": {
            "title": "Transmission",
            "type": "string",
            "description": "Optional transmission label or source option ID."
          },
          "additionalIncentives": {
            "title": "Additional incentives",
            "type": "string",
            "description": "Optional additional-incentive source option label or ID."
          },
          "specialPerks": {
            "title": "Special perks",
            "type": "string",
            "description": "Optional special-perk source option label or ID."
          },
          "minMonthlyPayment": {
            "title": "Minimum monthly payment (CAD)",
            "minimum": 0,
            "type": "number",
            "description": "Optional lower bound for the advertised monthly payment."
          },
          "maxMonthlyPayment": {
            "title": "Maximum monthly payment (CAD)",
            "minimum": 0,
            "type": "number",
            "description": "Optional upper bound for the advertised monthly payment."
          },
          "transfered": {
            "title": "Listing status",
            "enum": [
              "All",
              "1",
              "2"
            ],
            "type": "string",
            "description": "Choose which source listing status to include.",
            "default": "1"
          },
          "sortBy": {
            "title": "Sort listings by",
            "enum": [
              "created",
              "field_transfer_monthly_payment_value",
              "field_cash_incentive_value",
              "field_current_km_value"
            ],
            "type": "string",
            "description": "Source-side listing order.",
            "default": "created"
          },
          "sortOrder": {
            "title": "Sort direction",
            "enum": [
              "ASC",
              "DESC"
            ],
            "type": "string",
            "description": "Direction for the selected source sort.",
            "default": "DESC"
          },
          "includeDetails": {
            "title": "Enrich listing results with details",
            "type": "boolean",
            "description": "Fetch published detail fields for up to Maximum detail requests. When a detail request fails, the original listing remains in results and the source issue is reported.",
            "default": false
          },
          "page": {
            "title": "Starting page",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Zero-based LeaseCosts results page to start from.",
            "default": 0
          },
          "itemsPerPage": {
            "title": "Listings per page",
            "minimum": 20,
            "maximum": 80,
            "type": "integer",
            "description": "Number of source listings per page; LeaseCosts supports 20, 40, 50 or 80.",
            "default": 40
          },
          "maxPages": {
            "title": "Maximum pages",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum listing pages to fetch. Actual work is also bounded by the actor request/time limits.",
            "default": 1
          },
          "maxDetails": {
            "title": "Maximum detail requests",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum additional detail page requests. Set above zero to use detail enrichment; the default is 0.",
            "default": 0
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy for public LeaseCosts requests."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}