{
  "openapi": "3.0.1",
  "info": {
    "title": "CarGurus Scraper",
    "description": "Scrape CarGurus car listings (US, CA, UK) with VIN, price, deal rating, mileage, and dealer contact.",
    "version": "1.0",
    "x-build-id": "QXeKDftBBBWQpkZM0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~cargurus-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-cargurus-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/khadinakbar~cargurus-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-cargurus-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/khadinakbar~cargurus-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-cargurus-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",
        "required": [
          "country"
        ],
        "properties": {
          "country": {
            "title": "Country / marketplace",
            "enum": [
              "US",
              "CA",
              "UK"
            ],
            "type": "string",
            "description": "Which CarGurus marketplace to search. Use 'US' for cargurus.com, 'CA' for cargurus.ca, 'UK' for cargurus.co.uk. Defaults to US. This is NOT a proxy region — it picks the website domain and the postal-code format expected below.",
            "default": "US"
          },
          "postalCode": {
            "title": "Postal / ZIP code",
            "type": "string",
            "description": "Center of the location search. Use a US ZIP (e.g. '10001'), a Canadian forward sortation area or postal code (e.g. 'M5V'), or a UK outcode/postcode (e.g. 'SW1A'). Ignored when 'searchUrls' is provided. Defaults to '10001'.",
            "default": "10001"
          },
          "distance": {
            "title": "Search radius",
            "minimum": 10,
            "maximum": 500,
            "type": "integer",
            "description": "Radius around the postal code, in miles (US) or kilometres (CA/UK). Accepts 10 to 500. Larger radius returns more dealers but slower runs. Defaults to 50. Ignored when 'searchUrls' is provided.",
            "default": 50
          },
          "make": {
            "title": "Make (brand) filter",
            "type": "string",
            "description": "Optional brand name to keep, matched case-insensitively against each listing's makeName (e.g. 'Toyota'). Leave empty for all makes. This is a result filter, NOT a free-text site search — spelling must match CarGurus brand names. Pair with 'model' to narrow further."
          },
          "model": {
            "title": "Model filter",
            "type": "string",
            "description": "Optional model name to keep, matched case-insensitively as a substring of each listing's modelName (e.g. 'Camry' or 'F-150'). Leave empty for all models. Works on its own or combined with 'make' for precise results. This is a result filter, not a site search."
          },
          "minPrice": {
            "title": "Minimum price",
            "minimum": 0,
            "type": "integer",
            "description": "Lowest total price to keep, in the marketplace's local currency (USD/CAD/GBP). Listings below this are dropped. Leave empty for no floor. Enforced on the listing's totalPrice (price + dealer fees), not the sticker price alone."
          },
          "maxPrice": {
            "title": "Maximum price",
            "minimum": 0,
            "type": "integer",
            "description": "Highest total price to keep, in local currency. Listings above this are dropped. Leave empty for no ceiling. Enforced on totalPrice. Set with 'minPrice' to define a band (e.g. 15000 to 30000)."
          },
          "minYear": {
            "title": "Minimum model year",
            "minimum": 1950,
            "maximum": 2027,
            "type": "integer",
            "description": "Oldest model year to keep (e.g. 2018). Listings older than this are dropped. Leave empty for no limit. Matched against the listing's carYear. NOT the registration date."
          },
          "maxYear": {
            "title": "Maximum model year",
            "minimum": 1950,
            "maximum": 2027,
            "type": "integer",
            "description": "Newest model year to keep (e.g. 2024). Listings newer than this are dropped. Leave empty for no limit. Matched against carYear. Set with 'minYear' for a year band."
          },
          "maxMileage": {
            "title": "Maximum mileage",
            "minimum": 0,
            "type": "integer",
            "description": "Highest odometer reading to keep, in miles (US) or kilometres (CA/UK). Listings above this are dropped. Leave empty for no limit. Matched against the listing's mileage. Use for filtering low-mileage inventory."
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "deal_score",
              "price_asc",
              "price_desc",
              "mileage_asc",
              "year_desc",
              "distance"
            ],
            "type": "string",
            "description": "Order CarGurus returns listings in before filtering. 'deal_score' (best deals first) is the CarGurus default and most useful. Other options sort by price, mileage, year, or distance. Defaults to 'deal_score'.",
            "default": "deal_score"
          },
          "searchUrls": {
            "title": "CarGurus search URLs (advanced)",
            "type": "array",
            "description": "Optional. Paste one or more CarGurus search/inventory result URLs copied from your browser (e.g. a filtered cargurus.com results page). When set, the actor reuses each URL's exact filters and ignores postalCode/distance above. Use this for filters the structured fields don't cover (trim, body type, specific make/model entity). Each item is a full https URL.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max listings",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of listings to return per run (after filtering), summed across all search inputs. Controls cost: you are charged per listing returned. Accepts 1 to 10000. Defaults to 100.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy used to reach CarGurus. Defaults to Apify datacenter (US), which is required — CarGurus blocks unproxied requests. Leave as default unless you have a specific residential setup.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}