{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA Adverse Event Monitor",
    "description": "One event per new FDA adverse event report for the drugs or devices you watch: FAERS reports where your drug is the suspect drug, or MAUDE reports for your device, re-checked for precision. Public openFDA source.",
    "version": "0.1",
    "x-build-id": "Iq9LnNlbla2bHbeDr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sovereign_workspace~fda-adverse-event-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sovereign_workspace-fda-adverse-event-monitor",
        "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/sovereign_workspace~fda-adverse-event-monitor/runs": {
      "post": {
        "operationId": "runs-sync-sovereign_workspace-fda-adverse-event-monitor",
        "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/sovereign_workspace~fda-adverse-event-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-sovereign_workspace-fda-adverse-event-monitor",
        "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": {
          "profile": {
            "title": "Operator profile",
            "enum": [
              "standard",
              "smoke"
            ],
            "type": "string",
            "description": "Named config preset applied at start. Any field you set explicitly below overrides the preset."
          },
          "source": {
            "title": "Source",
            "enum": [
              "drug",
              "device"
            ],
            "type": "string",
            "description": "Which FDA adverse event database to watch. FAERS (drugs) loads quarterly and lags about 3 months; MAUDE (devices) loads weekly.",
            "default": "drug"
          },
          "drug_names": {
            "title": "Drugs (FAERS)",
            "type": "array",
            "description": "Brand, generic or active-ingredient names to watch, e.g. metformin, Humira. Whole-word match on one drug in the report. Required for the drug source.",
            "items": {
              "type": "string"
            }
          },
          "suspect_only": {
            "title": "Only where the drug is the suspect drug",
            "type": "boolean",
            "description": "FAERS: count a report only when the watched drug itself is listed as the suspect drug, not a concomitant one. Turn off to include concomitant and interacting roles.",
            "default": true
          },
          "serious_only": {
            "title": "Serious reports only",
            "type": "boolean",
            "description": "FAERS: only reports FDA flags as serious (death, life-threatening, hospitalization, disability, congenital anomaly or other serious).",
            "default": false
          },
          "outcomes": {
            "title": "Serious outcomes (any of)",
            "type": "array",
            "description": "FAERS: only reports with at least one of these outcomes: death, life_threatening, hospitalization, disabling, congenital_anomaly, other_serious.",
            "items": {
              "type": "string"
            }
          },
          "reactions": {
            "title": "Reactions (MedDRA terms, any of)",
            "type": "array",
            "description": "FAERS: only reports listing at least one of these MedDRA preferred terms, exact term, any case, e.g. Lactic acidosis.",
            "items": {
              "type": "string"
            }
          },
          "device_names": {
            "title": "Devices (MAUDE)",
            "type": "array",
            "description": "Brand or generic device names to watch, e.g. Vanta. Whole-word match on one device in the report.",
            "items": {
              "type": "string"
            }
          },
          "manufacturers": {
            "title": "Device manufacturers (MAUDE)",
            "type": "array",
            "description": "Device manufacturer names, e.g. Medtronic. Whole-word match on the same device as the other device filters.",
            "items": {
              "type": "string"
            }
          },
          "product_codes": {
            "title": "FDA product codes (MAUDE)",
            "type": "array",
            "description": "Three-letter FDA device product codes, e.g. LGW. For the device source give at least one of devices, manufacturers or product codes.",
            "items": {
              "type": "string"
            }
          },
          "event_types": {
            "title": "Event types (MAUDE, any of)",
            "type": "array",
            "description": "MAUDE: only reports of these event types: death, injury, malfunction, other.",
            "items": {
              "type": "string"
            }
          },
          "since_days": {
            "title": "Window (days back, by FDA receipt date)",
            "minimum": 1,
            "maximum": 730,
            "type": "integer",
            "description": "How many days back to look, by the date FDA first received the report. FAERS data lags about 3 months, so drug watches need a window of 120 days or more.",
            "default": 120
          },
          "only_new": {
            "title": "Only reports not delivered before",
            "type": "boolean",
            "description": "For scheduled watches: never return (or charge) a report this same watch already returned. Kept in a named key-value store in your account.",
            "default": true
          },
          "limit": {
            "title": "Max reports",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of matched reports to return per run.",
            "default": 100
          },
          "api_key": {
            "title": "openFDA API key (optional)",
            "type": "string",
            "description": "Optional free openFDA key. Without one, openFDA allows 1,000 requests per day per IP, and Apify IPs are shared."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}