{
  "openapi": "3.0.1",
  "info": {
    "title": "ArcGIS FeatureServer Extractor",
    "description": "Point at ANY Esri ArcGIS REST layer (FeatureServer/MapServer) behind US cities, counties, DOTs, HUD & USGS. Pages a layer's /query via resultOffset honoring exceededTransferLimit, or enumerates a service root. Flat rows: every attribute as a column + geometry + lon/lat + raw. Pay per feature.",
    "version": "0.1",
    "x-build-id": "ocmZgnLda1VZEYxNd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~arcgis-featureserver-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-arcgis-featureserver-extractor",
        "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/datamule~arcgis-featureserver-extractor/runs": {
      "post": {
        "operationId": "runs-sync-datamule-arcgis-featureserver-extractor",
        "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/datamule~arcgis-featureserver-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-arcgis-featureserver-extractor",
        "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": [
          "serviceUrls"
        ],
        "properties": {
          "serviceUrls": {
            "title": "ArcGIS REST URL(s)",
            "type": "array",
            "description": "One or more Esri ArcGIS REST URLs. Each can be: (a) a LAYER QUERY endpoint — e.g. https://services.arcgis.com/VTyQ9soqVukalItT/arcgis/rest/services/Multifamily_Properties_Assisted/FeatureServer/0/query ; (b) a LAYER URL without /query — e.g. .../FeatureServer/0 ; or (c) a SERVICE ROOT — e.g. .../FeatureServer or .../MapServer — which the actor enumerates into all of its layers. Any pre-existing query string (except the reserved query controls) is preserved and re-sent. Works with both ArcGIS Online (services.arcgis.com/*) and self-hosted ArcGIS Server (…/arcgis/rest/services/*).",
            "items": {
              "type": "string"
            }
          },
          "where": {
            "title": "WHERE clause",
            "type": "string",
            "description": "SQL-style WHERE filter applied to every layer, e.g. STATE = 'CA' or POP > 100000 or a date literal. Default 1=1 (all rows). The exact SQL dialect follows the target ArcGIS server. A valid clause that matches nothing returns 0 records and a clean exit.",
            "default": "1=1"
          },
          "outFields": {
            "title": "Output fields",
            "type": "string",
            "description": "Comma-separated list of attribute field names to return, e.g. OBJECTID,NAME,POP. Default * (all fields). Each returned field becomes its own column in the output row. Tip: run with \"List layers only\" first, or query one layer with * to discover the exact field names a layer exposes.",
            "default": "*"
          },
          "returnGeometry": {
            "title": "Return geometry",
            "type": "boolean",
            "description": "When on (default), each feature's Esri geometry is fetched and stored in _geometry (plus a computed _bbox, and _longitude/_latitude for point layers, reprojected from Web Mercator when needed). Turn OFF to fetch attributes only — faster, smaller, cheaper for non-spatial use.",
            "default": true
          },
          "listLayersOnly": {
            "title": "List layers only (discovery)",
            "type": "boolean",
            "description": "When on, and a SERVICE ROOT (…/FeatureServer or …/MapServer) is given, the actor only reads the service descriptor and returns one row per layer (id, name, geometry type, min/max scale, capabilities, query URL) — it does NOT fetch any features. Use this to map what a service exposes, then point at a specific layer's /query. Ignored for URLs that already reference a specific layer.",
            "default": false
          },
          "maxRecords": {
            "title": "Max records (total)",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum total number of features to pull across ALL layers and pages (the actor auto-paginates via resultOffset + resultRecordCount, honoring the layer's maxRecordCount and exceededTransferLimit, until this cap or the result set is exhausted). Each returned feature is one billable event. Default 1000.",
            "default": 1000
          },
          "pageSize": {
            "title": "Page size",
            "minimum": 1,
            "type": "integer",
            "description": "Server-side records requested per /query call (resultRecordCount). The actor auto-follows pages regardless. Most ArcGIS layers cap this at their maxRecordCount (commonly 1000–2000); asking for more just returns the layer's max. Leave at the default unless you have a reason to change it.",
            "default": 1000
          },
          "arcgisToken": {
            "title": "ArcGIS token (optional)",
            "type": "string",
            "description": "Optional ArcGIS access token for secured (token-gated) services — sent as the standard ?token= query parameter on every request. NOT required for public open-data services (the vast majority). Never logged."
          },
          "bearerToken": {
            "title": "Bearer token (optional)",
            "type": "string",
            "description": "Optional OAuth2 bearer token for deployments fronted by an auth proxy — sent as Authorization: Bearer ***. Distinct from the ArcGIS token above. Not required for public services — leave empty. Never logged."
          },
          "extraHeaders": {
            "title": "Extra request headers",
            "type": "object",
            "description": "Optional extra HTTP headers to send with every request, as a JSON object, e.g. {\"x-api-key\": \"...\"} for a service that takes an API key in a header. Leave empty for public services."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}