{
  "openapi": "3.0.1",
  "info": {
    "title": "USGS Earthquake API: Watch & Export Earthquakes by Region",
    "description": "Earthquakes from the USGS earthquake catalog (FDSN event API) by time window, magnitude and region, or only new and changed earthquakes since your last run. Never charged for failed or unchanged rows. Not affiliated with or endorsed by the USGS.",
    "version": "0.1",
    "x-build-id": "bNCxonOWyjXoznWE0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mouadapi~usgs-earthquakes/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mouadapi-usgs-earthquakes",
        "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/mouadapi~usgs-earthquakes/runs": {
      "post": {
        "operationId": "runs-sync-mouadapi-usgs-earthquakes",
        "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/mouadapi~usgs-earthquakes/run-sync": {
      "post": {
        "operationId": "run-sync-mouadapi-usgs-earthquakes",
        "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": {
          "minMagnitude": {
            "title": "Minimum magnitude",
            "minimum": -1,
            "maximum": 10,
            "type": "number",
            "description": "Only earthquakes of at least this magnitude (USGS minmagnitude).",
            "default": 4.5
          },
          "daysBack": {
            "title": "Window (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Earthquakes from the last N days (UTC dates). Ignored when a start date is given. Watch mode reads the same window and returns only new and changed earthquakes.",
            "default": 7
          },
          "dateFrom": {
            "title": "Start date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Optional start date, YYYY-MM-DD (UTC), e.g. 2026-09-01. Overrides the window."
          },
          "dateTo": {
            "title": "End date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Optional end date, YYYY-MM-DD (UTC). Empty: up to now."
          },
          "minLatitude": {
            "title": "Rectangle: south edge (latitude)",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Rectangle: give all four edges (minLatitude, maxLatitude, minLongitude, maxLongitude). Not together with a circle."
          },
          "maxLatitude": {
            "title": "Rectangle: north edge (latitude)",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Rectangle: northern edge, -90 to 90."
          },
          "minLongitude": {
            "title": "Rectangle: west edge (longitude)",
            "minimum": -360,
            "maximum": 360,
            "type": "number",
            "description": "Rectangle: western edge, -360 to 360 (a rectangle may cross the date line)."
          },
          "maxLongitude": {
            "title": "Rectangle: east edge (longitude)",
            "minimum": -360,
            "maximum": 360,
            "type": "number",
            "description": "Rectangle: eastern edge, -360 to 360."
          },
          "latitude": {
            "title": "Circle: centre latitude",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Circle: give latitude, longitude and radius together. Not together with a rectangle."
          },
          "longitude": {
            "title": "Circle: centre longitude",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "Circle: centre longitude, -180 to 180."
          },
          "radiusKm": {
            "title": "Circle: radius (km)",
            "minimum": 0.1,
            "maximum": 20001.6,
            "type": "number",
            "description": "Circle: radius in kilometres, up to 20001.6."
          },
          "eventIds": {
            "title": "Event IDs",
            "type": "array",
            "description": "Optional: USGS event IDs to look up one by one (e.g. us6000tymj), besides the search. An ID the catalog doesn't have gives one free no_data row.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "watch",
              "export"
            ],
            "type": "string",
            "description": "Empty: watch when a watch list name is given, otherwise export. \"watch\" returns only earthquakes that are new or changed since the last run of the watch list; \"export\" returns every earthquake. An explicit mode wins."
          },
          "stateName": {
            "title": "Watch list name",
            "type": "string",
            "description": "Name of your watch list (kept in your own storage between runs). Giving a name turns on watch mode. Watch mode without a name uses the list \"default\"."
          },
          "includeUnchanged": {
            "title": "Include unchanged earthquakes (free)",
            "type": "boolean",
            "description": "Watch mode: also return earthquakes that did not change, as free rows.",
            "default": false
          },
          "maxItems": {
            "title": "Max charged earthquakes",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Most earthquakes returned and charged per run (at most 1,000). In watch mode the rest come in the next run.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}