{
  "openapi": "3.0.1",
  "info": {
    "title": "Open311 Service Request Extractor",
    "description": "Point at any Open311 (GeoReport v2) city for one structured row per 311 service request: id, status, service, description, address, coordinates, media, agency, timestamps. Also pull the service-type catalog and the endpoint discovery — the open municipal-311 standard, anonymous read.",
    "version": "0.1",
    "x-build-id": "TX3bNB3metmZ9gcOL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~open311-service-request-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-open311-service-request-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~open311-service-request-extractor/runs": {
      "post": {
        "operationId": "runs-sync-datamule-open311-service-request-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~open311-service-request-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-open311-service-request-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",
        "properties": {
          "jurisdiction": {
            "title": "Open311 jurisdiction URL",
            "type": "string",
            "description": "An Open311 GeoReport v2 jurisdiction. Paste either a base URL (https://mobile311.sfgov.org) — the /open311/v2/<endpoint>.json path is appended for you — OR a full endpoint (https://mobile311.sfgov.org/open311/v2/requests.json). Open311 is the open civic standard for municipal 311 service requests (potholes, graffiti, streetlights…); every adopting city serves the identical anonymous-read grammar. Find adopting jurisdictions in the registry at github.com/open311/open311.github.io (data/servers.yml). To query several cities at once, use Jurisdictions (array) instead."
          },
          "jurisdictions": {
            "title": "Jurisdictions (multi-city, optional)",
            "type": "array",
            "description": "Optional list of Open311 jurisdiction URLs (base or full endpoint) to query in turn (overrides / augments the single Jurisdiction URL). A source that is unreachable, auth-gated, or not an Open311 host is skipped with a warning and the run continues with the others.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "requests",
              "services",
              "discovery"
            ],
            "type": "string",
            "description": "What to extract. requests (default): the public service-request feed — one row per 311 request (id, status, service, description, address, coordinates, media, timestamps). services: the service catalog — one row per request type the jurisdiction offers. discovery: the endpoint self-description (/discovery.json) — one row (changeset, contact, specification, endpoint URLs).",
            "default": "requests"
          },
          "serviceCode": {
            "title": "Service code (requests mode)",
            "type": "string",
            "description": "REQUESTS MODE. Filter the feed to a single Open311 service_code (a request type from the services catalog), passed through to the API's ?service_code= param. Leave empty for all service types. Run services mode first to list the valid codes for a jurisdiction."
          },
          "status": {
            "title": "Status (requests mode)",
            "enum": [
              "",
              "open",
              "closed"
            ],
            "type": "string",
            "description": "REQUESTS MODE. Filter the feed by request status, passed through to ?status=. Open311 defines two values: open or closed. Leave empty for both.",
            "default": ""
          },
          "startDate": {
            "title": "Start date (requests mode)",
            "type": "string",
            "description": "REQUESTS MODE. Only requests with a requested_datetime at or after this instant, passed through to ?start_date=. Use RFC-3339 / ISO-8601, e.g. 2026-07-01T00:00:00Z. Leave empty for the server default window (typically the most recent 90 days)."
          },
          "endDate": {
            "title": "End date (requests mode)",
            "type": "string",
            "description": "REQUESTS MODE. Only requests with a requested_datetime at or before this instant, passed through to ?end_date=. Use RFC-3339 / ISO-8601, e.g. 2026-07-07T00:00:00Z. Leave empty for now."
          },
          "serviceRequestId": {
            "title": "Service request ID(s) (requests mode)",
            "type": "string",
            "description": "REQUESTS MODE. Fetch one or more specific requests by id, passed through to ?service_request_id= (a comma-separated list per the spec). Leave empty to list the feed."
          },
          "jurisdictionId": {
            "title": "Jurisdiction ID (optional)",
            "type": "string",
            "description": "Optional Open311 jurisdiction_id, passed through to the API. Only needed for multi-tenant servers that host several jurisdictions behind one endpoint and require it to disambiguate; most single-city hosts ignore it."
          },
          "maxRecords": {
            "title": "Max records (global cap)",
            "minimum": 1,
            "type": "integer",
            "description": "A GLOBAL cap on the number of rows to emit across ALL sources. Defaults to 25 rows when omitted, invalid, or non-positive. Each emitted row is one billable record event at $0.0005 on the FREE tier, and pagination stops as soon as the cap is reached. Set a smaller or larger positive value to change the cap.",
            "default": 25
          },
          "token": {
            "title": "API key / token",
            "type": "string",
            "description": "Optional API key / token for a jurisdiction that gates its request feed (sent as an Authorization: Bearer header). NOT required for the public standard feeds. Never logged."
          },
          "extraHeaders": {
            "title": "Extra request headers",
            "type": "object",
            "description": "Optional extra HTTP headers as a JSON object, e.g. {\"x-api-key\": \"...\"} for a gated / gateway-fronted jurisdiction. Not required for the public feeds. Header values are never logged."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}