{
  "openapi": "3.0.1",
  "info": {
    "title": "SWMM Stormwater Analyzer: Flooding, Capacity, Design Storms",
    "description": "Run EPA SWMM 5.2 stormwater and sewer models (.inp) under their own rain or NOAA Atlas 14 design storms (NRCS nested). Get flooded nodes, surcharge, undersized pipes, level of service across storms, flood maps, HGL profiles, CSV, Excel, GeoJSON.",
    "version": "0.1",
    "x-build-id": "zUEcijbYVKDvdda8S"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jumblemog~swmm-stormwater-analyzer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jumblemog-swmm-stormwater-analyzer",
        "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/jumblemog~swmm-stormwater-analyzer/runs": {
      "post": {
        "operationId": "runs-sync-jumblemog-swmm-stormwater-analyzer",
        "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/jumblemog~swmm-stormwater-analyzer/run-sync": {
      "post": {
        "operationId": "run-sync-jumblemog-swmm-stormwater-analyzer",
        "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": {
          "models": {
            "title": "Models: links or example names",
            "type": "array",
            "description": "One model per line. A link to an EPA SWMM 5 .inp file (as SWMM, PCSWMM, InfoSWMM, XPSWMM's SWMM export and the QGIS plugins save them), a ZIP archive or a GitHub folder holding .inp files with the rainfall files they read (add #ex3 to take only the files whose path holds ex3), a GitHub or GitLab file page, Google Drive or Dropbox. Or an example from EPA's SWMM Applications Manual by name: Example1 to Example9 (Example2 surface drainage, Example3 a detention pond, Example4 low impact development, Example7 dual drainage, Example8 a combined sewer with a pump station, Example9 a 10-year continuous simulation).",
            "items": {
              "type": "string"
            }
          },
          "upload": {
            "title": "Or upload an .inp file",
            "type": "string",
            "description": "A SWMM .inp file, or a ZIP of models with the rainfall and other files they read, from your computer; analysed together with the models above."
          },
          "inpText": {
            "title": "Or paste an .inp file",
            "type": "string",
            "description": "The text of a SWMM input file: [OPTIONS], [RAINGAGES], [SUBCATCHMENTS], [JUNCTIONS], [OUTFALLS], [CONDUITS], [XSECTIONS] and the other sections."
          },
          "storms": {
            "title": "Storms to run",
            "type": "array",
            "description": "Each model runs once per storm (up to 20). \"model\": the model's own rainfall as it stands. A return period and duration, like \"25-year 24-hour\", \"100 yr 6 hr\" or \"2-year 30-minute\": the depth from NOAA Atlas 14 at the location below, laid out as an NRCS nested storm. A depth and duration, like \"3.5 in 24 h\" or \"90 mm 6 hours\". The name of one of the model's own rainfall time series, or \"all series\" for each of them. Empty: the model's own rainfall. With two or more storms you also get which storm floods each node first (level of service).",
            "items": {
              "type": "string"
            }
          },
          "location": {
            "title": "Site location (latitude, longitude)",
            "type": "string",
            "description": "Decimal degrees, like \"39.96, -83.00\", for NOAA Atlas 14 rainfall depths (most of the United States and its territories). Needed for storms given as a return period; with depth storms, it also gives the site's own storm shape and the closest return period of the depth."
          },
          "stormDistribution": {
            "title": "Storm shape",
            "enum": [
              "auto",
              "nrcs-site",
              "nrcs-type-ii",
              "uniform"
            ],
            "type": "string",
            "description": "How a design storm's depth is spread over its duration, in 6-minute steps (5, 3, 2 or 1 minute when the duration needs it). The nested storms put each shorter duration's depth in its centre, so a 24-hour storm holds the 1-hour and 6-hour depths of the same return period. Longer than 24 hours: the 24-hour storm sits in the middle with the rest spread evenly.",
            "default": "auto"
          },
          "afterStormHours": {
            "title": "Hours to keep running after a design storm",
            "minimum": 0,
            "maximum": 720,
            "type": "number",
            "description": "Design storms start at the model's start time and the run goes on this long after the rain ends, so ponds drain and peaks pass the outfalls.",
            "default": 24
          },
          "rainfallMultiplier": {
            "title": "Rainfall multiplier",
            "minimum": 0.01,
            "maximum": 10,
            "type": "number",
            "description": "Scales all rainfall (SWMM's rainfall adjustment), such as 1.2 for a climate change allowance of 20%. Empty: as given."
          },
          "maxVelocity": {
            "title": "Maximum velocity",
            "type": "string",
            "description": "Conduits faster than this are flagged for scour: 10 ft/s or 3 m/s. A bare number is in ft/s for US models, m/s for metric ones. Empty: 10 ft/s or 3 m/s."
          },
          "minVelocity": {
            "title": "Self-cleansing velocity",
            "type": "string",
            "description": "Conduits that carry flow but never reach this are flagged (sediment can settle): 2 ft/s or 0.6 m/s. Empty: 2 ft/s or 0.6 m/s."
          },
          "minFreeboard": {
            "title": "Minimum freeboard",
            "type": "string",
            "description": "Manholes whose highest water level comes within this of the rim without flooding are flagged: 1 ft or 0.3 m. Empty: 1 ft or 0.3 m."
          },
          "profile": {
            "title": "Profile path",
            "type": "string",
            "description": "The nodes the water level profile follows: two node IDs, like \"J1 to O1\" (the path between them), or a list of IDs in order. Empty: the main line, from the outfall with the most flow up along the biggest flows."
          },
          "outputs": {
            "title": "Files to make",
            "type": "array",
            "description": "Files saved per model and storm in the run's key-value store, linked from each dataset row.",
            "items": {
              "type": "string",
              "enum": [
                "pictures",
                "tables",
                "excel",
                "geojson",
                "report",
                "inp"
              ],
              "enumTitles": [
                "Pictures: flood map, water level profile, the storm over time (and the level-of-service map)",
                "CSV tables: nodes, links, subcatchments",
                "Excel workbook: summary, findings, every table, the design storm and the system over time",
                "GeoJSON of the system with its results (in the model's own coordinates)",
                "SWMM's own report (.rpt)",
                "The .inp file that ran (with the design storm in it)"
              ]
            },
            "default": [
              "pictures",
              "tables",
              "excel",
              "geojson",
              "report",
              "inp"
            ]
          },
          "timeLimitSeconds": {
            "title": "Time limit (seconds)",
            "minimum": 60,
            "maximum": 3300,
            "type": "integer",
            "description": "The whole run stops by then. A simulation still running at the limit stops where it is, and its tables cover the part that ran. Large models and long continuous runs may need more.",
            "default": 600
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}