{
  "openapi": "3.0.1",
  "info": {
    "title": "Cargurus Com Scraper",
    "description": null,
    "version": "1.0",
    "x-build-id": "YAu2NdZnUbq7BS3Kx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/api-empire~cargurus-com-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-api-empire-cargurus-com-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/api-empire~cargurus-com-scraper/runs": {
      "post": {
        "operationId": "runs-sync-api-empire-cargurus-com-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/api-empire~cargurus-com-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-api-empire-cargurus-com-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": {
          "urls": {
            "title": "🔗 CarGurus search URLs (optional, bulk-friendly)",
            "type": "array",
            "description": "🗺️ Paste one or more CarGurus search-result URLs.\n\n🔎 Example: `https://www.cargurus.com/Cars/inventorylisting/viewDetailsFilterViewInventoryListing.action?...` or `https://www.cargurus.com/search?...`\n\n💡 Tip: build the perfect search on the CarGurus website (filter by zip, make, model, year, mileage…) then copy the URL straight from the address bar.\n\n✅ Bulk friendly — add as many URLs as you like, the actor will paginate through each.\n\n📭 Leave empty to instead use the **Country + ZIP + Make** picker in Step 2.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "🌐 Country",
            "enum": [
              "US",
              "CA",
              "UK"
            ],
            "type": "string",
            "description": "🗺️ Which CarGurus marketplace to query.\n\n🇺🇸 `US` → cargurus.com (USD)\n🇨🇦 `CA` → cargurus.ca (CAD)\n🇬🇧 `UK` → cargurus.co.uk (GBP)",
            "default": "US"
          },
          "zipcode": {
            "title": "📮 ZIP / Postal code",
            "type": "string",
            "description": "🏷️ ZIP / postcode the search should be anchored to.\n\n🇺🇸 5-digit US ZIP (e.g. `10001`)\n🇨🇦 Canadian FSA (e.g. `M5V`)\n🇬🇧 UK outward code (e.g. `SW1A`)"
          },
          "make": {
            "title": "🚘 Make",
            "enum": [
              "Acura",
              "Alfa Romeo",
              "Aston Martin",
              "Audi",
              "Bentley",
              "BMW",
              "Buick",
              "Cadillac",
              "Chevrolet",
              "Chrysler",
              "Dodge",
              "Ferrari",
              "Fiat",
              "Ford",
              "Genesis",
              "GMC",
              "Honda",
              "Hyundai",
              "Infiniti",
              "Jaguar",
              "Jeep",
              "Kia",
              "Lamborghini",
              "Land Rover",
              "Lexus",
              "Lincoln",
              "Lotus",
              "Maserati",
              "Mazda",
              "McLaren",
              "Mercedes-Benz",
              "MINI",
              "Mitsubishi",
              "Nissan",
              "Polestar",
              "Porsche",
              "RAM",
              "Rivian",
              "Rolls-Royce",
              "Subaru",
              "Tesla",
              "Toyota",
              "Volkswagen",
              "Volvo"
            ],
            "type": "string",
            "description": "🏭 Vehicle brand to search for. Pick from the dropdown — the actor uses the CarGurus internal make-ID for accuracy and also filters client-side.",
            "default": "Toyota"
          },
          "model": {
            "title": "🚗 Model (optional)",
            "type": "string",
            "description": "🎯 Optional — narrow results to a specific model name (e.g. `Camry`, `RAV4`, `Civic`). Leave blank to fetch every model from the selected make.\n\n🧠 The model name must match what CarGurus shows in the listing (case-insensitive)."
          },
          "condition": {
            "title": "🆕🛞 Condition",
            "enum": [
              "used",
              "new"
            ],
            "type": "string",
            "description": "✨ Filter by vehicle condition:\n\n🛞 `Used` → pre-owned standard + CPO + priority listings\n🆕 `New` → factory-fresh listings\n\n💡 Also applied when scraping the URLs in Step 1, if you want to enforce a condition.",
            "default": "used"
          },
          "maxItems": {
            "title": "📊 Maximum listings",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "📦 Cap how many *matching* listings to collect in total.\n\n0️⃣ Use 0 for no limit (we'll keep paginating until CarGurus stops returning new VINs).\n\n⚡ Lower = faster & lighter; higher = broader coverage.\n\n🧠 The page budget is sized automatically from this value — no extra knobs to tune.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy configuration (optional)",
            "type": "object",
            "description": "🛰️ Optional Apify Proxy settings.\n\n🟢 Leave blank to use the smart 3-stage fallback: **no proxy → datacenter → residential (×3)**.\n\n🔵 Provide your own choice (e.g. RESIDENTIAL with country=US) to force a starting strategy — the actor will still fall back if that fails."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}