{
  "openapi": "3.0.1",
  "info": {
    "title": "Philippine Supreme Court Decisions Scraper",
    "description": "Full-text search and bulk export of Philippine Supreme Court decisions from the Judiciary's official free E-Library (1996-present). Returns case number, parties, division, ponente, promulgation date, Philippine Reports citation and the complete opinion text. No account needed.",
    "version": "0.0",
    "x-build-id": "JBIhh3v3e2m0zS2YI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fanndev~ph-court-decisions-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fanndev-ph-court-decisions-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/fanndev~ph-court-decisions-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fanndev-ph-court-decisions-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/fanndev~ph-court-decisions-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fanndev-ph-court-decisions-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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "browse",
              "decision"
            ],
            "type": "string",
            "description": "\"search\" runs a full-text query against the Supreme Court E-Library's own dtSearch engine. \"browse\" walks the archive month by month for a year range. \"decision\" fetches the full text of specific document ID(s) directly.",
            "default": "search"
          },
          "searchPhrase": {
            "title": "Search phrase",
            "type": "string",
            "description": "\"search\" mode -- the full-text query, e.g. \"malversation\", \"probable cause\", a party name or a doctrine. Required in this mode."
          },
          "searchCorpus": {
            "title": "Corpus to search",
            "enum": [
              "sc_decision",
              "sc_all",
              "case_index",
              "circular",
              "manual",
              "sc_resolution",
              "administrative_matter",
              "bar_matter"
            ],
            "type": "string",
            "description": "\"search\" mode -- which of the E-Library's dtSearch indexes to query. NOTE: sc_resolution, administrative_matter and bar_matter were unreadable server-side at build time (the portal's own search returns \"$E 0001 Unable to access index\" for them); a run against one returns an explicit search_index_unavailable diagnostic rather than a silent zero.",
            "default": "sc_decision"
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "anywords",
              "allwords",
              "phrase",
              "bool"
            ],
            "type": "string",
            "description": "\"search\" mode -- how dtSearch interprets the phrase: any of the words, all of the words, the exact phrase, or a boolean expression (AND / OR / NOT / w-within).",
            "default": "anywords"
          },
          "fromYear": {
            "title": "From year",
            "minimum": 1996,
            "maximum": 2100,
            "type": "integer",
            "description": "\"browse\" mode -- earliest year to walk. The archive's monthly listing starts at 1996.",
            "default": 2026
          },
          "toYear": {
            "title": "To year",
            "minimum": 1996,
            "maximum": 2100,
            "type": "integer",
            "description": "\"browse\" mode -- latest year to walk. Years are visited newest-first, and each month is paged until it runs out.",
            "default": 2026
          },
          "docIds": {
            "title": "Document IDs",
            "type": "array",
            "description": "\"decision\" mode -- the numeric document ids from the portal's own /thebookshelf/showdocs/1/<id> URLs, e.g. \"70008\". A full URL may be pasted instead of the bare id. These appear as the \"docId\" field of any browse result.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "\"search\" and \"browse\" modes -- maximum number of decisions to return. Pages are followed automatically until this cap or the end of the result set. dtSearch itself stops counting at 5,000 matches per query.",
            "default": 50
          },
          "fetchFullText": {
            "title": "Include full decision text",
            "type": "boolean",
            "description": "\"search\" and \"browse\" modes -- when true, every result is additionally fetched for the complete opinion (division, ponente, document type, Philippine Reports citation and the full text, frequently 20,000-350,000 characters). When false (default), only the summary row is returned, which is far faster and cheaper for large result sets.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrent workers",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many decision pages to fetch in parallel when fetchFullText is on, or how many ids to fetch at once in \"decision\" mode. Kept deliberately low by default -- this is a small government library server.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy configuration. Residential is on by default.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}