{
  "openapi": "3.0.1",
  "info": {
    "title": "Tesla",
    "description": "Get real-time Tesla inventory & pricing data globally! This Apify Scraper extracts new, used & demo car stock direct from Tesla's API. Filter by country, model (S, 3, X, Y), and condition. Ideal for market analysis, competitive insights, or finding your next Tesla.",
    "version": "1.0",
    "x-build-id": "YVhMzMB7u66Qvhmw7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ralvaromariano~tesla/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ralvaromariano-tesla",
        "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/ralvaromariano~tesla/runs": {
      "post": {
        "operationId": "runs-sync-ralvaromariano-tesla",
        "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/ralvaromariano~tesla/run-sync": {
      "post": {
        "operationId": "run-sync-ralvaromariano-tesla",
        "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": {
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Select the 2-letter country codes for which to scrape Tesla inventory. The actor will iterate through each selected country.",
            "items": {
              "type": "string",
              "enum": [
                "at",
                "be",
                "ca",
                "ch",
                "cz",
                "de",
                "dk",
                "es",
                "fi",
                "fr",
                "gb",
                "hu",
                "ie",
                "is",
                "it",
                "lu",
                "mx",
                "nl",
                "no",
                "pr",
                "pt",
                "ro",
                "se",
                "us"
              ],
              "enumTitles": [
                "Austria",
                "Belgium",
                "Canada",
                "Switzerland",
                "Czechia",
                "Germany",
                "Denmark",
                "Spain",
                "Finland",
                "France",
                "United Kingdom",
                "Hungary",
                "Ireland",
                "Iceland",
                "Italy",
                "Luxembourg",
                "Mexico",
                "Netherlands",
                "Norway",
                "Puerto Rico",
                "Portugal",
                "Romania",
                "Sweden",
                "United States"
              ]
            },
            "default": [
              "us"
            ]
          },
          "models": {
            "title": "Models",
            "type": "array",
            "description": "Select the Tesla model codes to scrape.",
            "items": {
              "type": "string",
              "enum": [
                "s",
                "3",
                "x",
                "y"
              ],
              "enumTitles": [
                "Model S",
                "Model 3",
                "Model X",
                "Model Y"
              ]
            },
            "default": [
              "s",
              "3",
              "x",
              "y"
            ]
          },
          "conditions": {
            "title": "Conditions",
            "type": "array",
            "description": "Select the vehicle conditions to filter by.",
            "items": {
              "type": "string",
              "enum": [
                "new",
                "used",
                "demo"
              ],
              "enumTitles": [
                "New",
                "Used",
                "Demo"
              ]
            },
            "default": [
              "new",
              "used"
            ]
          },
          "limit": {
            "title": "Limit",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of results to retrieve per request. Tesla commonly returns paged results. Set to 0 only if you handle it in code; otherwise use a positive number.",
            "default": 20
          },
          "offset": {
            "title": "Offset",
            "minimum": 0,
            "type": "integer",
            "description": "Number of results to skip from the beginning.",
            "default": 0
          },
          "minDelaySeconds": {
            "title": "Minimum delay between requests",
            "minimum": 0,
            "type": "number",
            "description": "Minimum delay in seconds between requests. Higher values help reduce 429 rate limits.",
            "default": 8
          },
          "maxDelaySeconds": {
            "title": "Maximum delay between requests",
            "minimum": 0,
            "type": "number",
            "description": "Maximum delay in seconds between requests. A random value between min and max is used after each request.",
            "default": 15
          },
          "maxRetries": {
            "title": "Max retries on rate limit",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of retries when Tesla returns HTTP 429.",
            "default": 5
          },
          "extraQuery": {
            "title": "Extra Tesla query fields",
            "type": "object",
            "description": "Optional extra fields merged into Tesla's internal query object. Use this for fields like zip, lat, lng, range, PaymentType, paymentRange, Odometer, or options.",
            "default": {}
          },
          "pageWaitMs": {
            "title": "Browser warm-up time (ms)",
            "minimum": 0,
            "type": "integer",
            "description": "Time to stay on the Tesla inventory page before calling the API from inside the browser context.",
            "default": 5000
          },
          "debugHeaded": {
            "title": "Run headed browser",
            "type": "boolean",
            "description": "Run Chromium with headless disabled for debugging under Xvfb.",
            "default": false
          },
          "saveScreenshots": {
            "title": "Save debug screenshots",
            "type": "boolean",
            "description": "Save screenshots on landing page load and on failures.",
            "default": true
          },
          "proxySettings": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Select Apify Proxy or provide your own proxies. Residential proxies are recommended if Tesla starts returning 403 or 429 frequently."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}