{
  "openapi": "3.0.1",
  "info": {
    "title": "Drug Label Diff Tracker (DailyMed)",
    "description": "Watches FDA drug label (SPL) versions on your watchlist via the official NIH/NLM DailyMed API and emits section-level before/after diffs for safety sections (boxed warning, contraindications, warnings & precautions, adverse reactions) with severity heuristics and stable IDs.",
    "version": "1.0",
    "x-build-id": "izX7ccYNfgrO5fVGh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/atlas-data~drug-label-diff-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-atlas-data-drug-label-diff-tracker",
        "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/atlas-data~drug-label-diff-tracker/runs": {
      "post": {
        "operationId": "runs-sync-atlas-data-drug-label-diff-tracker",
        "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/atlas-data~drug-label-diff-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-atlas-data-drug-label-diff-tracker",
        "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": {
          "setids": {
            "title": "SETIDs (DailyMed SPL ids)",
            "maxItems": 100,
            "type": "array",
            "description": "DailyMed SETIDs (UUID-shaped) to watch directly. Find them in the label URL, e.g. dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=…",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "ndcs": {
            "title": "NDC codes",
            "maxItems": 50,
            "type": "array",
            "description": "NDC codes (hyphenated or plain digits). Each is resolved to its DailyMed label(s) via the official search endpoint.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "rxcuis": {
            "title": "RxNorm codes (RxCUI)",
            "maxItems": 50,
            "type": "array",
            "description": "RxNorm RxCUIs (numeric). Ingredient-level codes can match many labels; results are capped per identifier (newest-published first) by 'Resolution cap per identifier'.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Run mode",
            "enum": [
              "incremental",
              "full"
            ],
            "type": "string",
            "description": "incremental: only labels whose current version changed since the last run are re-diffed (a status row is always written per label). full: re-diff every label against its prior version regardless of stored state.",
            "default": "incremental"
          },
          "sections": {
            "title": "Label sections to diff",
            "uniqueItems": true,
            "type": "array",
            "description": "Which LOINC-coded top-level label sections to extract and diff.",
            "items": {
              "type": "string",
              "enum": [
                "boxed_warning",
                "contraindications",
                "warnings_precautions",
                "adverse_reactions",
                "drug_interactions",
                "indications_usage",
                "dosage_administration",
                "overdosage",
                "patient_counseling"
              ],
              "enumTitles": [
                "Boxed warning (34066-1)",
                "Contraindications (34070-3)",
                "Warnings and precautions (43685-7)",
                "Adverse reactions (34084-4)",
                "Drug interactions (34073-7)",
                "Indications and usage (34067-9)",
                "Dosage and administration (34068-7)",
                "Overdosage (34088-5)",
                "Patient counseling information (34076-0)"
              ]
            },
            "default": [
              "boxed_warning",
              "contraindications",
              "warnings_precautions",
              "adverse_reactions"
            ]
          },
          "maxItems": {
            "title": "Maximum dataset records",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper bound on records saved to the dataset this run (status rows + section diffs combined). Labels cut off by this cap are re-checked next run.",
            "default": 200
          },
          "includeDiffLines": {
            "title": "Include diff lines",
            "type": "boolean",
            "description": "Include the capped added/removed text lines in each section diff record (counts and metrics are always included). Disable for leaner output.",
            "default": true
          },
          "maxDiffLinesPerSection": {
            "title": "Max diff lines per section",
            "minimum": 1,
            "maximum": 400,
            "type": "integer",
            "description": "Cap on kept added/removed lines per section diff; excess lines are counted but not stored.",
            "default": 40
          },
          "resolveLimitPerIdentifier": {
            "title": "Resolution cap per identifier",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "When an NDC/RxCUI matches many labels, keep at most this many per identifier (newest-published first, deterministic tiebreak). The full match count stays reported in the run summary.",
            "default": 25
          },
          "minRequestIntervalMs": {
            "title": "Min request interval (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Politeness floor between requests to dailymed.nlm.nih.gov (~1 request/second by default; 0 disables pacing for tests only — not recommended).",
            "default": 1100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}