{
  "openapi": "3.0.1",
  "info": {
    "title": "🚘 cardirect car data scraper US 🇺🇸",
    "description": "one of the largest used-car marketplaces in the US. Give it one or more listing search pages and it collects every vehicle shown across as many pages as you like, then visits each vehicle's own page to pull price, mileage, VIN, trim, specs, and dealer information.",
    "version": "1.0",
    "x-build-id": "Pz7iGeF6dtQ7Y7ogg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mrdoe~cardirect-car-data-scraper-us/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mrdoe-cardirect-car-data-scraper-us",
        "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/mrdoe~cardirect-car-data-scraper-us/runs": {
      "post": {
        "operationId": "runs-sync-mrdoe-cardirect-car-data-scraper-us",
        "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/mrdoe~cardirect-car-data-scraper-us/run-sync": {
      "post": {
        "operationId": "run-sync-mrdoe-cardirect-car-data-scraper-us",
        "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": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "Listing start URLs",
            "type": "array",
            "description": "One or more carsdirect.com used-car listing pages to scrape, e.g. https://www.carsdirect.com/used_cars/listings?pageNum=1. Each URL is paginated (via its pageNum parameter) up to Max pages per listing, and every vehicle found is then visited on its own detail page.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "detailUrls": {
            "title": "Detail URLs to (re-)scrape directly",
            "type": "array",
            "description": "Optional. A list of specific vehicle detail-page URLs to scrape directly, skipping the listing/pagination phase entirely. Use this to re-run just the items that came back with status \"blocked\" or \"error\" in a previous run's dataset, instead of redoing the whole listing scrape. Leave empty for a normal listing run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxPagesPerListing": {
            "title": "Max pages per listing",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of listing pages to paginate through per start URL. Pagination stops earlier automatically once a page comes back with no vehicles (end of results).",
            "default": 20
          },
          "maxItemsPerListing": {
            "title": "Max items per listing",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of vehicles to collect per start URL. 0 means no limit (only Max pages per listing bounds the run).",
            "default": 0
          },
          "sessionBatchSize": {
            "title": "Session batch size",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "How many page visits (listing pages + detail pages combined) to make in one browser session before proactively closing it and starting a fresh browser with a new fingerprint and a new proxy IP. Session trust decays under volume, so keep this modest.",
            "default": 7
          },
          "minDelaySecs": {
            "title": "Minimum delay between page visits (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Lower bound of the randomized delay taken before every navigation, so pacing doesn't look like a script hammering at a constant interval.",
            "default": 2
          },
          "maxDelaySecs": {
            "title": "Maximum delay between page visits (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Upper bound of the randomized delay taken before every navigation.",
            "default": 5
          },
          "requestTimeoutSecs": {
            "title": "Page timeout (seconds)",
            "minimum": 10,
            "type": "integer",
            "description": "How long to wait for a single page navigation before giving up and retrying.",
            "default": 60
          },
          "maxRequestRetries": {
            "title": "Max retries per page",
            "minimum": 0,
            "type": "integer",
            "description": "How many times to retry a single page visit after a network error or navigation timeout (not counting the one automatic relaunch-and-retry that happens specifically when a block is detected).",
            "default": 2
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of start URLs processed in parallel, each with its own browser session.",
            "default": 3
          },
          "minConcurrency": {
            "title": "Min concurrency",
            "minimum": 1,
            "type": "integer",
            "description": "Lower bound on parallel workers, kept for parity with other scrapers in this project. With a small number of start URLs this run may use fewer workers than Max concurrency regardless.",
            "default": 1
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "carsdirect.com sits behind a Cloudflare bot-challenge. Residential proxies are strongly recommended - datacenter IP ranges are far more likely to be denied outright regardless of browser fingerprint.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}