{
  "openapi": "3.0.1",
  "info": {
    "title": "Flexicar Scraper",
    "description": "Scrape used cars from Flexicar Spain & Portugal: prices, price drops, cash vs financed price, finance plans, specs, equipment and dealerships. Public API, 25+ filters.",
    "version": "0.1",
    "x-build-id": "qUZCGBX3ICJxtR5a9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rastriq~flexicar-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rastriq-flexicar-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/rastriq~flexicar-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rastriq-flexicar-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/rastriq~flexicar-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rastriq-flexicar-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": {
          "country": {
            "title": "Country",
            "enum": [
              "es",
              "pt"
            ],
            "type": "string",
            "description": "flexicar.es (Spain) or flexicar.pt (Portugal).",
            "default": "es"
          },
          "brands": {
            "title": "Brands",
            "type": "array",
            "description": "Brand slugs, e.g. <code>toyota</code>, <code>kia</code>, <code>mercedes-benz</code>. Several brands are combined with OR.",
            "items": {
              "type": "string"
            }
          },
          "models": {
            "title": "Models",
            "type": "array",
            "description": "Model slugs, e.g. <code>corolla</code>, <code>c-hr</code>, <code>serie-3</code>. Best used together with one brand.",
            "items": {
              "type": "string"
            }
          },
          "fuels": {
            "title": "Fuel types",
            "type": "array",
            "description": "Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "gasolina",
                "diesel",
                "hibrido-no-enchufable",
                "hibrido-enchufable",
                "electrico",
                "glp"
              ],
              "enumTitles": [
                "Petrol",
                "Diesel",
                "Hybrid (HEV / MHEV)",
                "Plug-in hybrid (PHEV)",
                "Electric",
                "LPG"
              ]
            }
          },
          "bodyTypes": {
            "title": "Body types",
            "type": "array",
            "description": "Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "turismo",
                "suv-4x4",
                "compacto",
                "familiar",
                "monovolumen",
                "deportivo",
                "cabrio",
                "furgoneta",
                "pick-up"
              ],
              "enumTitles": [
                "Sedan / hatchback",
                "SUV & 4x4",
                "Compact / small",
                "Estate",
                "MPV",
                "Sports car",
                "Convertible",
                "Van",
                "Pick-up"
              ]
            }
          },
          "ecoStickers": {
            "title": "DGT environmental label",
            "type": "array",
            "description": "Spanish DGT sticker. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "0",
                "E",
                "C",
                "B"
              ],
              "enumTitles": [
                "0 emissions (blue)",
                "ECO",
                "C (green)",
                "B (yellow)"
              ]
            }
          },
          "transmission": {
            "title": "Transmission",
            "enum": [
              "any",
              "automatica",
              "manual"
            ],
            "type": "string",
            "description": "Gearbox.",
            "default": "any"
          },
          "province": {
            "title": "Province",
            "type": "string",
            "description": "Province slug, e.g. <code>madrid</code>, <code>barcelona</code>, <code>valencia</code>, <code>vizcaya</code>, <code>islas-baleares</code>."
          },
          "dealership": {
            "title": "Dealership",
            "type": "string",
            "description": "Single dealership slug (see <code>dealershipSlug</code> in the output), e.g. <code>alicante</code>."
          },
          "minPrice": {
            "title": "Min price (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Lower price bound."
          },
          "maxPrice": {
            "title": "Max price (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Upper price bound."
          },
          "minMonthlyPayment": {
            "title": "Min monthly payment (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Lower instalment bound."
          },
          "maxMonthlyPayment": {
            "title": "Max monthly payment (€)",
            "minimum": 0,
            "type": "integer",
            "description": "Upper instalment bound."
          },
          "minYear": {
            "title": "Year from",
            "minimum": 1980,
            "maximum": 2100,
            "type": "integer",
            "description": "Earliest registration year."
          },
          "maxYear": {
            "title": "Year to",
            "minimum": 1980,
            "maximum": 2100,
            "type": "integer",
            "description": "Latest registration year."
          },
          "minKm": {
            "title": "Min km",
            "minimum": 0,
            "type": "integer",
            "description": "Lower mileage bound."
          },
          "maxKm": {
            "title": "Max km",
            "minimum": 0,
            "type": "integer",
            "description": "Upper mileage bound."
          },
          "minHp": {
            "title": "Min power (hp)",
            "minimum": 0,
            "type": "integer",
            "description": "Lower power bound."
          },
          "maxHp": {
            "title": "Max power (hp)",
            "minimum": 0,
            "type": "integer",
            "description": "Upper power bound."
          },
          "minSeats": {
            "title": "Min seats",
            "minimum": 1,
            "maximum": 9,
            "type": "integer",
            "description": "e.g. 7 for 7-seaters."
          },
          "maxSeats": {
            "title": "Max seats",
            "minimum": 1,
            "maximum": 9,
            "type": "integer",
            "description": "Upper seat bound."
          },
          "offersOnly": {
            "title": "Offers only",
            "type": "boolean",
            "description": "Only cars flagged as offer.",
            "default": false
          },
          "outletOnly": {
            "title": "Outlet only",
            "type": "boolean",
            "description": "Only outlet cars.",
            "default": false
          },
          "taxDeductibleOnly": {
            "title": "VAT-deductible only",
            "type": "boolean",
            "description": "Only cars with deductible VAT (B2B).",
            "default": false
          },
          "premiumOnly": {
            "title": "Premium only",
            "type": "boolean",
            "description": "Only Flexicar's premium / luxury selection.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "price_asc",
              "price_desc",
              "km_asc",
              "newest_registration",
              "newest_listing",
              "power_desc",
              "quota_asc",
              "brand_asc"
            ],
            "type": "string",
            "description": "Result order — combine with Max items, e.g. the 100 cheapest cars.",
            "default": "relevance"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum cars. Empty or 0 = all matching cars."
          },
          "includeDetails": {
            "title": "Include vehicle details",
            "type": "boolean",
            "description": "Adds power (hp), engine size, doors, seats, body type, registration month, consumption and the full equipment & technical sheet (safety, comfort, multimedia, interior, exterior, extras). One small extra request per car.",
            "default": false
          },
          "includeDealerships": {
            "title": "Include dealership details",
            "type": "boolean",
            "description": "Adds dealership city, province, address, postal code, business phone & email, GPS and opening hours. A single extra request per run.",
            "default": false
          },
          "includeFinancing": {
            "title": "Include finance plan",
            "type": "boolean",
            "description": "Down payment, instalment, term, TAN/TAE and total payable.",
            "default": true
          },
          "includeImages": {
            "title": "Include all photo URLs",
            "type": "boolean",
            "description": "Full photo gallery and 360° images. The main photo is always included.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Parallel API requests.",
            "default": 4
          },
          "maxRequestRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Exponential backoff on errors.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed: Flexicar's API is public. Enable only if you get blocked."
          },
          "debug": {
            "title": "Debug logging",
            "type": "boolean",
            "description": "Verbose logs.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}