{
  "openapi": "3.0.1",
  "info": {
    "title": "openFDA NDC Directory Search: Listed Drug Products",
    "description": "Search the openFDA National Drug Code directory by keyword, brand or generic name, labeler, NDC, product type, dosage form, route, marketing category and date. Unofficial, not affiliated with or endorsed by the FDA.",
    "version": "0.1",
    "x-build-id": "yDWv1wyhQoMEDPWYx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fecklesspleb~openfda-ndc-directory-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fecklesspleb-openfda-ndc-directory-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-ndc-directory-search/runs": {
      "post": {
        "operationId": "runs-sync-fecklesspleb-openfda-ndc-directory-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-ndc-directory-search/run-sync": {
      "post": {
        "operationId": "run-sync-fecklesspleb-openfda-ndc-directory-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, labeler and others). Leave empty to list recent listings for the selected filters."
          },
          "brandName": {
            "title": "Brand name",
            "type": "string",
            "description": "Optional. Only records whose brand (trade) name matches this text."
          },
          "genericName": {
            "title": "Generic name",
            "type": "string",
            "description": "Optional. Only records whose generic name matches this text."
          },
          "labelerName": {
            "title": "Labeler name",
            "type": "string",
            "description": "Optional. Only records whose labeler name matches this text."
          },
          "productNdc": {
            "title": "Product NDC",
            "type": "string",
            "description": "Optional. Labeler and product code segments of the NDC, separated by a hyphen (for example 76147-235)."
          },
          "productType": {
            "title": "Product type",
            "type": "string",
            "description": "Optional. For example HUMAN OTC DRUG or HUMAN PRESCRIPTION DRUG."
          },
          "dosageForm": {
            "title": "Dosage form",
            "type": "string",
            "description": "Optional. For example TABLET, CREAM or INJECTION."
          },
          "route": {
            "title": "Route",
            "type": "string",
            "description": "Optional. Route of administration, for example ORAL or TOPICAL."
          },
          "marketingCategory": {
            "title": "Marketing category",
            "type": "string",
            "description": "Optional. For example NDA, ANDA, OTC MONOGRAPH DRUG or BLA."
          },
          "dateField": {
            "title": "Date field",
            "enum": [
              "marketing_start_date",
              "listing_expiration_date"
            ],
            "type": "string",
            "description": "Which date the date range and the newest/oldest sort use.",
            "default": "marketing_start_date"
          },
          "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 the selected date field. 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 product_id (or product_ndc and spl_id) 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}