{
  "openapi": "3.0.1",
  "info": {
    "title": "CarGurus Scraper",
    "description": "Scrape CarGurus.com and CarGurus.ca car listings by US ZIP, Canadian postal code or search URL. Filter by make, model, price, year, mileage and deal rating. Each row has price, deal rating, days on market, VIN, mileage, dealer, phone and photos. Big searches are split into price bands.",
    "version": "0.0",
    "x-build-id": "XPfc336WqxDTnalEF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/memo23~cargurus-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-memo23-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/memo23~cargurus-scraper/runs": {
      "post": {
        "operationId": "runs-sync-memo23-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/memo23~cargurus-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-memo23-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": {
          "zips": {
            "title": "ZIP or postal codes",
            "type": "array",
            "description": "US ZIP codes or Canadian postal codes to search around, e.g. [\"02116\", \"M5V 3L9\"]. A US ZIP searches cargurus.com, a postal code cargurus.ca. Each code is a separate search; listings found under several are written once. With search URLs below, codes are only used for URLs from the same country that have none.",
            "items": {
              "type": "string"
            }
          },
          "searchUrls": {
            "title": "CarGurus search URLs",
            "type": "array",
            "description": "Optional. Paste search result URLs from cargurus.com or cargurus.ca after setting filters on the site (make, model, price, body style, anything). Each URL keeps its own filters and sort; the filter fields below are then ignored. Single-listing URLs and cargurus.co.uk are not supported.",
            "items": {
              "type": "string"
            }
          },
          "distance": {
            "title": "Search radius (miles)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Radius around each ZIP or postal code in miles. Canadian searches convert it to km (50 miles = 80 km).",
            "default": 50
          },
          "sortType": {
            "title": "Sort order",
            "enum": [
              "BEST_MATCH",
              "BEST_DEAL",
              "PRICE_LOWEST",
              "PRICE_HIGHEST",
              "MILEAGE_LOWEST",
              "MILEAGE_HIGHEST",
              "YEAR_NEWEST",
              "LISTED_NEWEST",
              "LISTED_OLDEST"
            ],
            "type": "string",
            "description": "How CarGurus orders the results.",
            "default": "BEST_MATCH"
          },
          "makes": {
            "title": "Makes",
            "type": "array",
            "description": "Car makes as CarGurus spells them, e.g. [\"Toyota\", \"Ford\"]. Leave empty for all makes.",
            "items": {
              "type": "string"
            }
          },
          "models": {
            "title": "Models",
            "type": "array",
            "description": "Models to narrow the makes to, e.g. [\"Camry\", \"RAV4\"], or with the make, e.g. [\"Ford F-150\"]. A make with none of these models is searched in full. An unknown name stops the run before anything is charged and the log lists the valid ones.",
            "items": {
              "type": "string"
            }
          },
          "minPrice": {
            "title": "Minimum price",
            "minimum": 0,
            "type": "integer",
            "description": "Lowest listing price to include, in USD for US searches and CAD for Canadian ones."
          },
          "maxPrice": {
            "title": "Maximum price",
            "minimum": 0,
            "type": "integer",
            "description": "Highest listing price to include, in USD for US searches and CAD for Canadian ones."
          },
          "minYear": {
            "title": "Oldest model year",
            "minimum": 0,
            "type": "integer",
            "description": "Earliest model year to include, e.g. 2018."
          },
          "maxYear": {
            "title": "Newest model year",
            "minimum": 0,
            "type": "integer",
            "description": "Latest model year to include."
          },
          "minMileage": {
            "title": "Minimum mileage",
            "minimum": 0,
            "type": "integer",
            "description": "Lowest odometer reading to include, in miles for US searches and km for Canadian ones."
          },
          "maxMileage": {
            "title": "Maximum mileage",
            "minimum": 0,
            "type": "integer",
            "description": "Highest odometer reading to include, in miles for US searches and km for Canadian ones."
          },
          "dealRatings": {
            "title": "Deal ratings",
            "type": "array",
            "description": "Only include cars with these CarGurus deal ratings. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "GREAT_PRICE",
                "GOOD_PRICE",
                "FAIR_PRICE",
                "POOR_PRICE",
                "OVERPRICED",
                "NA"
              ],
              "enumTitles": [
                "Great deal",
                "Good deal",
                "Fair deal",
                "High price",
                "Overpriced",
                "No price analysis"
              ]
            }
          },
          "includeSponsored": {
            "title": "Include sponsored listings",
            "type": "boolean",
            "description": "CarGurus puts up to 4 paid (Featured / Priority) listings at the top of the first results page. They ignore the sort order. Turn this on to keep them; each is flagged with isSponsored: true.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum items to scrape",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on the number of listings collected across all searches. A search bigger than CarGurus serves in one go (about 8,700 listings) is split into price bands automatically.",
            "default": 1000
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of API calls in flight at once. The gateway is unauthenticated — keep this modest.",
            "default": 5
          },
          "proxy": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Leave empty to use the built-in residential proxy (recommended; it serves both sites). An Apify Proxy group or your own proxy URLs set here are used instead."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}