{
  "openapi": "3.0.1",
  "info": {
    "title": "eCourts Advocate Case Scraper",
    "description": "Search court cases by advocate name or bar code on Indian eCourts services. Supports fetching states, districts, complexes, and establishments.",
    "version": "1.2",
    "x-build-id": "xm1HuvLrSYQEL9eru"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/codingfrontend~ecourts-advocate-case-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-codingfrontend-ecourts-advocate-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-advocate-case-scraper/runs": {
      "post": {
        "operationId": "runs-sync-codingfrontend-ecourts-advocate-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-advocate-case-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-codingfrontend-ecourts-advocate-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": "Choose the operation mode for the scraper.",
            "default": "search"
          },
          "searchType": {
            "title": "Search Type",
            "enum": [
              "name",
              "barcode",
              "caselist"
            ],
            "type": "string",
            "description": "Search by advocate name, bar registration code, or case list.",
            "default": "name"
          },
          "advocateName": {
            "title": "Advocate Name",
            "type": "string",
            "description": "Name of the advocate to search for when searchType is name."
          },
          "barState": {
            "title": "Bar State",
            "type": "string",
            "description": "Bar-council state code used when searchType is barcode or caselist."
          },
          "barCode": {
            "title": "Bar Code",
            "type": "string",
            "description": "Bar registration code number used when searchType is barcode or caselist."
          },
          "barYear": {
            "title": "Bar Year",
            "type": "string",
            "description": "Bar registration year used when searchType is barcode or caselist."
          },
          "searchDate": {
            "title": "Search Date",
            "type": "string",
            "description": "Date filter in DD-MM-YYYY format, required for caselist searches."
          },
          "stateCode": {
            "title": "State Code",
            "type": "string",
            "description": "Optional search filter. If omitted in search mode, the Actor searches every live state. Use get_states to discover current values."
          },
          "districtCode": {
            "title": "District Code",
            "type": "string",
            "description": "Optional search filter. If omitted, the Actor searches every live district under the selected state scope. Required for get_complexes."
          },
          "complexCode": {
            "title": "Court Complex Code",
            "type": "string",
            "description": "Optional public court-complex filter. If omitted, all matching live complexes are searched. Unsuffixed and @Y complexes without estCode are expanded through every live establishment; @N is already concrete."
          },
          "estCode": {
            "title": "Establishment Code",
            "type": "string",
            "description": "Optional public establishment filter. If omitted for an @Y or unsuffixed complex, every live establishment is searched."
          },
          "caseStatus": {
            "title": "Case Status",
            "enum": [
              "Both",
              "Pending",
              "Disposed"
            ],
            "type": "string",
            "description": "Public case-status filter.",
            "default": "Both"
          },
          "maxCaptchaRetries": {
            "title": "Max Captcha Retries",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum external-solver submissions per concrete location, from 1 to 5. 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 Country Fallbacks",
            "maxItems": 5,
            "uniqueItems": true,
            "type": "array",
            "description": "Sequential Apify Proxy country rotation. Defaults to GB, US, then IN and repeats until maxSessionAttempts; ignored for custom proxyUrls.",
            "items": {
              "type": "string"
            },
            "default": [
              "GB",
              "US",
              "IN"
            ]
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "required": [],
            "type": "object",
            "description": "One sticky route is used per browser session. Retryable failures close that browser before the next sequential country/session route is created.",
            "properties": {
              "useApifyProxy": {
                "title": "Use Apify Proxy",
                "type": "boolean",
                "description": "Whether to use the configured Apify proxy route."
              },
              "apifyProxyGroups": {
                "title": "Apify Proxy Groups",
                "type": "array",
                "description": "Apify proxy groups selected for the route.",
                "items": {
                  "type": "string"
                }
              },
              "apifyProxyCountry": {
                "title": "Apify Proxy Country",
                "type": "string",
                "description": "ISO country code for the configured route."
              },
              "proxyUrls": {
                "title": "Proxy URLs",
                "type": "array",
                "description": "Optional user-configured proxy URLs accepted by the Apify proxy editor.",
                "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}