{
  "openapi": "3.0.1",
  "info": {
    "title": "FDA  Orange Book Scraper",
    "description": "Extract FDA Orange Book data — drug patent expirations, exclusivity periods, generic equivalents, and therapeutic equivalence ratings. No API key required.",
    "version": "0.0",
    "x-build-id": "gaYqUfvc3P95oDtii"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/labrat011~fda-orange-book-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-labrat011-fda-orange-book-scraper",
        "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/labrat011~fda-orange-book-scraper/runs": {
      "post": {
        "operationId": "runs-sync-labrat011-fda-orange-book-scraper",
        "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/labrat011~fda-orange-book-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-labrat011-fda-orange-book-scraper",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "🎯 Scraping Mode",
            "enum": [
              "search_products",
              "get_product",
              "search_patents",
              "search_exclusivity"
            ],
            "type": "string",
            "description": "What type of Orange Book data to retrieve.",
            "default": "search_products"
          },
          "ingredient": {
            "title": "💊 Active Ingredient",
            "type": "string",
            "description": "Active ingredient name (e.g., 'atorvastatin', 'metformin', 'adalimumab'). Case-insensitive."
          },
          "tradeName": {
            "title": "🏷️ Trade Name (Brand)",
            "type": "string",
            "description": "Brand or trade name (e.g., 'Lipitor', 'Humira', 'Keytruda'). Case-insensitive."
          },
          "applicant": {
            "title": "🏢 Applicant / Company",
            "type": "string",
            "description": "Company name holding the NDA or ANDA (e.g., 'Pfizer', 'AbbVie', 'Teva'). Partial match supported."
          },
          "applicationNumber": {
            "title": "📋 Application Number",
            "type": "string",
            "description": "NDA or ANDA number (e.g., '020702' for Lipitor, '021977' for Atorvastatin). Required for Get Product mode."
          },
          "patentNumber": {
            "title": "📜 Patent Number",
            "type": "string",
            "description": "US patent number to look up (e.g., '5273995'). Used in Search Patents mode."
          },
          "teCode": {
            "title": "⚗️ Therapeutic Equivalence Code",
            "enum": [
              "",
              "AA",
              "AB",
              "AN",
              "AO",
              "AP",
              "AT",
              "BC",
              "BD",
              "BE",
              "BN",
              "BP",
              "BR",
              "BS",
              "BT",
              "BX"
            ],
            "type": "string",
            "description": "Filter by TE code. AB = substitutable (pharmacist can swap). BX = insufficient data.",
            "default": ""
          },
          "applicationType": {
            "title": "📁 Application Type",
            "enum": [
              "",
              "N",
              "A"
            ],
            "type": "string",
            "description": "Filter by application type. NDA = innovator/brand. ANDA = generic.",
            "default": ""
          },
          "productType": {
            "title": "💉 Product Type",
            "enum": [
              "",
              "RX",
              "OTC",
              "DISCN"
            ],
            "type": "string",
            "description": "Filter by prescription status.",
            "default": ""
          },
          "maxResults": {
            "title": "📊 Max Results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of records to return (1–1,000). Free users are limited to 25 per run.",
            "default": 100
          },
          "requestIntervalSecs": {
            "title": "⏱️ Request Interval (seconds)",
            "minimum": 0.2,
            "maximum": 5,
            "type": "number",
            "description": "Minimum seconds between download requests.",
            "default": 0.5
          },
          "timeoutSecs": {
            "title": "⏳ HTTP Timeout (seconds)",
            "minimum": 30,
            "maximum": 180,
            "type": "integer",
            "description": "Timeout for downloading Orange Book data files (~10 MB each).",
            "default": 60
          },
          "maxRetries": {
            "title": "🔄 Max Retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum retry attempts on failed downloads.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}