{
  "openapi": "3.0.1",
  "info": {
    "title": "CarMax Intelligence Scraper",
    "description": "Scrape CarMax inventory and enrich vehicles with deal scoring, price/mileage intelligence, transfer friction, feature signals, and risk flags.",
    "version": "1.0",
    "x-build-id": "flHd2yFsDU94dvrT7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lokki~carmax-intelligence-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lokki-carmax-intelligence-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/lokki~carmax-intelligence-scraper/runs": {
      "post": {
        "operationId": "runs-sync-lokki-carmax-intelligence-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/lokki~carmax-intelligence-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-lokki-carmax-intelligence-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": {
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "Free-text CarMax searches. Examples: toyota camry, honda cr-v, ford f-150, tesla model 3, awd suv under 30000.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "CarMax search URLs",
            "type": "array",
            "description": "Optional. Paste CarMax search/category URLs when you already have filtered searches from carmax.com. Example: https://www.carmax.com/cars/toyota/camry.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "zipCode": {
            "title": "ZIP code",
            "type": "string",
            "description": "Optional ZIP code for location-aware inventory, distance, and transfer estimates."
          },
          "radius": {
            "title": "Radius in miles",
            "minimum": 10,
            "maximum": 500,
            "type": "integer",
            "description": "Optional radius around the ZIP code. Leave blank for nationwide/default CarMax results."
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "bestmatch",
              "distance-asc",
              "price-asc",
              "price-desc",
              "mileage-asc",
              "mileage-desc",
              "year-desc",
              "year-asc",
              "newarrival"
            ],
            "type": "string",
            "description": "CarMax search sort. Best match is recommended for broad discovery; price/mileage sorts are useful for narrow comparison runs.",
            "default": "bestmatch"
          },
          "maxItems": {
            "title": "Maximum vehicles",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum unique vehicles to save across all searches after deduping by VIN/stock number. Default is intentionally small so Apify's automated QA run finishes quickly; increase it for production runs.",
            "default": 5
          },
          "pageSize": {
            "title": "Vehicles per API page",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many vehicles to request from each CarMax page. Default is smoke-test friendly; increase to 24-100 for larger runs.",
            "default": 12
          },
          "maxPages": {
            "title": "Maximum pages per search",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Pagination safety cap per search. Default is one page so marketplace automated QA finishes under 5 minutes.",
            "default": 1
          },
          "includeVehicleDetails": {
            "title": "Fetch vehicle detail data",
            "type": "boolean",
            "description": "Adds detail endpoint fields such as RepairPal/reliability hints, richer images, prior use, and extra vehicle metadata. Slower; enable for buyer research after the smoke test passes.",
            "default": false
          },
          "includeIntelligence": {
            "title": "Add deal intelligence",
            "type": "boolean",
            "description": "Adds dealScore, dealGrade, priceIntelligence, featureIntelligence, availabilityIntelligence, transferIntelligence, buyerSignalTags, riskFlags, and opportunitySummary.",
            "default": true
          },
          "minDealScore": {
            "title": "Minimum deal score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Optional post-filter. Use 75+ for strong opportunities or 85+ for only standout deals."
          },
          "priceMax": {
            "title": "Maximum price",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Optional post-filter on basePrice."
          },
          "mileageMax": {
            "title": "Maximum mileage",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Optional post-filter on mileage."
          },
          "modelYearMin": {
            "title": "Minimum model year",
            "minimum": 1900,
            "maximum": 2100,
            "type": "integer",
            "description": "Optional post-filter on vehicle year."
          },
          "modelYearMax": {
            "title": "Maximum model year",
            "minimum": 1900,
            "maximum": 2100,
            "type": "integer",
            "description": "Optional post-filter on vehicle year."
          },
          "requiredFeatures": {
            "title": "Required feature keywords",
            "type": "array",
            "description": "Optional post-filter. Every keyword must appear in features or highlights. Examples: leather, awd, apple carplay, panoramic sunroof.",
            "items": {
              "type": "string"
            }
          },
          "proxyConfiguration": {
            "title": "Proxy settings",
            "type": "object",
            "description": "Use Apify Residential Proxy if you see CarMax/Akamai 403s or timeouts.",
            "default": {
              "useApifyProxy": true,
              "groups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}