{
  "openapi": "3.0.1",
  "info": {
    "title": "Mexico Case Law Search (SCJN: Theses, Precedents, Rulings)",
    "description": "Search Mexican case law in the SCJN's official Buscador Jurídico: SJF theses (jurisprudencia and tesis aisladas), precedents and Supreme Court rulings, by text, registry number and court.",
    "version": "0.1",
    "x-build-id": "LNRNZJeLzK8aHu01x"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/legaltech~sjf-scjn/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-legaltech-sjf-scjn",
        "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/legaltech~sjf-scjn/runs": {
      "post": {
        "operationId": "runs-sync-legaltech-sjf-scjn",
        "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/legaltech~sjf-scjn/run-sync": {
      "post": {
        "operationId": "run-sync-legaltech-sjf-scjn",
        "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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "One search per item, full text, in Spanish. Words (the source ranks by relevance) and \"exact phrase\" in quotes.",
            "items": {
              "type": "string"
            }
          },
          "registryNumbers": {
            "title": "Registry numbers (registro digital)",
            "type": "array",
            "description": "Retrieve a thesis or precedent by its registro digital (e.g. \"2013834\"), or a SCJN ruling by its id (field `registryNumber` of a previous result). Returns the full text.",
            "items": {
              "type": "string"
            }
          },
          "documentTypes": {
            "title": "Document types",
            "type": "array",
            "description": "Which collections to search. Codes are opaque: do NOT guess them; choose by reading the title (enumTitle) of each option.",
            "items": {
              "type": "string",
              "enum": [
                "tesis",
                "ejecutorias",
                "sentencias_pub"
              ],
              "enumTitles": [
                "Theses (SJF: jurisprudencia and tesis aisladas)",
                "Precedents (SJF ejecutorias)",
                "SCJN rulings (sentencias)"
              ]
            },
            "default": [
              "tesis"
            ]
          },
          "court": {
            "title": "Court (órgano)",
            "type": "string",
            "description": "Issuing body, matched by \"contains\": e.g. \"Primera Sala\", \"Pleno\", \"Segunda Sala\" or \"tribunal colegiado en materia civil del primer circuito\". For rulings: PLENO, PRIMERA SALA, SEGUNDA SALA."
          },
          "instance": {
            "title": "Instance (theses and precedents)",
            "enum": [
              "",
              "Suprema Corte de Justicia de la Nación",
              "Plenos Regionales",
              "Plenos de Circuito",
              "Tribunales Colegiados de Circuito"
            ],
            "type": "string",
            "description": "Issuing instance of theses and precedents. Pick by option title.",
            "default": ""
          },
          "thesisType": {
            "title": "Thesis type (theses only)",
            "enum": [
              "",
              "Tesis de Jurisprudencia",
              "Tesis Aislada"
            ],
            "type": "string",
            "description": "Jurisprudencia (binding) or tesis aislada. Applies to theses only.",
            "default": ""
          },
          "subject": {
            "title": "Subject (theses only)",
            "enum": [
              "",
              "Constitucional",
              "Común",
              "Civil",
              "Penal",
              "Administrativa",
              "Laboral",
              "Electoral",
              "Agraria (ADM)",
              "Fiscal (ADM)",
              "Suspensión (ADM)"
            ],
            "type": "string",
            "description": "Subject area (materia) of the thesis. Applies to theses only.",
            "default": ""
          },
          "epoch": {
            "title": "Epoch (theses only)",
            "enum": [
              "",
              "12",
              "11",
              "10",
              "9",
              "8",
              "7",
              "6",
              "5"
            ],
            "type": "string",
            "description": "SJF epoch (época). Applies to theses only.",
            "default": ""
          },
          "caseType": {
            "title": "Case type (precedents and rulings)",
            "type": "string",
            "description": "Matched by \"contains\": e.g. \"amparo directo en revisión\", \"acción de inconstitucionalidad\", \"controversia constitucional\", \"contradicción\"."
          },
          "rapporteur": {
            "title": "Rapporteur justice (rulings only)",
            "type": "string",
            "description": "Ministro ponente, matched by \"contains\": e.g. \"Pardo Rebolledo\"."
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Publication date (theses) or decision date (rulings), start of range (YYYY-MM-DD). Precedents are filtered by year."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "End of range (YYYY-MM-DD)."
          },
          "sortOrder": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Sort criterion.",
            "default": "relevance"
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum per search term and document type.",
            "default": 20
          },
          "passages": {
            "title": "Relevant passages",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Paragraphs of the document containing the search terms, returned in `passages` (0 = none; then the document is not opened). Ideal for LLM analysis.",
            "default": 3
          },
          "includeFullText": {
            "title": "Include full text",
            "type": "boolean",
            "description": "Adds the `text` field with the full thesis, precedent or ruling. Greatly increases output size for rulings.",
            "default": false
          },
          "connection": {
            "title": "Connection",
            "enum": [
              "auto",
              "direct",
              "browser"
            ],
            "type": "string",
            "description": "The SCJN site (Incapsula) asks networks with low IP reputation, such as proxies, to run its verification script first. \"auto\" calls the API directly and, at the first block, switches to a regular Chromium (Playwright) that loads the home page, lets the site run its own JavaScript and then calls the API from that page. No stealth plugins or CAPTCHA solving are used.",
            "default": "auto"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Default: Apify RESIDENTIAL proxy (MX), because the source blocks datacenter IPs. If this field is omitted (API or MCP call), the actor applies it anyway. With proxyUrls your own proxies are used and the Apify proxy is not consumed.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "MX"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}