{
  "openapi": "3.0.1",
  "info": {
    "title": "CarGurus Scraper - Used Car Listings & Dealer Leads",
    "description": "Scrape CarGurus used-car listings & dealer leads by location or search URL: VIN, price, Instant Market Value & deal rating, mileage, specs, photos, plus dealer name, phone & address. Optional listing details, dealer leads & monitoring. No login or API key.",
    "version": "0.1",
    "x-build-id": "0uRfXe72skfqz8VSw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~cargurus-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-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/scrapesage~cargurus-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-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/scrapesage~cargurus-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-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",
        "properties": {
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "5-digit US ZIP codes to search around. The actor pulls used-car listings within the search distance of each ZIP. One per row. (e.g. 90001, 78704.)",
            "items": {
              "type": "string"
            }
          },
          "searchUrls": {
            "title": "CarGurus search URLs",
            "type": "array",
            "description": "Paste any CarGurus search-results URL (build a search on cargurus.com with your make / model / price / year / mileage filters and copy the URL). The actor scrapes and paginates it. One per row. Use this for make/model and advanced filtering.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs (search or listing detail)",
            "type": "array",
            "description": "CarGurus URLs to scrape directly: search-results URLs (https://www.cargurus.com/Cars/...) or single listing detail URLs (https://www.cargurus.com/details/<id>). Auto-detected and routed. One per row.",
            "items": {
              "type": "string"
            }
          },
          "distance": {
            "title": "Search radius (miles)",
            "minimum": 10,
            "maximum": 500,
            "type": "integer",
            "description": "Radius around each ZIP code to search, in miles.",
            "default": 50
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "best_match",
              "newest_listed",
              "lowest_price",
              "highest_price",
              "lowest_mileage",
              "best_deal"
            ],
            "type": "string",
            "description": "Sort order. Note: CarGurus' location \"shop\" pages mostly use their own relevance order — sort options are honored best on pasted searchUrls.",
            "default": "best_match"
          },
          "maxResults": {
            "title": "Max results (listings)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on car-listing records across the whole run. Searches paginate automatically until this cap or the page limit is reached. (Dealer-lead records do not count against this cap.)",
            "default": 100
          },
          "maxPagesPerSearch": {
            "title": "Max pages per search",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many result pages (24 listings each) to paginate through per ZIP / search URL before moving on.",
            "default": 10
          },
          "includeListingDetails": {
            "title": "Include full listing details",
            "type": "boolean",
            "description": "Open each listing's detail page for the richest record: the seller's description, the full options list, vehicle history (accidents / owners / title), the full photo gallery, safety features and performance specs. One extra request per listing. Turn off for a faster, cheaper run (the listing record is already rich).",
            "default": false
          },
          "includeDealerLeads": {
            "title": "Also output dealer leads",
            "type": "boolean",
            "description": "Output one deduplicated dealer record (type `dealer`) per unique dealership seen — name, phone, full street address, city/state/zip and logo — alongside the car listings.",
            "default": false
          },
          "conditionFilter": {
            "title": "Condition",
            "enum": [
              "any",
              "used",
              "cpo",
              "new"
            ],
            "type": "string",
            "description": "Keep only listings of a given condition. (CarGurus location search returns used inventory; \"new\" relies on the listing flags.)",
            "default": "any"
          },
          "dealRatingFilter": {
            "title": "Deal rating filter",
            "type": "array",
            "description": "Keep only listings with one of these CarGurus deal ratings. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "GREAT_PRICE",
                "GOOD_PRICE",
                "FAIR_PRICE",
                "POOR_PRICE",
                "OVERPRICED"
              ],
              "enumTitles": [
                "Great Price",
                "Good Price",
                "Fair Price",
                "High Price",
                "Overpriced"
              ]
            },
            "default": []
          },
          "makeFilter": {
            "title": "Make filter",
            "type": "array",
            "description": "Keep only listings of these makes (case-insensitive, e.g. Toyota, Ford). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "minYear": {
            "title": "Minimum year",
            "minimum": 0,
            "maximum": 2100,
            "type": "integer",
            "description": "Keep only listings from this model year or newer. 0 = no filter.",
            "default": 0
          },
          "maxYear": {
            "title": "Maximum year",
            "minimum": 0,
            "maximum": 2100,
            "type": "integer",
            "description": "Keep only listings from this model year or older. 0 = no filter.",
            "default": 0
          },
          "maxMileage": {
            "title": "Maximum mileage",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep only listings at or below this mileage. 0 = no filter.",
            "default": 0
          },
          "minPrice": {
            "title": "Minimum price (USD)",
            "minimum": 0,
            "maximum": 100000000,
            "type": "integer",
            "description": "Keep only listings priced at or above this. 0 = no filter.",
            "default": 0
          },
          "maxPrice": {
            "title": "Maximum price (USD)",
            "minimum": 0,
            "maximum": 100000000,
            "type": "integer",
            "description": "Keep only listings priced at or below this. 0 = no filter.",
            "default": 0
          },
          "withDealerPhoneOnly": {
            "title": "Only listings with a dealer phone",
            "type": "boolean",
            "description": "Output only listings that have a dealer phone number (best for lead generation).",
            "default": false
          },
          "excludePrivateSellers": {
            "title": "Exclude private sellers",
            "type": "boolean",
            "description": "Output only dealer listings, skipping private (for-sale-by-owner) sellers.",
            "default": false
          },
          "deduplicateListings": {
            "title": "Deduplicate listings",
            "type": "boolean",
            "description": "Skip a listing already emitted earlier in the same run (CarGurus rotates inventory across pages).",
            "default": true
          },
          "monitorMode": {
            "title": "Monitoring mode — only new & price-changed listings",
            "type": "boolean",
            "description": "Remember listings (and their last price) from previous runs and emit ONLY new listings and price-changed ones (each tagged monitorStatus = new / price_drop / price_increase). Pairs with Apify Schedules to track fresh inventory and price drops over time.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Named key-value store that holds the 'already seen' listing ids + prices for monitoring mode. Use a different name per tracked target/search to keep their histories separate.",
            "default": "cargurus-scraper-monitor"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum parallel requests. Lower it for very large runs if you see transient blocks; raise it for speed.",
            "default": 8
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. CarGurus serves clean pages over US residential IPs but Cloudflare-challenges datacenter IPs, so US Residential is the default and recommended setting. Blocked requests retry automatically on a fresh IP.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "countryCode": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}