{
  "openapi": "3.0.1",
  "info": {
    "title": "US Public Transit Agency Leads & Intelligence Scraper",
    "description": "Scrape every US public transit agency from the official FTA National Transit Database: agency, organization type, website, address, fleet size, modes, annual ridership, operating budget, service area & lead score. Govtech leads, monitor mode.",
    "version": "0.1",
    "x-build-id": "8kRz6CdnpD8v7DCOh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~us-transit-agency-leads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-us-transit-agency-leads-scraper",
        "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/scrapesage~us-transit-agency-leads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-us-transit-agency-leads-scraper",
        "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/scrapesage~us-transit-agency-leads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-us-transit-agency-leads-scraper",
        "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": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "Two-letter state/territory codes to include (e.g. <code>CA</code>, <code>TX</code>, <code>NY</code>). Leave empty for all 50 states + DC + territories.",
            "items": {
              "type": "string"
            }
          },
          "orgCategories": {
            "title": "Organization type",
            "type": "array",
            "description": "Filter by agency organization category: <code>transit_authority</code>, <code>local_government</code>, <code>state_government</code>, <code>planning_mpo</code>, <code>private_for_profit</code>, <code>private_nonprofit</code>, <code>university</code>, <code>tribal</code>, <code>other</code>. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "serviceModule": {
            "title": "Urban / Rural",
            "enum": [
              "any",
              "urban",
              "rural"
            ],
            "type": "string",
            "description": "Limit to urban or rural reporters.",
            "default": "any"
          },
          "modes": {
            "title": "Transit modes",
            "type": "array",
            "description": "Only include agencies that operate one of these modes (matched on mode name, case-insensitive). Examples: <code>Bus</code>, <code>Light Rail</code>, <code>Heavy Rail</code>, <code>Commuter Rail</code>, <code>Ferry</code>, <code>Demand Response</code>, <code>Vanpool</code>, <code>Streetcar</code>.",
            "items": {
              "type": "string"
            }
          },
          "railOperatorsOnly": {
            "title": "Rail operators only",
            "type": "boolean",
            "description": "Only include agencies that operate a rail mode (light/heavy/commuter rail, streetcar, monorail).",
            "default": false
          },
          "reporterTypes": {
            "title": "Reporter type",
            "type": "array",
            "description": "Filter by NTD reporter type (e.g. <code>Full Reporter</code>, <code>Reduced Reporter</code>, <code>Rural Reporter</code>, <code>Building Reporter</code>).",
            "items": {
              "type": "string"
            }
          },
          "minVehicles": {
            "title": "Minimum fleet size (vehicles)",
            "minimum": 0,
            "type": "integer",
            "description": "Only include agencies with at least this many vehicles operated in maximum service (fleet size). Larger fleets are prime targets for rolling-stock, EV-bus and fleet software."
          },
          "maxVehicles": {
            "title": "Maximum fleet size (vehicles)",
            "minimum": 0,
            "type": "integer",
            "description": "Only include agencies with at most this many vehicles."
          },
          "minServiceAreaPopulation": {
            "title": "Minimum service-area population",
            "minimum": 0,
            "type": "integer",
            "description": "Only include agencies whose service-area population is at least this."
          },
          "minAnnualRidership": {
            "title": "Minimum annual ridership",
            "minimum": 0,
            "type": "integer",
            "description": "Only include agencies with at least this many annual unlinked passenger trips (requires service metrics)."
          },
          "minOperatingExpenses": {
            "title": "Minimum operating budget (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only include agencies whose total annual operating expenses are at least this (a buying-power signal; requires service metrics)."
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Only include agencies whose city contains one of these (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "nameQuery": {
            "title": "Name contains",
            "type": "string",
            "description": "Only include agencies whose name or urbanized-area name contains this text (case-insensitive)."
          },
          "hasWebsite": {
            "title": "Has website",
            "type": "boolean",
            "description": "Only include agencies that list a website.",
            "default": false
          },
          "includeServiceMetrics": {
            "title": "Include service metrics (modes, ridership, budget)",
            "type": "boolean",
            "description": "Enrich each agency with modes operated, annual ridership and total operating expenses by joining the NTD service-metrics table. Recommended (small extra fetch).",
            "default": true
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "leadScore",
              "fleetSize",
              "ridership",
              "operatingBudget",
              "serviceAreaPop",
              "name"
            ],
            "type": "string",
            "description": "Order of the output records.",
            "default": "leadScore"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of agency lead records to output.",
            "default": 1000
          },
          "includeRawFields": {
            "title": "Include raw source fields",
            "type": "boolean",
            "description": "Attach the full original NTD row to each record under <code>sourceFields</code> (richest possible dataset).",
            "default": true
          },
          "monitorMode": {
            "title": "Monitor mode (only new / changed)",
            "type": "boolean",
            "description": "Only output agencies that are NEW or CHANGED since the last run with the same Monitor key. Pairs perfectly with Apify Schedules to track new reporters, fleet/budget/ridership changes.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Names the saved monitor state. Use one key per saved search so different schedules don't overwrite each other.",
            "default": "default"
          },
          "deduplicateResults": {
            "title": "Deduplicate results",
            "type": "boolean",
            "description": "Drop duplicate agencies within a run (recommended).",
            "default": true
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional Socrata app token to raise rate limits. Not required — the NTD is keyless."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Not needed — the NTD open-data API is reachable directly. Leave proxy off for the cheapest, fastest runs.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}