{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Ground Risk API - Coal Mining, Brine, Subsidence",
    "description": "Screen any UK location for coal mining, non-coal mining, brine and ground stability risk, with the mineral types behind a finding, plus mapped environmental datasets as GeoJSON over an area in British National Grid or WGS 84, and your own report orders, findings and invoices.",
    "version": "0.1",
    "x-build-id": "2pWUau1LRkKw2Uadf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~uk-ground-risk-mining-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-uk-ground-risk-mining-api",
        "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/nabeelbaghoor~uk-ground-risk-mining-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-uk-ground-risk-mining-api",
        "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/nabeelbaghoor~uk-ground-risk-mining-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-uk-ground-risk-mining-api",
        "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": {
          "service": {
            "title": "What to read",
            "enum": [
              "groundRisk",
              "miningRisk",
              "spatialFeatures",
              "products",
              "orders",
              "orderDetail",
              "orderDocuments",
              "invoices",
              "organisation",
              "alertsVersion"
            ],
            "type": "string",
            "description": "Ground risk screening and mining risk detail answer whether a location carries a coal, non-coal, brine or ground stability risk. Spatial features returns the provider's mapped data as GeoJSON over an area. The remaining services read your own account: the product catalogue, your orders, the documents and JSON findings on them, and your invoices.",
            "default": "groundRisk"
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "One location per line, either a \"latitude,longitude\" pair or a well known text geometry such as POINT(-0.1387 50.8233) or a POLYGON. Pairs are written latitude first, the way people write coordinates, and converted to the longitude-first order the geometry format expects, so a pair typed the natural way cannot become a real place somewhere else.",
            "items": {
              "type": "string"
            }
          },
          "boundingBoxes": {
            "title": "Bounding boxes",
            "type": "array",
            "description": "One box per line for the spatial features service, as four comma separated numbers giving the south, west, north and east edges of the area. Each box becomes its own paged read.",
            "items": {
              "type": "string"
            }
          },
          "dataset": {
            "title": "Dataset name",
            "type": "string",
            "description": "Which mapped dataset the spatial features service should read. Which datasets your subscription covers comes from your provider account, so this is a free text field rather than a fixed list."
          },
          "inputProjection": {
            "title": "Projection of your coordinates",
            "enum": [
              "4326",
              "27700",
              "3857"
            ],
            "type": "string",
            "description": "Which projection the bounding box you supply is written in. This is sent explicitly rather than left to a server default, because British National Grid and WGS 84 put the same numbers kilometres apart.",
            "default": "4326"
          },
          "outputProjection": {
            "title": "Projection of the returned geometry",
            "enum": [
              "4326",
              "27700",
              "3857"
            ],
            "type": "string",
            "description": "Which projection the returned GeoJSON should be in. It can differ from the projection of your request, which is how you supply latitude and longitude and get British National Grid back.",
            "default": "4326"
          },
          "orderIds": {
            "title": "Order ids",
            "type": "array",
            "description": "One order id per line, for the single order and order documents services. Run the \"Your orders\" service first to collect them.",
            "items": {
              "type": "string"
            }
          },
          "orderStatus": {
            "title": "Order status",
            "type": "string",
            "description": "Filter your orders by status, as the provider labels them."
          },
          "orderItemStatus": {
            "title": "Order item status",
            "type": "string",
            "description": "Filter your orders by the status of the items inside them, which can differ from the order's own status."
          },
          "orderReportType": {
            "title": "Order report type",
            "type": "string",
            "description": "Filter your orders to one report type."
          },
          "orderQuery": {
            "title": "Order text search",
            "type": "string",
            "description": "Free text matched against your orders, such as a customer reference or an address."
          },
          "orderFromDate": {
            "title": "Orders from date",
            "type": "string",
            "description": "Only orders placed on or after this date."
          },
          "orderToDate": {
            "title": "Orders to date",
            "type": "string",
            "description": "Only orders placed on or before this date."
          },
          "orderSort": {
            "title": "Order sort field",
            "type": "string",
            "description": "Which field to sort your orders by, as the provider names it."
          },
          "orderDirection": {
            "title": "Order sort direction",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Which way to sort your orders.",
            "default": "desc"
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after this many rows. The spatial features service pages 100 features at a time, so a large area can return a great many, and this cap is what bounds it.",
            "default": 500
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Pacing ceiling. Lower this if your subscription sets a throughput limit.",
            "default": 60
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own API key for the UK environmental data provider. This actor is bring-your-own-key and never ships a key of its own. Leave blank to use the DATA_API_KEY environment secret instead."
          },
          "alertsBaseUrl": {
            "title": "Risk service base URL",
            "type": "string",
            "description": "Override the host serving the ground risk and mining services. Set this to the provider's staging host to test against it."
          },
          "dataHubBaseUrl": {
            "title": "Spatial data base URL",
            "type": "string",
            "description": "Override the host serving the spatial features service."
          },
          "webApiBaseUrl": {
            "title": "Account API base URL",
            "type": "string",
            "description": "Override the host serving the product catalogue, orders, documents and invoices."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}