{
  "openapi": "3.0.1",
  "info": {
    "title": "Haraj Scraper - Saudi Classifieds Listings (حراج)",
    "description": "Listings from Haraj.com.sa by keyword, category, city, seller or link: title, price in SAR, city, tags, dates, images, description, comments, seller username, car make, model, year and mileage. New-listing alerts. No login.",
    "version": "0.1",
    "x-build-id": "I7Kw8e5juD0iTTihj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dottti~haraj-listings/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dottti-haraj-listings",
        "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/dottti~haraj-listings/runs": {
      "post": {
        "operationId": "runs-sync-dottti-haraj-listings",
        "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/dottti~haraj-listings/run-sync": {
      "post": {
        "operationId": "run-sync-dottti-haraj-listings",
        "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": {
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Optional. Words to search for, in Arabic or English, as you would type them on Haraj: كامري, ايفون 15, شقة للايجار, land cruiser. Works together with category, city and seller. Empty input runs a demo: the 20 newest car listings in Riyadh."
          },
          "category": {
            "title": "Category",
            "enum": [
              "all",
              "cars",
              "real_estate",
              "devices",
              "furniture",
              "services",
              "fashion",
              "animals",
              "jobs",
              "games",
              "education",
              "food",
              "events",
              "coding_design",
              "gardens",
              "rarities",
              "projects",
              "arts",
              "hunting_trips",
              "travel",
              "lost_found",
              "other"
            ],
            "type": "string",
            "description": "Optional. Haraj main section."
          },
          "tag": {
            "title": "Tag (sub-category)",
            "type": "string",
            "description": "Optional. A Haraj tag as the site spells it, for a narrower section: تويوتا, كامري, شقق للايجار, جوالات. Overrides Category."
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "Optional. City or region in English or Arabic: Riyadh, Jeddah, Makkah, Madinah, Dammam, Khobar, Eastern Province, Qassim, Abha, Tabuk, الرياض, جده, الشرقيه."
          },
          "sellerUsername": {
            "title": "Seller username",
            "type": "string",
            "description": "Optional. Only listings of this seller, by the public username shown on Haraj (the part after haraj.com.sa/users/)."
          },
          "startUrls": {
            "title": "Haraj links",
            "type": "array",
            "description": "Optional. One per line: listing links (haraj.com.sa/11191990880/...), tag links (haraj.com.sa/tags/حراج السيارات), city links (haraj.com.sa/city/الرياض), search links (haraj.com.sa/search/كامري) or seller links (haraj.com.sa/users/name). Each link runs as its own search, next to the filters above.",
            "items": {
              "type": "string"
            }
          },
          "postedWithinDays": {
            "title": "Posted within (days)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Optional. Only listings posted in the last N days. 0 means any date.",
            "default": 0
          },
          "onlyWithImages": {
            "title": "Only listings with images",
            "type": "boolean",
            "description": "Skip listings that have no photos.",
            "default": false
          },
          "maxResults": {
            "title": "Max listings",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Most listings to deliver in this run, across all searches. Newest first. Haraj shows up to about 3,000 listings per search; split by city or tag for more.",
            "default": 100
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "One extra request per listing that has comments, to add the comment text and dates. Commenter names are left out, and phone numbers are removed. Charged as a separate event only for listings that have comments.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new listings (alert mode)",
            "type": "boolean",
            "description": "Remembers the listings each search returned last time and delivers only new ones on the next run. Schedule the actor for alerts. The first run delivers everything and saves the baseline. You pay only for new listings.",
            "default": false
          },
          "stateName": {
            "title": "Alert list name",
            "type": "string",
            "description": "Name for the saved only-new list, so several schedules (for example 'camry-riyadh' and 'villas-jeddah') keep separate memories.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Leave empty: the actor starts without a proxy and moves to Apify datacenter, then residential proxy only if Haraj limits it. Set your own proxy here to use only that."
          },
          "autoProxyFallback": {
            "title": "Automatic proxy fallback",
            "type": "boolean",
            "description": "Move to Apify Proxy when Haraj limits the direct connection.",
            "default": true
          },
          "allowResidentialFallback": {
            "title": "Allow residential proxy",
            "type": "boolean",
            "description": "Let the fallback use residential proxy as the last step. Residential traffic is included in the price.",
            "default": true
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Retries for each request on rate limits, server errors or network errors, with growing waits.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}