{
  "openapi": "3.0.1",
  "info": {
    "title": "4Sale Kuwait Listings Scraper: Ads and Categories",
    "description": "Search 4Sale, the Kuwait classifieds site, by keyword, category, district, price and attributes, or from a category page link. Get ads in English and Arabic with price, district, photos, category and seller contact numbers, plus promoted and popular ads, the category tree, filters and districts.",
    "version": "1.0",
    "x-build-id": "1OzuWekB3TFgvu3E8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/happyendpoint~4sale-kuwait-listings-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-happyendpoint-4sale-kuwait-listings-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~4sale-kuwait-listings-scraper/runs": {
      "post": {
        "operationId": "runs-sync-happyendpoint-4sale-kuwait-listings-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~4sale-kuwait-listings-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-happyendpoint-4sale-kuwait-listings-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",
              "listCategoryListings",
              "searchCategoryListings",
              "listLatestListings",
              "listListingsByUrl",
              "listPromotedListings",
              "listPopularListings",
              "listCategories",
              "getCategoryDetails",
              "getCategoryFilters",
              "listDistricts",
              "getSearchSuggestions",
              "listTrendingSearches"
            ],
            "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
          },
          "query": {
            "title": "Keyword",
            "maxLength": 100,
            "type": "string",
            "description": "Search words, in Arabic or English. Search suggestions take the start of a phrase; Category tree and Districts match part of a name. Used by: Search all categories, Search inside a category, Latest listings, Category tree, Districts, Search suggestions."
          },
          "category": {
            "title": "Category ID",
            "minimum": 1,
            "maximum": 999999999,
            "type": "integer",
            "description": "The number of one category, as Category tree returns it in category_id. Used by: Browse a category, Search inside a category, Promoted listings, Category details, Category filters."
          },
          "url": {
            "title": "4Sale category page link",
            "type": "string",
            "description": "Link to any 4Sale category page, as shown in your browser address bar. Filters in the link are kept. Used by: Browse from a category link."
          },
          "categoryIds": {
            "title": "Extra category IDs",
            "pattern": "^[0-9]{1,9}(,[0-9]{1,9}){0,19}$",
            "type": "string",
            "description": "Extra category numbers, separated by commas (20 at most). Ads in any of them are added to the main category ads. Used by: Browse a category, Browse from a category link."
          },
          "parentCategoryId": {
            "title": "Parent category ID",
            "minimum": 1,
            "maximum": 999999999,
            "type": "integer",
            "description": "Shows the next level down under this category number. Leave it empty to see the main sections. Used by: Category tree."
          },
          "districtIds": {
            "title": "District IDs",
            "pattern": "^[0-9]{1,9}(,[0-9]{1,9}){0,29}$",
            "type": "string",
            "description": "District numbers from Districts, separated by commas (30 at most). An ad in any of them is kept. Used by: Browse a category, Search inside a category, Browse from a category link, Promoted listings."
          },
          "parentDistrictId": {
            "title": "Parent district ID",
            "minimum": 1,
            "maximum": 999999999,
            "type": "integer",
            "description": "Shows the areas or blocks one level under this district number. Leave it empty to see the governorates. Used by: Districts."
          },
          "serviceAreaId": {
            "title": "Service area ID",
            "minimum": 1,
            "maximum": 999999999,
            "type": "integer",
            "description": "A governorate number from Districts. Use it only with a service category, and not together with District IDs; otherwise the run stops with an input error. Used by: Browse a category, Promoted listings."
          },
          "latitude": {
            "title": "Latitude",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Degrees north or south of the equator for the centre of a nearby-ads search. Fill it together with Longitude. Used by: Search all categories."
          },
          "longitude": {
            "title": "Longitude",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "Degrees east or west of the prime meridian for the same centre point. Fill it together with Latitude. Used by: Search all categories."
          },
          "minPrice": {
            "title": "Lowest price (KWD)",
            "minimum": 0,
            "maximum": 999999999,
            "type": "number",
            "description": "Skip ads priced below this amount, in Kuwaiti dinars. Used by: Search all categories, Browse a category, Search inside a category, Browse from a category link."
          },
          "maxPrice": {
            "title": "Highest price (KWD)",
            "minimum": 0,
            "maximum": 999999999,
            "type": "number",
            "description": "Skip ads priced above this amount, in Kuwaiti dinars. Used by: Search all categories, Browse a category, Search inside a category, Browse from a category link."
          },
          "attributes": {
            "title": "Attribute filters",
            "pattern": "^[0-9]+:[0-9.|-]+(,[0-9]+:[0-9.|-]+){0,11}$",
            "maxLength": 400,
            "type": "string",
            "description": "Limit ads by features such as year or size. Each rule is an attribute number, a colon and a wanted option, number or range; join up to 12 rules with commas and an ad must meet all of them. Category filters lists the attribute numbers. Used by: Search all categories, Browse a category, Search inside a category, Browse from a category link."
          },
          "hasPhotos": {
            "title": "Only ads with photos",
            "type": "boolean",
            "description": "Return just the ads that come with photos. Used by: Search all categories."
          },
          "hasVideo": {
            "title": "Only ads with video",
            "type": "boolean",
            "description": "Return just the ads that come with a video clip. Used by: Search all categories."
          },
          "filterableOnly": {
            "title": "Only attributes shown as filters",
            "type": "boolean",
            "description": "Skip attributes the site does not let shoppers filter by. Used by: Category filters."
          },
          "language": {
            "title": "Suggestion language",
            "enum": [
              "en",
              "ar"
            ],
            "type": "string",
            "description": "Pick Arabic to get the suggestion text in Arabic; English is used otherwise. Used by: Search suggestions."
          },
          "sort": {
            "title": "Sort ads",
            "enum": [
              "newest",
              "oldest",
              "price_low",
              "price_high"
            ],
            "type": "string",
            "description": "Pick an order when you plan to read many pages, so that the pages do not overlap. Used by: Search all categories, Browse a category, Browse from a category link."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}