biocontext_kb.core.openfda#
Functions#
|
Count unique values in a field across FDA-approved drugs. Useful for statistical analysis. |
|
Get available pharmacologic classes from FDA database. Call this first to see available options. |
|
Get detailed information about an FDA-approved drug by application number. Format: NDA/ANDA/BLA followed by 6 digits. |
|
Get comprehensive drug labeling information from FDA. Includes active ingredients, dosage forms, administration routes. |
Get general statistics about the FDA Drugs@FDA database. Includes top sponsors, dosage forms, routes, marketing status. |
|
|
Find generic equivalents for a brand name drug. Searches ANDA entries with matching active ingredients. |
|
Search for drugs by therapeutic or pharmacologic class. Use get_available_pharmacologic_classes() first for exact terms. |
|
Search FDA Drugs@FDA database for approved drug products. Supports multiple search criteria. |
Package Contents#
- biocontext_kb.core.openfda.count_drugs_by_field(field, search_filter=None, limit=100)#
Count unique values in a field across FDA-approved drugs. Useful for statistical analysis.
- Returns:
Results array with term and count for each unique value or error message.
- Return type:
- Parameters:
field (Annotated[str, Field(description="Field to count (e.g., 'sponsor_name', 'products.dosage_form', 'products.route', 'openfda.pharm_class_epc')")])
search_filter (Annotated[Optional[str], Field(description='Optional search filter to apply before counting')])
limit (Annotated[int, Field(description='Maximum number of count results to return', ge=1, le=1000)])
- biocontext_kb.core.openfda.get_available_pharmacologic_classes(class_type='epc', limit=100)#
Get available pharmacologic classes from FDA database. Call this first to see available options.
- Returns:
Class type, field, available_classes array with term/count, total_found or error message.
- Return type:
- Parameters:
- biocontext_kb.core.openfda.get_drug_by_application_number(application_number)#
Get detailed information about an FDA-approved drug by application number. Format: NDA/ANDA/BLA followed by 6 digits.
- biocontext_kb.core.openfda.get_drug_label_info(brand_name=None, generic_name=None, ndc=None)#
Get comprehensive drug labeling information from FDA. Includes active ingredients, dosage forms, administration routes.
- Returns:
Drug label results with indications, warnings, dosage, active ingredients or error message.
- Return type:
- Parameters:
- biocontext_kb.core.openfda.get_drug_statistics()#
Get general statistics about the FDA Drugs@FDA database. Includes top sponsors, dosage forms, routes, marketing status.
- Returns:
Top sponsors, dosage_forms, administration_routes, marketing_statuses with counts or error message.
- Return type:
- biocontext_kb.core.openfda.get_generic_equivalents(brand_name)#
Find generic equivalents for a brand name drug. Searches ANDA entries with matching active ingredients.
- biocontext_kb.core.openfda.search_drugs_by_therapeutic_class(therapeutic_class, class_type='epc', limit=25)#
Search for drugs by therapeutic or pharmacologic class. Use get_available_pharmacologic_classes() first for exact terms.
- Returns:
FDA drug results array with application info, products, sponsor names or error message.
- Return type:
- Parameters:
therapeutic_class (Annotated[str, Field(description='Exact therapeutic/pharmacologic class term from FDA (use get_available_pharmacologic_classes first)')])
class_type (Annotated[str, Field(description="Class type: 'epc' (Established Pharmacologic Class), 'moa' (Mechanism of Action), 'pe' (Physiologic Effect), or 'cs' (Chemical Structure)")])
limit (Annotated[int, Field(description='Number of results to return', ge=1, le=1000)])
- biocontext_kb.core.openfda.search_drugs_fda(brand_name=None, generic_name=None, active_ingredient=None, sponsor_name=None, application_number=None, marketing_status=None, dosage_form=None, route=None, search_type='or', sort_by=None, limit=25, skip=0)#
Search FDA Drugs@FDA database for approved drug products. Supports multiple search criteria.
- Returns:
Results array with drug products including application numbers, sponsors, products array or error message.
- Return type:
- Parameters:
brand_name (Annotated[Optional[str], Field(description="Brand or trade name (e.g., 'Tylenol')")])
generic_name (Annotated[Optional[str], Field(description="Generic name (e.g., 'acetaminophen')")])
active_ingredient (Annotated[Optional[str], Field(description='Active ingredient name')])
sponsor_name (Annotated[Optional[str], Field(description='Company/sponsor name')])
application_number (Annotated[Optional[str], Field(description='FDA application number (NDA, ANDA, or BLA)')])
marketing_status (Annotated[Optional[str], Field(description="Marketing status: 'Prescription', 'Over-the-counter', 'Discontinued', or 'None (Tentative Approval)'")])
dosage_form (Annotated[Optional[str], Field(description="Dosage form (e.g., 'TABLET', 'INJECTION', 'CAPSULE')")])
route (Annotated[Optional[str], Field(description="Route of administration (e.g., 'ORAL', 'INJECTION', 'TOPICAL')")])
search_type (Annotated[str, Field(description="'and' for all terms must match, 'or' for any term matches")])
sort_by (Annotated[Optional[str], Field(description="Field to sort by (e.g., 'sponsor_name', 'application_number')")])
limit (Annotated[int, Field(description='Number of results to return', ge=1, le=1000)])
skip (Annotated[int, Field(description='Number of results to skip for pagination', ge=0, le=25000)])