{
  "openapi": "3.0.1",
  "info": {
    "title": "Motory Scraper: Used Cars in Saudi Arabia",
    "description": "Find used cars listed on Motory in Jordan and Saudi Arabia. Narrow them by city, make, model, model year, price, fuel, dealer or seller type. Each listing gives price, mileage, year, city, seller and photos; one car can be opened in full, and makes, models and filter counts can be listed.",
    "version": "1.0",
    "x-build-id": "gkxezfuIz7m6fizjH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/happyendpoint~motory-used-cars-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-happyendpoint-motory-used-cars-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/happyendpoint~motory-used-cars-scraper/runs": {
      "post": {
        "operationId": "runs-sync-happyendpoint-motory-used-cars-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/happyendpoint~motory-used-cars-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-happyendpoint-motory-used-cars-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",
        "required": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "Operation",
            "enum": [
              "makes",
              "models",
              "resolveUrl",
              "usedCarDetails",
              "usedCarDetailsByUrl",
              "usedCarFilters",
              "usedCars",
              "usedCarsByUrl"
            ],
            "type": "string",
            "description": "Which data to fetch. Each option is one kind of request."
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "The most results to return. The run stops once it has this many.",
            "default": 100
          },
          "url": {
            "title": "Motory page link",
            "type": "string",
            "description": "The address of a page on the Saudi Motory site, copied from your browser: the page of one car ad, a results page or any other page. Used by: Identify a Motory page link, Used car details by link, Search used cars by link."
          },
          "listingId": {
            "title": "Listing ID",
            "minimum": 1,
            "type": "integer",
            "description": "The number of one car ad, as search rows return it in id. Take it from the same market. Used by: Used car details."
          },
          "carList": {
            "title": "Which cars",
            "enum": [
              "used",
              "new"
            ],
            "type": "string",
            "description": "Pick the cars on sale now or the new-car catalogue. They share many entries, yet each has some that the other lacks. Used by: Car makes, Car models of a make."
          },
          "makeId": {
            "title": "Make ID",
            "minimum": 1,
            "type": "integer",
            "description": "The number of one car make, as Car makes returns it in id. Use the same market and the same list. Used by: Car models of a make."
          },
          "query": {
            "title": "Keyword",
            "maxLength": 100,
            "type": "string",
            "description": "Words to look for in used-car listings, such as a make or a model name. Match the language you pick below. Used by: Search used cars."
          },
          "market": {
            "title": "Country site",
            "enum": [
              "sa",
              "jo"
            ],
            "type": "string",
            "description": "Which Motory country site to read. Cars and numbers differ between them, so stay with one site for a whole task. Leave it empty for Saudi Arabia. Used by: Car makes, Car models of a make, Used car details, Filter choices for used cars, Search used cars."
          },
          "language": {
            "title": "Language",
            "enum": [
              "en",
              "ar"
            ],
            "type": "string",
            "description": "The language of labels and texts in the rows. Numbers and IDs do not change. Leave it empty for English. Used by: Car makes, Car models of a make, Used car details, Used car details by link, Filter choices for used cars, Search used cars, Search used cars by link."
          },
          "makeIds": {
            "title": "Make IDs",
            "pattern": "^[0-9]{1,10}(,[0-9]{1,10}){0,49}$",
            "type": "string",
            "description": "Make numbers from Car makes, with a comma between them. Cars of any listed make stay. Used by: Filter choices for used cars, Search used cars."
          },
          "modelIds": {
            "title": "Model IDs",
            "pattern": "^[0-9]{1,10}(,[0-9]{1,10}){0,49}$",
            "type": "string",
            "description": "Model numbers from Car models of a make, with a comma between them. A match on any one is enough. Used by: Filter choices for used cars, Search used cars."
          },
          "cityIds": {
            "title": "City IDs",
            "pattern": "^[0-9]{1,10}(,[0-9]{1,10}){0,49}$",
            "type": "string",
            "description": "City numbers from Filter choices for used cars, with a comma between them. Used by: Filter choices for used cars, Search used cars."
          },
          "minYear": {
            "title": "Earliest model year",
            "minimum": 1900,
            "maximum": 2100,
            "type": "integer",
            "description": "Oldest model year to keep. Use the same value as the latest year to pick one year. Used by: Filter choices for used cars, Search used cars."
          },
          "maxYear": {
            "title": "Latest model year",
            "minimum": 1900,
            "maximum": 2100,
            "type": "integer",
            "description": "Newest model year to keep. Used by: Filter choices for used cars, Search used cars."
          },
          "minPrice": {
            "title": "Lowest price",
            "minimum": 0,
            "maximum": 100000000,
            "type": "integer",
            "description": "Lowest asking price, written as a plain number in the currency of the chosen country. Cars that hide their price are left out. Used by: Filter choices for used cars, Search used cars."
          },
          "maxPrice": {
            "title": "Highest price",
            "minimum": 1,
            "maximum": 100000000,
            "type": "integer",
            "description": "Highest asking price, written as a plain number in the currency of the chosen country. Used by: Filter choices for used cars, Search used cars."
          },
          "sellerType": {
            "title": "Seller type",
            "enum": [
              "dealer",
              "individual"
            ],
            "type": "string",
            "description": "Show only dealerships or only private sellers. Leave it empty for both. Used by: Filter choices for used cars, Search used cars."
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "featured",
              "newest",
              "oldest",
              "mileage_asc",
              "mileage_desc",
              "price_asc",
              "price_desc"
            ],
            "type": "string",
            "description": "How to order the cars. Leave it empty for promoted cars first. Used by: Search used cars, Search used cars by link."
          },
          "advancedFilters": {
            "title": "Advanced filters",
            "type": "object",
            "description": "More filters as one JSON object. The README lists every accepted key; any other key is refused."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}