{
  "openapi": "3.0.1",
  "info": {
    "title": "Haraj Scraper: Saudi Classified Ads and Cars",
    "description": "Search Haraj, the Saudi classifieds site, by keyword, category, city or map area. Each ad comes with title, text, price, city, date, tags, photos and author details. Filter cars by model year, body style, fuel and mileage, or follow a Haraj page link.",
    "version": "1.0",
    "x-build-id": "taUG8LgHRg5ziaZGh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/happyendpoint~haraj-listings-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-happyendpoint-haraj-listings-search-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~haraj-listings-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-happyendpoint-haraj-listings-search-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~haraj-listings-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-happyendpoint-haraj-listings-search-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": [
              "searchListings",
              "browseListings",
              "searchListingsInArea",
              "searchListingsByUrl",
              "listPromotedListings"
            ],
            "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": "Haraj page link",
            "type": "string",
            "description": "Paste the address of a Haraj page that shows a list of ads, for example a category page, a city page, search results or the ads of a single seller. A page for a single ad does not work. Used by: Search by Haraj page link."
          },
          "query": {
            "title": "Keyword",
            "maxLength": 200,
            "type": "string",
            "description": "Words to look for in ad titles and ad text. Arabic and English both work. Used by: Search listings."
          },
          "category": {
            "title": "Category",
            "maxLength": 200,
            "type": "string",
            "description": "The name of one section of the site, written as Haraj shows it, mostly in Arabic. It can be a broad section, a car make or a car model. Search listings also accepts several names with a bar between them. Featured listings needs one. Search a map area narrows to one name. Used by: Search listings, Browse listings, Search a map area, Featured listings."
          },
          "location": {
            "title": "City",
            "maxLength": 300,
            "type": "string",
            "description": "The city, written in Arabic the way listing rows show it. Several cities can be separated by commas, up to ten. Featured listings takes exactly one city. Used by: Search listings, Browse listings, Featured listings."
          },
          "district": {
            "title": "District",
            "maxLength": 100,
            "type": "string",
            "description": "A neighborhood inside the chosen city, in Arabic. It works only together with one city and a property category that does not name a place already. Used by: Browse listings."
          },
          "latitude": {
            "title": "Latitude",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Latitude of the center for a nearby search, as a decimal number. Fill Longitude as well. Ads up to roughly a hundred kilometers away are returned, closest first. Used by: Search listings."
          },
          "longitude": {
            "title": "Longitude",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "Longitude of the center for the nearby search, as a decimal number. Always sent together with Latitude. Used by: Search listings."
          },
          "neLatitude": {
            "title": "North edge",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "The upper edge of the area, as a latitude. It cannot be below South edge. Used by: Search a map area."
          },
          "swLatitude": {
            "title": "South edge",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "The lower edge of the area, as a latitude. Used by: Search a map area."
          },
          "neLongitude": {
            "title": "East edge",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "The right-hand edge of the area, as a longitude. It cannot be below West edge. Used by: Search a map area."
          },
          "swLongitude": {
            "title": "West edge",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "The left-hand edge of the area, as a longitude. Used by: Search a map area."
          },
          "bodyType": {
            "title": "Car body style",
            "enum": [
              "small_sedan",
              "sedan",
              "luxury_sedan",
              "hatchback",
              "coupe",
              "suv",
              "jeep",
              "luxury_jeep",
              "van",
              "small_pickup",
              "large_pickup",
              "classic"
            ],
            "type": "string",
            "description": "Keep only cars whose model belongs to this body style. Used by: Search listings, Browse listings."
          },
          "modelYear": {
            "title": "Car model year",
            "minimum": 1900,
            "maximum": 2100,
            "type": "integer",
            "description": "Cars of one model year. Set Category to a single car model first: a make, a broad section or a name that already holds a year is refused. Used by: Browse listings."
          },
          "minPrice": {
            "title": "Lowest price (SAR)",
            "minimum": 1,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Smallest asking price in Saudi riyals. Cars are matched by the price band of their model year. Used by: Search listings."
          },
          "maxPrice": {
            "title": "Highest price (SAR)",
            "minimum": 1,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Largest asking price in Saudi riyals. Used by: Search listings."
          },
          "hasPhotos": {
            "title": "With photos only",
            "type": "boolean",
            "description": "Keep only ads that have photos. Leave it unset rather than off to see every ad. Used by: Search listings, Browse listings."
          },
          "hasVideo": {
            "title": "With video only",
            "type": "boolean",
            "description": "Show only ads with a video attached. A page may come back short. Leave it unset rather than off. Used by: Search listings, Browse listings."
          },
          "postedWithin": {
            "title": "Posted within",
            "enum": [
              "1_day",
              "3_days",
              "1_week",
              "1_month",
              "2_months"
            ],
            "type": "string",
            "description": "Keep only ads first posted inside this time window. Leave it empty for any age. Used by: Search listings."
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "recently_updated",
              "newest"
            ],
            "type": "string",
            "description": "How the results are ordered. Leave it empty for the ads with the freshest activity first. Used by: Search listings."
          },
          "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}