{
  "openapi": "3.0.1",
  "info": {
    "title": "ArcGIS REST API Scraper - FeatureServer to CSV/JSON",
    "description": "Export any public ArcGIS FeatureServer/MapServer layer to CSV, JSON or Excel: county parcels, permits, zoning, HUD, USGS, open-data portals. Paste a layer URL, add an optional WHERE filter; auto-paginates. Every attribute + geometry + lon/lat. $0.50 per 1,000 features.",
    "version": "0.1",
    "x-build-id": "6d2iXlBeFqi49kRu2"
  },
  "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. You can also paste the web page you found the data on: an ArcGIS Online item page (…/home/item.html?id=…) or an ArcGIS Hub / open-data dataset page (…/datasets/<id>_0); the Actor looks up the item's REST URL for you. Any pre-existing query string (except the reserved query controls) is preserved and re-sent. If a pasted query URL contains where, outFields or returnGeometry, those values apply to that URL unless you changed the matching field below. To get all rows or all fields instead, remove that part from the URL. 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
          },
          "outSR": {
            "title": "Output coordinate system (outSR)",
            "type": "string",
            "description": "Optional. Leave empty to keep the layer's own coordinates. Enter 4326 to get geometry in WGS84 longitude/latitude, which also fills _longitude/_latitude for point layers published in a local projection (for example US State Plane or UTM, where they would otherwise be empty). Accepts a number such as 4326 or EPSG:4326; the ArcGIS server does the conversion."
          },
          "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, only to the host(s) you pasted (never to a different host reached via an item/Hub page or a redirect). 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. Sent only to the host(s) you pasted. 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. Sent only to the host(s) you pasted. 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}