{
  "openapi": "3.0.1",
  "info": {
    "title": "eCourts Party Case Scraper",
    "description": "Search court cases by party name on Indian eCourts services. Supports fetching states, districts, complexes, and establishments.",
    "version": "1.2",
    "x-build-id": "1vmVIZ7OpopL0f2Ei"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/codingfrontend~ecourts-party-case-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-codingfrontend-ecourts-party-case-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/codingfrontend~ecourts-party-case-scraper/runs": {
      "post": {
        "operationId": "runs-sync-codingfrontend-ecourts-party-case-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/codingfrontend~ecourts-party-case-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-codingfrontend-ecourts-party-case-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": [
              "get_states",
              "get_districts",
              "get_complexes",
              "get_establishments",
              "search"
            ],
            "type": "string",
            "description": "Search party cases or fetch one level of the live eCourts location hierarchy.",
            "default": "search"
          },
          "partyName": {
            "title": "Party Name",
            "type": "string",
            "description": "Petitioner or respondent name. Required in search mode."
          },
          "registrationYear": {
            "title": "Registration Year",
            "pattern": "^[0-9]{4}$",
            "type": "string",
            "description": "Four-digit case registration year. Required in search mode."
          },
          "stateCode": {
            "title": "State Code",
            "type": "string",
            "description": "Optional search scope. Delhi is 26. If omitted, all live states are expanded."
          },
          "districtCode": {
            "title": "District Code",
            "type": "string",
            "description": "Optional district scope. South East/Saket under Delhi is 11."
          },
          "complexCode": {
            "title": "Court Complex Value",
            "type": "string",
            "description": "Optional full live complex value. Unsuffixed values are resolved. @N values are concrete; @Y values without estCode expand every establishment."
          },
          "estCode": {
            "title": "Establishment Code",
            "type": "string",
            "description": "Optional establishment. Leave empty to search every establishment exposed by an @Y complex."
          },
          "caseStatus": {
            "title": "Case Status",
            "enum": [
              "Both",
              "Pending",
              "Disposed"
            ],
            "type": "string",
            "description": "Public case-status filter.",
            "default": "Both"
          },
          "maxCaptchaRetries": {
            "title": "Max CAPTCHA Attempts",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum configured external-solver submissions per concrete location. Search mode requires CAPTCHA_API_KEY as an Actor environment secret.",
            "default": 3
          },
          "maxSessionAttempts": {
            "title": "Max Sequential Session Attempts",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Base fresh browser/proxy sessions in each complete retry cycle. Search cascades add the configured reserve. Only one session is active at a time.",
            "default": 30
          },
          "cascadeReserveAttempts": {
            "title": "Cascade Session Reserve",
            "minimum": 0,
            "maximum": 120,
            "type": "integer",
            "description": "Additional fresh sessions reserved per cycle so a broad cascade can resume completed locations after the base session budget is exhausted.",
            "default": 60
          },
          "cascadeRetryCycles": {
            "title": "Cascade Retry Cycles",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Complete base-plus-reserve proxy cycles allowed for search mode. Completed locations and unique cases remain in memory between cycles.",
            "default": 5
          },
          "cascadeRetryDelayMs": {
            "title": "Cycle Cooldown (milliseconds)",
            "minimum": 0,
            "maximum": 120000,
            "type": "integer",
            "description": "Cooldown before a fresh proxy cycle starts after the preceding base-plus-reserve budget is exhausted.",
            "default": 30000
          },
          "proxyCountryFallbacks": {
            "title": "Sequential Proxy Countries",
            "maxItems": 5,
            "uniqueItems": true,
            "type": "array",
            "description": "Apify Proxy country rotation, repeated across session attempts. Ignored when custom proxyUrls are supplied.",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}(?:_[A-Za-z]{2})?$"
            },
            "default": [
              "GB",
              "US",
              "IN"
            ]
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "required": [],
            "type": "object",
            "description": "One sticky route is used per browser session. A failed retryable session is closed before the next country/session route is created.",
            "properties": {
              "useApifyProxy": {
                "title": "Use Apify Proxy",
                "type": "boolean",
                "description": "Whether to use an Apify-managed proxy route."
              },
              "apifyProxyGroups": {
                "title": "Apify Proxy Groups",
                "type": "array",
                "description": "Apify Proxy groups selected for the browser route.",
                "items": {
                  "type": "string"
                }
              },
              "apifyProxyCountry": {
                "title": "Apify Proxy Country",
                "type": "string",
                "description": "Fallback country when no country-rotation list is provided."
              },
              "proxyUrls": {
                "title": "Custom Proxy URLs",
                "type": "array",
                "description": "Optional custom proxy URLs used without Apify country overrides.",
                "items": {
                  "type": "string"
                }
              }
            },
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "IN"
            },
            "additionalProperties": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}