{
  "openapi": "3.0.1",
  "info": {
    "title": "openFDA Drug Labels Search: SPL Product Labeling",
    "description": "Search openFDA Structured Product Labeling by keyword, brand or generic name, manufacturer, NDC, product type, route and date. Output is compact: chosen sections, with long text trimmed. Unofficial, not affiliated with or endorsed by the FDA.",
    "version": "0.1",
    "x-build-id": "ngPuFPb3NEdje4duW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fecklesspleb~openfda-drug-labels-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fecklesspleb-openfda-drug-labels-search",
        "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/fecklesspleb~openfda-drug-labels-search/runs": {
      "post": {
        "operationId": "runs-sync-fecklesspleb-openfda-drug-labels-search",
        "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/fecklesspleb~openfda-drug-labels-search/run-sync": {
      "post": {
        "operationId": "run-sync-fecklesspleb-openfda-drug-labels-search",
        "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": {
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Optional. Text matched against openFDA's searchable fields (brand name, generic name, section text and others). Leave empty to list recent labels for the selected filters."
          },
          "brandName": {
            "title": "Brand name",
            "type": "string",
            "description": "Optional. Only labels whose openFDA brand name matches this text."
          },
          "genericName": {
            "title": "Generic name",
            "type": "string",
            "description": "Optional. Only labels whose openFDA generic name matches this text."
          },
          "manufacturerName": {
            "title": "Manufacturer name",
            "type": "string",
            "description": "Optional. Only labels whose openFDA manufacturer name matches this text."
          },
          "productNdc": {
            "title": "Product NDC",
            "type": "string",
            "description": "Optional. Product NDC in the openFDA annotation."
          },
          "productType": {
            "title": "Product type",
            "type": "string",
            "description": "Optional. For example HUMAN OTC DRUG or HUMAN PRESCRIPTION DRUG."
          },
          "route": {
            "title": "Route",
            "type": "string",
            "description": "Optional. Route of administration, for example ORAL or TOPICAL."
          },
          "sections": {
            "title": "Label sections",
            "type": "array",
            "description": "Optional. Which SPL section fields to include (for example boxed_warning, indications_and_usage, warnings). Empty means the compact default set listed in the README. Unlisted sections are omitted. Table fields (names ending in _table) are included only if you name them here.",
            "items": {
              "type": "string"
            }
          },
          "maxSectionChars": {
            "title": "Max characters per section",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Trim each chosen section to this many characters (an ASCII '...' is appended when trimmed). 0 means do not trim. Default 2,000. Maximum 20,000. boxed_warning and contraindications are never trimmed.",
            "default": 2000
          },
          "dateField": {
            "title": "Date field",
            "enum": [
              "effective_time"
            ],
            "type": "string",
            "description": "Which date the date range and the newest/oldest sort use. The label endpoint documents effective_time.",
            "default": "effective_time"
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Optional. Inclusive start of the date range (YYYY-MM-DD)."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Optional. Inclusive end of the date range (YYYY-MM-DD)."
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Order by effective_time. Default is newest first.",
            "default": "newest"
          },
          "maxItems": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 25000,
            "type": "integer",
            "description": "Stop after this many records are saved (up to 25,000). openFDA skip/limit paging allows a skip of at most 25,000 (https://open.fda.gov/apis/query-parameters/).",
            "default": 10
          },
          "onlyNew": {
            "title": "Only new records",
            "type": "boolean",
            "description": "When true, returns only records not seen in previous runs, identified by id, set_id and version and stored in a named key-value store. Off by default. Use stateKey to keep more than one independent list.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Optional. Name of the seen-record list used when onlyNew is true (letters, digits, hyphen and underscore). Default is default."
          },
          "apiKey": {
            "title": "openFDA API key (optional, recommended)",
            "type": "string",
            "description": "Your own free openFDA API key (https://open.fda.gov/apis/authentication/). Without it, limits are 240 requests per minute and 1,000 per day per IP address, shared on Apify IPs. With a key, the daily limit is 120,000 requests per key. Stored encrypted, sent only as the api_key query parameter, never logged or saved. There is no team key."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}