{
  "openapi": "3.0.1",
  "info": {
    "title": "Tijelabin Multi-Scraper",
    "description": "Scrape Tijelabin.com, an Algerian classifieds marketplace, with lightweight HTTP requests against the site's own web pages.",
    "version": "0.0",
    "x-build-id": "UZdeucb25PhJgEXFf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hamza325~tijelabin-multi-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hamza325-tijelabin-multi-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/hamza325~tijelabin-multi-scraper/runs": {
      "post": {
        "operationId": "runs-sync-hamza325-tijelabin-multi-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/hamza325~tijelabin-multi-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-hamza325-tijelabin-multi-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": [
          "startMode"
        ],
        "properties": {
          "startMode": {
            "title": "What to scrape",
            "enum": [
              "search",
              "category",
              "directUrls",
              "location",
              "store",
              "similar"
            ],
            "type": "string",
            "description": "How to drive the scraper. **Search by keyword** (`search`), **Browse a category** (`category`) and **Browse a location** (`location`) return listing grids matched by keyword, category or location; **Seller store listings** (`store`) returns everything a specific store has listed; **Similar products** (`similar`) fetches products similar to a given listing; **Specific listing URLs** (`directUrls`) enriches a hand-picked list of listing URLs with the full detail data.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search keyword",
            "type": "string",
            "description": "Used when **What to scrape** (`startMode`) = **Search by keyword** (`search`). Free-text query, exactly as the site's own search box accepts it (matches titles and descriptions)."
          },
          "categoryUrl": {
            "title": "Category page URL",
            "type": "string",
            "description": "Used when **What to scrape** (`startMode`) = **Browse a category** (`category`). The site's taxonomy is flat (39 categories, ids 1–39, no subcategories). Paste the category page URL straight from the browser's address bar (e.g. `https://tijelabin.com/category/15/cars`)."
          },
          "locationUrl": {
            "title": "Location page URL",
            "type": "string",
            "description": "Used when **What to scrape** (`startMode`) = **Browse a location** (`location`). Paste the location page URL straight from the browser's address bar — a wilaya page (`https://tijelabin.com/state/alger`) or a commune page (`https://tijelabin.com/city/alger-centre`). The URL decides which kind of grid is scraped. The site covers the 48 pre-2019 wilayas."
          },
          "sellerUrl": {
            "title": "Store page URL",
            "type": "string",
            "description": "Used when **What to scrape** (`startMode`) = **Seller store listings** (`store`). Paste the store page URL straight from the browser's address bar (e.g. `https://tijelabin.com/store/a693b29e82c2ac`). Every seller on Tijelabin — individual or business — has a store page. The run returns every listing the seller has published, one row per listing."
          },
          "startUrls": {
            "title": "Listing URLs",
            "type": "array",
            "description": "The listing page URLs, pasted straight from the browser's address bar (e.g. `https://tijelabin.com/products/8930/tecno-pova-6`). The single input for the two modes that start from a listing page: **Specific listing URLs** (`directUrls`) scrapes each URL with the full data the site offers (description, category, wilaya/commune, seller block, image gallery, view counter, posted date), and **Similar products** (`similar`) fetches the products from each listing's \"Produits similaires\" section (each row records its source listing in `similarToId`).",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after pushing this many listings. Applies in every mode. 0 = no cap.",
            "default": 200
          },
          "maxPages": {
            "title": "Maximum pages",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many page requests. One page = one request (up to 48 listings per page on grids; seller store grids run smaller). Use 0 for no cap. The scraper stops on its own when a grid runs out — the site's page counter over-counts on search pages because it includes sold items.",
            "default": 20
          },
          "maxRequestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "type": "integer",
            "description": "Rate limit per worker. The site currently applies no bot protection, but stay polite so the Actor stays viable long-term.",
            "default": 40
          },
          "locale": {
            "title": "Language",
            "enum": [
              "ar",
              "fr",
              "en"
            ],
            "type": "string",
            "description": "Request language. Only affects the site's interface labels — listing titles, descriptions and prices are seller-entered and never translated. French (the site's default) is fine for almost every run.",
            "default": "fr"
          },
          "includeSold": {
            "title": "Include sold listings",
            "type": "boolean",
            "description": "If true, sold items are also emitted, tagged with `status: \"sold\"` (search pages append a sold-listings section; sold items stay visible on the site with a VENDU badge). If false (default), sold items are skipped entirely. In **Specific listing URLs** (`directUrls`) this toggle has no effect — pasted URLs are always returned with their real status.",
            "default": false
          },
          "dedupe": {
            "title": "Skip duplicate listings",
            "type": "boolean",
            "description": "Skip listings whose ID has already been pushed in this run. On search pages with **Include sold listings** (`includeSold`) enabled, an item can appear in both the active grid and the sold section — the active copy wins. Duplicates are dropped at the request-queue level too, so re-running the Actor with the same settings is idempotent.",
            "default": true
          },
          "debugIncludeRaw": {
            "title": "Debug: include raw extracted data",
            "type": "boolean",
            "description": "If true, each pushed row includes a `raw` field with the unprocessed data extracted from the page (the raw HTML is never included).",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}