{
  "openapi": "3.0.1",
  "info": {
    "title": "JORADP Scraper (joradp.dz)",
    "description": "Extract Algeria's Journal Officiel: legal texts with nature, number, signature date, ministry, JO issue and page, plus the texts that repeal, amend, implement or approve each one. Search, whole archive or issue calendar, in the Arabic or the French edition.",
    "version": "0.0",
    "x-build-id": "AqxK4Eeb1haUVfsz0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hamza325~joradp-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hamza325-joradp-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~joradp-scraper/runs": {
      "post": {
        "operationId": "runs-sync-hamza325-joradp-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~joradp-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-hamza325-joradp-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",
              "bulk",
              "issues"
            ],
            "type": "string",
            "description": "Search needs at least one filter. Bulk walks every year of the archive. Issues collects the calendar: one row per issue with its publication date and PDF.",
            "default": "search"
          },
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "A phrase from the Journal's keyword index, written normally — words separated by spaces, e.g. `أمانة عامة للحكومة`. The Journal looks the phrase up in its own index, so a combination of words it does not list finds nothing: prefer phrases that read like a subject."
          },
          "sector": {
            "title": "Sector",
            "type": "string",
            "description": "Sector filter (43 Arabic / 45 French values, e.g. `الأمن العمومي`, `AFFAIRES ETRANGERES`). Matched case-insensitively against the list the site publishes at runtime; a partial value is accepted when it is unambiguous."
          },
          "ministry": {
            "title": "Issuing authority",
            "type": "string",
            "description": "Ministry filter (364 Arabic / 365 French values). The site spells them abbreviated, e.g. `وزارة الداخلية` or `M.D/M.F/CH/BUDG.PRO`."
          },
          "nature": {
            "title": "Nature of the text",
            "type": "string",
            "description": "Text nature (28 values in both portals): `قانون`, `مرسوم تنفيذي`, `أمر`, `Loi`, `Décret exécutif`, `Arrêté`…"
          },
          "joNumber": {
            "title": "Issue number",
            "type": "string",
            "description": "Issue number of the Journal Officiel. Needs a date range around it (`joDateFrom`/`joDateTo`), because the same number exists in every year."
          },
          "textNumber": {
            "title": "Text number",
            "type": "string",
            "description": "The text's own number, e.g. `77-74`. Looks up one specific text."
          },
          "joDateFrom": {
            "title": "Published from",
            "type": "string",
            "description": "Issue publication date, `dd/mm/yyyy`. Filters on the date the Journal was published."
          },
          "joDateTo": {
            "title": "Published to",
            "type": "string",
            "description": "Issue publication date, `dd/mm/yyyy`."
          },
          "textDateFrom": {
            "title": "Signed from",
            "type": "string",
            "description": "Signature date of the text itself, `dd/mm/yyyy`. Different from the publication date: a text signed in December can be published the next month."
          },
          "textDateTo": {
            "title": "Signed to",
            "type": "string",
            "description": "Signature date of the text itself, `dd/mm/yyyy`."
          },
          "yearFrom": {
            "title": "First year",
            "minimum": 1962,
            "maximum": 2100,
            "type": "integer",
            "description": "Required in bulk and issues modes; ignored in search mode. The Journal's archive starts in 1962."
          },
          "yearTo": {
            "title": "Last year",
            "minimum": 1962,
            "maximum": 2100,
            "type": "integer",
            "description": "Required in bulk and issues modes; ignored in search mode. Use the same year as First year for a single year."
          },
          "includeRelations": {
            "title": "Include related texts",
            "type": "boolean",
            "description": "Emit the texts that repeal, amend, implement, approve or rectify each match, as extra rows flagged with `depth`, `relation` and `parentTextId`. Turning this off keeps only the texts that matched the query.",
            "default": true
          },
          "includeLinks": {
            "title": "Include PDF links",
            "type": "boolean",
            "description": "Add `pageUrl` (a deep link into the issue PDF, or the single-page PDF before 1994), `issuePdfUrl` and `issueIndexUrl`. No PDF file is downloaded: the run collects links only.",
            "default": true
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 0,
            "maximum": 5000000,
            "type": "integer",
            "description": "Maximum rows for the whole run. 0 = no cap.",
            "default": 0
          },
          "maxPagesPerQuery": {
            "title": "Maximum pages per query",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop each query after this many result pages. 0 = page to the end of the result set.",
            "default": 0
          },
          "pageSize": {
            "title": "Texts per page",
            "minimum": 1,
            "maximum": 99,
            "type": "integer",
            "description": "The site's own default is 20. Larger pages cost far more per request: 99 texts take ~37 s and ~3 MB against ~2 s and ~200 KB at 20.",
            "default": 20
          },
          "maxConcurrency": {
            "title": "Parallel sessions",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Queries run in parallel, each on its own session: the site keys a result set to a session, so one query is always paged by one session.",
            "default": 3
          },
          "requestDelayMs": {
            "title": "Delay between pages (ms)",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Pause between two page requests of the same session.",
            "default": 700
          },
          "maxRequestRetries": {
            "title": "Retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many times a failed request is retried before it is given up on. The site occasionally answers 500 or drops the session token.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. The site does not block datacentre traffic, so a proxy is only needed if a run is throttled."
          },
          "language": {
            "title": "Edition",
            "enum": [
              "ar",
              "fr"
            ],
            "type": "string",
            "description": "Which edition to collect. The two are separate publications with their own text numbering and their own PDFs, so a run covers one of them: run the Actor twice to have both.",
            "default": "ar"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}