{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA Drug Labels Monitor (openFDA SPL JSON)",
    "description": "Return official US FDA data from openFDA as clean JSON in one Actor: drug labels (SPL), food enforcement recalls and drug shortages. Choose dataset=labels|recalls|shortages; filter by keyword, date, classification or status. Public CC0 data, keyless API, pay per event.",
    "version": "0.3",
    "x-build-id": "jrNilptdwyPST5MXq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steadfetch~openfda-drug-labels-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steadfetch-openfda-drug-labels-extractor",
        "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/steadfetch~openfda-drug-labels-extractor/runs": {
      "post": {
        "operationId": "runs-sync-steadfetch-openfda-drug-labels-extractor",
        "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/steadfetch~openfda-drug-labels-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-steadfetch-openfda-drug-labels-extractor",
        "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",
        "required": [
          "dataset"
        ],
        "properties": {
          "dataset": {
            "title": "Dataset",
            "enum": [
              "labels",
              "recalls",
              "shortages"
            ],
            "type": "string",
            "description": "Which openFDA dataset to extract. Labels: US drug label (SPL) records. Recalls: FDA food enforcement recalls. Shortages: FDA drug shortage reports.",
            "default": "labels"
          },
          "labels": {
            "title": "Labels settings",
            "type": "object",
            "description": "Parameters for the drug labels dataset (api.fda.gov/drug/label.json).",
            "properties": {
              "search": {
                "title": "Search query",
                "type": "string",
                "editor": "textfield",
                "description": "OpenFDA search syntax. Example: openfda.brand_name:\"*aspirin*\" or openfda.generic_name:\"SILICEA\".",
                "example": "openfda.generic_name:\"SILICEA\"",
                "prefill": "openfda.generic_name:\"SILICEA\""
              },
              "effective_since": {
                "title": "Effective since",
                "type": "string",
                "editor": "datepicker",
                "description": "Keep labels whose effective_time is on or after this date (YYYY-MM-DD). Use for incremental extractions.",
                "example": "2025-01-01"
              }
            }
          },
          "recalls": {
            "title": "Recalls settings",
            "type": "object",
            "description": "Parameters for the food recalls dataset (api.fda.gov/food/enforcement.json).",
            "properties": {
              "since": {
                "title": "Reported since",
                "type": "string",
                "editor": "datepicker",
                "description": "Inclusive lower bound for the recall report date (YYYY-MM-DD). Defaults to 30 days before until/today.",
                "prefill": "2026-10-01"
              },
              "until": {
                "title": "Reported until",
                "type": "string",
                "editor": "datepicker",
                "description": "Inclusive upper bound for the recall report date (YYYY-MM-DD). Defaults to today (UTC)."
              },
              "classification": {
                "title": "Classification",
                "type": "string",
                "description": "Only return recalls with this FDA classification.",
                "example": "Class I",
                "editor": "select",
                "enum": [
                  "Class I",
                  "Class II",
                  "Class III"
                ]
              },
              "state": {
                "title": "State",
                "type": "string",
                "description": "Only return recalls whose recalling firm is in this two-letter US state code.",
                "editor": "textfield",
                "pattern": "^[A-Za-z]{2}$",
                "example": "FL"
              },
              "keyword": {
                "title": "Keyword",
                "type": "string",
                "description": "Case-insensitive keyword matched against product description, reason for recall and recalling firm.",
                "editor": "textfield",
                "example": "allergen"
              },
              "monitorMode": {
                "title": "Monitor mode (only new recalls)",
                "type": "boolean",
                "description": "When enabled, recalls already delivered by a previous run with the same classification/state/keyword filters are not pushed or charged. Disable for a full backfill.",
                "editor": "checkbox",
                "default": true
              }
            }
          },
          "shortages": {
            "title": "Shortages settings",
            "type": "object",
            "description": "Parameters for the drug shortages dataset (api.fda.gov/drug/shortages.json).",
            "properties": {
              "status": {
                "title": "Status filter",
                "type": "array",
                "items": {
                  "type": "string"
                },
                "editor": "stringList",
                "description": "Keep only records whose status is one of these values. Empty means all. Source values: Current, Resolved, To Be Discontinued.",
                "prefill": []
              },
              "therapeuticCategory": {
                "title": "Therapeutic category filter",
                "type": "array",
                "items": {
                  "type": "string"
                },
                "editor": "stringList",
                "description": "Keep only records tagged with at least one of these therapeutic categories (e.g. Anesthesia, Oncology, Cardiovascular). Matching ignores case. Empty means all.",
                "prefill": []
              },
              "monitorMode": {
                "title": "Monitor mode",
                "type": "boolean",
                "editor": "checkbox",
                "default": false,
                "description": "When enabled, only records that are new or whose status/availability changed since the previous run for the same Apify user are delivered, and each checked record bills one monitor-check event. Leave disabled for a one-off backfill.",
                "prefill": false
              }
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of records delivered to the dataset. Per dataset limits: labels 5,000; recalls 5,000; shortages 20,000. Default 100 keeps the first run quick and cheap; prefill 10.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}