{
  "openapi": "3.0.1",
  "info": {
    "title": "El Mouchir Scraper (elmouchir.dz)",
    "description": "Scrape elmouchir.dz, the Algerian Chamber of Commerce company directory: 79,000+ firms with address, wilaya, sector, phone and e-mail. Search by keyword, browse a sector or a wilaya, open a company page or resolve a name.",
    "version": "0.0",
    "x-build-id": "Oi695BZmybkZb5CQh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hamza325~elmouchir-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hamza325-elmouchir-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~elmouchir-scraper/runs": {
      "post": {
        "operationId": "runs-sync-hamza325-elmouchir-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~elmouchir-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-hamza325-elmouchir-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",
        "properties": {
          "searchQuery": {
            "title": "Search keyword",
            "type": "string",
            "description": "The keyword the companies should match. The keyword can be combined with a sector and a wilaya. Leave it empty to list the whole directory."
          },
          "categoryUrl": {
            "title": "Sector or activity URL",
            "type": "string",
            "description": "The page of the sector to list, e.g. https://elmouchir.dz/secteur/5563/transport-tourisme-transit-hotellerie. Copy it from the address bar of the sector page on the site. Run the Actor in the sector-catalog mode first if you do not know which sector you want. Activity pages (/activite/<id>) are not supported: the directory answers 0 companies for every activity id, so the run stops and names the sector to browse instead."
          },
          "wilaya": {
            "title": "Wilaya",
            "type": "string",
            "description": "A wilaya, by name (\"Oran\") or by id (\"31\"). It narrows the result to the companies the directory files under that wilaya. The id is the number in the wilaya's own address, e.g. https://elmouchir.dz/wilaya/31/oran."
          },
          "startUrls": {
            "title": "Company URLs",
            "type": "array",
            "description": "The pages of specific companies to scrape, e.g. https://elmouchir.dz/entreprise/94249/tadjra-voyage. One row per company, with its full record.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "pageUrl": {
            "title": "Page URL (shortcut)",
            "type": "string",
            "description": "A shortcut: paste a page of the site and the Actor works out what to do from it. Accepted are a sector or activity page, a company page, a wilaya page and the sector catalog. A search has no address of its own — use the **Search keyword** field for that."
          },
          "startMode": {
            "title": "What to scrape",
            "enum": [
              "auto",
              "search",
              "category",
              "wilaya",
              "detail",
              "categories",
              "suggest"
            ],
            "type": "string",
            "description": "What the run is about. Leave it on **auto** unless a field does not say it clearly enough. **auto** uses the most specific of the fields you filled in. **search** lists the companies of a keyword, **category** those of a sector, **wilaya** those of a wilaya, **detail** the companies whose URLs you gave, **categories** the tree of sectors and activities, **suggest** looks a name up in the directory's own search.",
            "default": "auto"
          },
          "suggestScope": {
            "title": "Lookup scope",
            "enum": [
              "company",
              "wilaya"
            ],
            "type": "string",
            "description": "Only for the **suggest** mode: look a company name up, or a wilaya name.",
            "default": "company"
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Max rows to put in the dataset. 0 means no cap. This is the main cost lever: every row costs a contact lookup, so keep it in the hundreds on the platform. It also caps the work: once the cap is reached no further listing page is fetched and, with **Open each company's page** on, no further company page is opened.",
            "default": 200
          },
          "includeContacts": {
            "title": "Resolve phone and e-mail",
            "type": "boolean",
            "description": "Read the phone numbers and e-mail addresses of the companies. Leave it on unless you only want the names and addresses — this is where most of the run's time goes.",
            "default": true
          },
          "includeDetails": {
            "title": "Open each company's page",
            "type": "boolean",
            "description": "Also open every company's own page, which gives its precise wilaya and its complete contact list. One extra request per company, so it roughly doubles the run's time.",
            "default": false
          },
          "pageSize": {
            "title": "Companies per listing page",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "How many companies the Actor asks for per listing page. The directory only honours 5, 10, 20, 50 or 100; any other value returns 10 companies per page. 100 is recommended: with the guest limit of three pages per filter, it yields up to 300 companies per run. You can try another value, but expect 10 per page.",
            "default": 100
          },
          "maxPages": {
            "title": "Maximum listing pages",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Max listing pages per filter. The site lets an anonymous visitor read three, so anything above that is capped.",
            "default": 3
          },
          "maxCatalogPages": {
            "title": "Maximum catalog pages",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Max pages of the sector catalog to walk in the **categories** mode.",
            "default": 25
          },
          "maxSessions": {
            "title": "Parallel connections",
            "minimum": 1,
            "maximum": 64,
            "type": "integer",
            "description": "How many listings the Actor works on at the same time. The site throttles every connection on its own, so a higher number means a faster run — and more load on the site.",
            "default": 10
          },
          "sessionStartDelaySecs": {
            "title": "Stagger between connections (seconds)",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Seconds between the first requests of two consecutive connections. It keeps the run from hitting the site all at once.",
            "default": 2
          },
          "maxAttempts": {
            "title": "Retries per request",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How often a request is retried before it is given up on. A request the site put on hold is retried after the wait the site asked for.",
            "default": 7
          },
          "dedupe": {
            "title": "Skip repeated companies",
            "type": "boolean",
            "description": "Put a company in the dataset only once, even when it shows up on several pages.",
            "default": true
          },
          "debugIncludeRaw": {
            "title": "Debug: include the raw page data",
            "type": "boolean",
            "description": "Attach the unprocessed page data to every row. Useful while checking a run, noisy afterwards.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}