{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA Medical Device Recall Search",
    "description": "FDA Medical Device Recall Search queries the U.S. Food and Drug Administration's openFDA device enforcement endpoint to retrieve detailed, structured data about medical device recalls.",
    "version": "1.6",
    "x-build-id": "BrbdAKpb8aFvkkzea"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~fda-device-recalls/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-fda-device-recalls",
        "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/ryanclinton~fda-device-recalls/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-fda-device-recalls",
        "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/ryanclinton~fda-device-recalls/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-fda-device-recalls",
        "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": {
          "outputMode": {
            "title": "Output Mode",
            "enum": [
              "records",
              "aggregation",
              "dashboard",
              "executive"
            ],
            "type": "string",
            "description": "How results are returned. 'records' returns one triaged row per recall. 'aggregation' returns count buckets (top firms / product codes / years). 'dashboard' returns a single compact digest object (headline risk, active counts, risk tiers, clusters, top firms, trends) ideal for BI tools, Dify, and n8n.",
            "default": "records"
          },
          "aggregateBy": {
            "title": "Aggregate By (aggregation mode only)",
            "enum": [
              "recalling_firm.exact",
              "product_code.exact",
              "event_date_initiated.year",
              "country"
            ],
            "type": "string",
            "description": "Field to group recalls by when Output Mode is 'aggregation'. Returns one row per bucket with {term, count, share}. Ignored when Output Mode is 'records'.",
            "default": "recalling_firm.exact"
          },
          "keyword": {
            "title": "Keyword Search",
            "type": "string",
            "description": "Search in product descriptions and reason for recall (e.g. 'pacemaker', 'insulin pump', 'hip implant')",
            "default": "pacemaker"
          },
          "recallingFirm": {
            "title": "Recalling Firm",
            "type": "string",
            "description": "Filter by company name (e.g. 'Medtronic', 'Abbott', 'Philips')"
          },
          "classification": {
            "title": "Classification",
            "enum": [
              "Class I",
              "Class II",
              "Class III"
            ],
            "type": "string",
            "description": "Recall class (I = most serious, II = moderate, III = least serious)"
          },
          "status": {
            "title": "Status",
            "enum": [
              "Ongoing",
              "Completed",
              "Terminated"
            ],
            "type": "string",
            "description": "Filter by recall status"
          },
          "state": {
            "title": "State",
            "type": "string",
            "description": "Filter by US state (two-letter code, e.g. CA, NY, TX)"
          },
          "dateFrom": {
            "title": "Date From",
            "type": "string",
            "description": "Recall initiation date from (YYYY-MM-DD)"
          },
          "dateTo": {
            "title": "Date To",
            "type": "string",
            "description": "Recall initiation date to (YYYY-MM-DD)"
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of recalls (records mode) or buckets (aggregation mode) to return.",
            "default": 100
          },
          "watchlistName": {
            "title": "Watchlist Name (optional, records & dashboard modes)",
            "type": "string",
            "description": "Leave blank for a one-off search. Set a name (e.g. 'cardiac-devices' or 'medtronic') to turn on cross-run change tracking: the actor remembers recalls it has seen under this name and tags each record with a changeFlag (NEW, ESCALATED, RISK_INCREASED, RESOLVED, STATUS_CHANGED, REINSTATED, UNCHANGED) plus the previous status/class/risk score. Run the same watchlist on a schedule to be alerted only on what changed since last time. Each name keeps its own independent history."
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Filter by the recalling firm's country (e.g. 'United States'). Server-side openFDA filter."
          },
          "activeOnly": {
            "title": "Active recalls only",
            "type": "boolean",
            "description": "When true, only Ongoing (unresolved) recalls are emitted.",
            "default": false
          },
          "minimumRiskScore": {
            "title": "Minimum Risk Score (0-100)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Drop recalls below this deterministic risk score from the output (and from billing). 0 = keep all."
          },
          "reasonCategoryFilter": {
            "title": "Failure-mode filter",
            "type": "array",
            "description": "Keep only recalls whose derived reasonCategory is in this list (e.g. software, sterility, mechanical).",
            "items": {
              "type": "string"
            }
          },
          "riskTierFilter": {
            "title": "Risk-tier filter",
            "type": "array",
            "description": "Keep only recalls in these risk tiers: extreme, high, moderate, low.",
            "items": {
              "type": "string"
            }
          },
          "distributionContains": {
            "title": "Distribution contains",
            "type": "string",
            "description": "Keep only recalls whose distribution pattern contains this substring (e.g. 'worldwide', 'CA')."
          },
          "inventory": {
            "title": "Device inventory (records mode)",
            "type": "array",
            "description": "Optional list of device names, models, or lot/serial codes you own. Each returned recall is tagged with the inventory items it matches (inventoryMatches), and the summary reports how many of your items appear in recalls. Deterministic token matching — no AI.",
            "items": {
              "type": "string"
            }
          },
          "includeFirmProfiles": {
            "title": "Manufacturer profiles",
            "type": "boolean",
            "description": "When true, emit a 12-month recall profile (total / Class I / active counts, risk trend, repeat failure modes) for the top firms in the result set.",
            "default": false
          },
          "includeTrendAnalysis": {
            "title": "Year-over-year trends",
            "type": "boolean",
            "description": "When true, add year-over-year trend signals (total and Class I recall counts, last 365 days vs prior 365 days) to the summary / dashboard.",
            "default": false
          },
          "includeAdverseEvents": {
            "title": "Manufacturer adverse-event signal (MAUDE)",
            "type": "boolean",
            "description": "When true (with manufacturer profiles), add a firm-wide adverse-event trend from the FDA MAUDE database to each profile. Manufacturer-level only (not device-specific) and MAUDE data lags ~3-6 months, so windows are lag-buffered. Costs extra openFDA queries.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}