{
  "openapi": "3.0.1",
  "info": {
    "title": "Gulf Used Car Scraper - Multi-Platform MENA Automotive Data",
    "description": "Scrapes used car listings from DubiCars, YallaMotor, and Dubizzle Motors across UAE, Saudi Arabia, and 5+ Gulf countries. Extracts prices, specs, mileage, seller info, and photos into normalized structured data with change detection.",
    "version": "1.0",
    "x-build-id": "sXlWJQFBFmhYjkval"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/constructive_calm~gulf-used-car-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-constructive_calm-gulf-used-car-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/constructive_calm~gulf-used-car-scraper/runs": {
      "post": {
        "operationId": "runs-sync-constructive_calm-gulf-used-car-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/constructive_calm~gulf-used-car-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-constructive_calm-gulf-used-car-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": {
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Which UAE car platforms to scrape. DubiCars has the broadest dealer inventory and is fastest; Dubizzle Motors has the highest listing volume and richer specs (trim, engine, listing date). 'All Platforms' scrapes both.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "dubicars",
                "dubizzle"
              ],
              "enumTitles": [
                "All Platforms",
                "DubiCars (UAE)",
                "Dubizzle Motors (UAE)"
              ]
            },
            "default": [
              "all"
            ]
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "City filter (e.g., 'dubai', 'riyadh', 'jeddah', 'abu-dhabi'). Only applied to Dubizzle Motors URLs. Leave empty to include all cities in the selected country."
          },
          "make": {
            "title": "Car Make",
            "type": "string",
            "description": "Filter by car make (e.g., 'toyota', 'nissan', 'mercedes', 'bmw'). LEAVE EMPTY to scrape ALL makes across the market — useful for trend analysis or cross-brand price benchmarking."
          },
          "model": {
            "title": "Car Model",
            "type": "string",
            "description": "Filter by car model (e.g., 'camry', 'patrol', 'c-class'). Requires 'make' to be set — filtering by model alone is not supported (you must specify the brand first)."
          },
          "yearFrom": {
            "title": "Year From",
            "minimum": 1990,
            "maximum": 2027,
            "type": "integer",
            "description": "Minimum model year (e.g., 2020). Leave empty for no lower bound."
          },
          "yearTo": {
            "title": "Year To",
            "minimum": 1990,
            "maximum": 2027,
            "type": "integer",
            "description": "Maximum model year (e.g., 2026). Leave empty for no upper bound."
          },
          "priceFrom": {
            "title": "Price From",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum price in AED. Both platforms are UAE-based so there's no currency conversion."
          },
          "priceTo": {
            "title": "Price To",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum price in AED. Leave empty for no upper bound."
          },
          "maxMileage": {
            "title": "Max Mileage (km)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum odometer reading in kilometers. 0 is treated as 'no filter' — brand-new cars (0 km) are always included unless you also set 'Include New Cars' to false."
          },
          "sellerType": {
            "title": "Seller Type",
            "enum": [
              "all",
              "dealer",
              "individual"
            ],
            "type": "string",
            "description": "Filter by seller type. Both platforms expose dealer vs. individual seller info.",
            "default": "all"
          },
          "maxListingsPerPlatform": {
            "title": "Max Listings Per Platform",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap per platform (so 'all' with 100 = up to 200 total). Each extracted listing is charged $0.005. Start small (5-10) to preview data before running large scrapes.",
            "default": 100
          },
          "includeNew": {
            "title": "Include New Cars",
            "type": "boolean",
            "description": "Also return brand-new dealer listings (0 km) alongside used cars. Default false returns used-only.",
            "default": false
          },
          "useBrowser": {
            "title": "Browser Mode",
            "enum": [
              "auto",
              "always",
              "never"
            ],
            "type": "string",
            "description": "When to use Playwright browser rendering. 'Auto' is recommended — uses Cheerio first (fast, cheap) and falls back to browser only when needed. 'Always' forces browser mode (slower but more resilient). 'Never' disables browser (DubiCars still works; Dubizzle returns 0 since its WAF requires a browser).",
            "default": "auto"
          },
          "useAI": {
            "title": "Use AI Extraction (Gemini Vision)",
            "type": "boolean",
            "description": "When Dubizzle's anti-bot protection blocks structured extraction, take a screenshot of the listing page and have Gemini 2.5 Flash extract the data. Charged at $0.05 per recovered listing. Only fires when structured extraction fails.",
            "default": true
          },
          "detectChanges": {
            "title": "Detect Changes Across Runs",
            "type": "boolean",
            "description": "Compare this run's results with the previous run (stored in a named dataset) to detect price changes, new listings, removed listings, and cross-platform relistings. Requires 'Dataset Name' to be set. Each detected change charges $0.01.",
            "default": true
          },
          "datasetName": {
            "title": "Dataset Name",
            "type": "string",
            "description": "Named dataset for tracking changes across runs. Use the same name on recurring runs to enable price-drop / new-listing / removed-listing detection. Example: 'saudi-toyotas-weekly'."
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional URL to POST a JSON summary when the run finishes. Includes price drops, new listings, and cross-platform matches. Useful for Slack/Discord alerts or downstream automation."
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings. RESIDENTIAL proxies are strongly recommended — Dubizzle blocks datacenter IPs. DubiCars works without any proxy. Default: Apify Proxy auto-selection."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}