{
  "openapi": "3.0.1",
  "info": {
    "title": "Data Gov India Actor",
    "description": "Data Gov India Actor connects to the Data.gov.in platform to access, search, and analyze open government datasets across domains like agriculture, health, finance, and environment. Ideal for data-driven projects and automation.",
    "version": "0.0",
    "x-build-id": "veQahw61IefbS2vE8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/amaranth_nylon~data-gov-in-actor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-amaranth_nylon-data-gov-in-actor",
        "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/amaranth_nylon~data-gov-in-actor/runs": {
      "post": {
        "operationId": "runs-sync-amaranth_nylon-data-gov-in-actor",
        "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/amaranth_nylon~data-gov-in-actor/run-sync": {
      "post": {
        "operationId": "run-sync-amaranth_nylon-data-gov-in-actor",
        "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": {
          "mode": {
            "title": "Operation Mode",
            "enum": [
              "search",
              "retrieve",
              "analyze",
              "monitor"
            ],
            "type": "string",
            "description": "Primary operation mode for the actor",
            "default": "search"
          },
          "query": {
            "title": "Search Query",
            "type": "string",
            "description": "Natural language or keyword search query (e.g., 'GDP data 2024', 'healthcare statistics')"
          },
          "filters": {
            "title": "Advanced Filters",
            "type": "object",
            "description": "Structured filters for refined search",
            "properties": {
              "organization": {
                "title": "Organization/Ministry",
                "type": "string",
                "description": "Filter by government organization (e.g., 'Ministry of Finance')",
                "editor": "textfield"
              },
              "sector": {
                "title": "Sector",
                "type": "string",
                "description": "Data sector (e.g., 'Health', 'Education', 'Finance')",
                "editor": "textfield"
              },
              "format": {
                "title": "Resource Format",
                "type": "array",
                "description": "Preferred data formats",
                "editor": "select",
                "items": {
                  "type": "string",
                  "enum": [
                    "CSV",
                    "JSON",
                    "XML",
                    "XLS",
                    "XLSX",
                    "PDF",
                    "API"
                  ]
                },
                "uniqueItems": true
              },
              "tags": {
                "title": "Tags",
                "type": "array",
                "description": "Filter by specific tags",
                "editor": "stringList",
                "items": {
                  "type": "string"
                }
              },
              "dateFrom": {
                "title": "Data From Date",
                "type": "string",
                "description": "Filter datasets updated after this date (YYYY-MM-DD)",
                "editor": "textfield",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "dateTo": {
                "title": "Data To Date",
                "type": "string",
                "description": "Filter datasets updated before this date (YYYY-MM-DD)",
                "editor": "textfield",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              }
            }
          },
          "datasetIds": {
            "title": "Specific Dataset IDs",
            "type": "array",
            "description": "List of specific dataset IDs to retrieve (bypasses search)",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Maximum Results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of datasets to process (1-1000)",
            "default": 50
          },
          "includeResources": {
            "title": "Include Resource Data",
            "type": "boolean",
            "description": "Download and analyze actual resource files (not just metadata)",
            "default": false
          },
          "resourceLimit": {
            "title": "Resource Download Limit",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum number of resources to download per dataset (1-10)",
            "default": 3
          },
          "maxFileSize": {
            "title": "Max File Size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum file size to download in megabytes",
            "default": 50
          },
          "analytics": {
            "title": "Analytics Options",
            "type": "object",
            "description": "Configure analytics and processing",
            "properties": {
              "enableStatistics": {
                "title": "Enable Statistical Analysis",
                "type": "boolean",
                "description": "Perform descriptive statistics on numerical data",
                "default": false
              },
              "enableTrends": {
                "title": "Enable Trend Analysis",
                "type": "boolean",
                "description": "Detect trends in time-series data",
                "default": false
              },
              "dataQualityScore": {
                "title": "Calculate Data Quality Score",
                "type": "boolean",
                "description": "Assess data quality based on completeness and consistency",
                "default": true
              },
              "generateVisualizations": {
                "title": "Generate Visualizations",
                "type": "boolean",
                "description": "Create charts and visual summaries",
                "default": false
              }
            }
          },
          "output": {
            "title": "Output Configuration",
            "type": "object",
            "description": "Configure output formats and options",
            "properties": {
              "format": {
                "title": "Primary Output Format",
                "type": "string",
                "enum": [
                  "json",
                  "csv",
                  "both"
                ],
                "default": "json",
                "description": "Format for actor output"
              },
              "includeMetadata": {
                "title": "Include Full Metadata",
                "type": "boolean",
                "default": true,
                "description": "Include complete dataset metadata"
              },
              "includePreview": {
                "title": "Include Data Preview",
                "type": "boolean",
                "default": true,
                "description": "Include preview of first 100 rows"
              },
              "compressionFormat": {
                "title": "Compression Format",
                "type": "string",
                "enum": [
                  "none",
                  "zip",
                  "gzip"
                ],
                "default": "none",
                "description": "Compress output files"
              }
            }
          },
          "authentication": {
            "title": "API Authentication",
            "type": "object",
            "description": "Authentication credentials for data.gov.in API",
            "properties": {
              "apiKey": {
                "title": "API Key",
                "type": "string",
                "description": "Your data.gov.in API key (optional for public data). Store sensitive keys in Apify Secret Storage.",
                "editor": "textfield"
              },
              "enableOAuth": {
                "title": "Enable OAuth 2.0",
                "type": "boolean",
                "description": "Use OAuth 2.0 authentication (for premium features)",
                "default": false
              },
              "oauthToken": {
                "title": "OAuth Token",
                "type": "string",
                "description": "OAuth 2.0 access token. Store sensitive tokens in Apify Secret Storage.",
                "editor": "textfield"
              }
            }
          },
          "rateLimit": {
            "title": "Rate Limit Configuration",
            "type": "object",
            "description": "Configure rate limiting to comply with API policies",
            "properties": {
              "requestsPerHour": {
                "title": "Requests Per Hour",
                "type": "integer",
                "description": "Maximum requests per hour (default: 2000 as per OGD Policy)",
                "default": 1800,
                "minimum": 100,
                "maximum": 2000
              },
              "concurrentRequests": {
                "title": "Concurrent Requests",
                "type": "integer",
                "description": "Number of parallel requests",
                "default": 5,
                "minimum": 1,
                "maximum": 10
              },
              "retryAttempts": {
                "title": "Retry Attempts",
                "type": "integer",
                "description": "Number of retry attempts for failed requests",
                "default": 5,
                "minimum": 1,
                "maximum": 10
              }
            }
          },
          "governance": {
            "title": "Governance & Compliance",
            "type": "object",
            "description": "Compliance and ethical data handling options",
            "properties": {
              "respectLicenses": {
                "title": "Respect License Restrictions",
                "type": "boolean",
                "description": "Enforce CC-BY 4.0 and other license requirements",
                "default": true
              },
              "blockRestrictedData": {
                "title": "Block Restricted Datasets",
                "type": "boolean",
                "description": "Skip datasets marked as restricted or internal-use",
                "default": true
              },
              "enableAuditLog": {
                "title": "Enable Audit Logging",
                "type": "boolean",
                "description": "Log all operations for compliance tracking",
                "default": true
              },
              "piiDetection": {
                "title": "PII Detection & Redaction",
                "type": "boolean",
                "description": "Detect and redact personally identifiable information",
                "default": true
              }
            }
          },
          "language": {
            "title": "Language Preference",
            "enum": [
              "en",
              "hi",
              "both"
            ],
            "type": "string",
            "description": "Preferred language for multilingual content",
            "default": "en"
          },
          "debugMode": {
            "title": "Debug Mode",
            "type": "boolean",
            "description": "Enable verbose logging for debugging",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}