{
  "openapi": "3.0.1",
  "info": {
    "title": "US Rail Accident, Derailment & Grade Crossing Tracker (FRA)",
    "description": "Search and summarize official US Federal Railroad Administration train accident, derailment and grade crossing incident reports. No login, no proxy.",
    "version": "0.1",
    "x-build-id": "aworhKVRIGH0aQTrt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kindred_feathergrass~us-rail-accident-derailment-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kindred_feathergrass-us-rail-accident-derailment-tracker",
        "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/kindred_feathergrass~us-rail-accident-derailment-tracker/runs": {
      "post": {
        "operationId": "runs-sync-kindred_feathergrass-us-rail-accident-derailment-tracker",
        "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/kindred_feathergrass~us-rail-accident-derailment-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-kindred_feathergrass-us-rail-accident-derailment-tracker",
        "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": {
          "dataset": {
            "title": "Dataset",
            "enum": [
              "equipment_accidents",
              "grade_crossing_incidents"
            ],
            "type": "string",
            "description": "Train accidents and derailments (FRA Form 54), or highway-rail grade crossing incidents (FRA Form 57).",
            "default": "equipment_accidents"
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "records",
              "summary"
            ],
            "type": "string",
            "description": "Individual incident records, or a summary table grouped by one field (counts, damage cost, deaths and injuries).",
            "default": "records"
          },
          "groupBy": {
            "title": "Summary: group by",
            "enum": [
              "railroad",
              "state",
              "year",
              "cause",
              "accidentType",
              "highwayUser"
            ],
            "type": "string",
            "description": "Only used when Output is Summary table. 'cause' and 'accidentType' work for Form 54 only. 'highwayUser' works for Form 57 only.",
            "default": "railroad"
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Two-letter US state codes, for example MN, OH, TX. Leave empty for all states.",
            "items": {
              "type": "string"
            }
          },
          "railroads": {
            "title": "Railroads",
            "type": "array",
            "description": "Railroad names or codes. Matches part of the name, for example 'BNSF', 'Norfolk Southern', 'UP', 'CSX'. Leave empty for all railroads.",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "From date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Earliest incident date, format YYYY-MM-DD."
          },
          "dateTo": {
            "title": "To date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Latest incident date, format YYYY-MM-DD."
          },
          "accidentTypes": {
            "title": "Accident types (Form 54 only)",
            "type": "array",
            "description": "For example Derailment, Head on collision, Rear end collision, Fire/violent rupture, Highway-rail crossing. Leave empty for all types.",
            "items": {
              "type": "string"
            }
          },
          "causeContains": {
            "title": "Cause contains (Form 54 only)",
            "type": "string",
            "description": "Keep only incidents whose primary cause text contains this word, for example 'wheel', 'rail', 'brake', 'bearing'."
          },
          "minTotalDamage": {
            "title": "Minimum damage cost in USD (Form 54 only)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only incidents with at least this much reported equipment and track damage."
          },
          "onlyWithCasualties": {
            "title": "Only incidents with deaths or injuries",
            "type": "boolean",
            "description": "Keep only incidents where at least one person was killed or injured.",
            "default": false
          },
          "onlyHazmatRelease": {
            "title": "Only hazmat releases (Form 54 only)",
            "type": "boolean",
            "description": "Keep only incidents where at least one hazardous materials car released its contents.",
            "default": false
          },
          "includeNarrative": {
            "title": "Include narrative text",
            "type": "boolean",
            "description": "Add the free-text narrative written by the railroad, when there is one.",
            "default": false
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after this many records or summary rows. You are only charged for results you receive.",
            "default": 100
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free token from data.transportation.gov that raises rate limits. Not needed for normal use."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}