Reasoning
/v1/graphAsk questions about drugs, side effects, interactions, and contraindications in natural language. Get structured drug-condition relationships with complete FDA evidence.
Overview
The Reasoning API enables natural language queries about drug safety using the Lemma Knowledge Graph. Ask questions and receive structured drug-condition relationships with verified FDA evidence.
Unlike the Search API which returns text segments, the Reasoning API returns structured data with explicit relationships between drugs and conditions, complete with severity levels and supporting evidence.
Request Body
questionstringrequiredNatural language question about drugs or drug safety. The system understands various question formats and can handle complex queries.
Response Structure
Success responses follow a standard structure with status: 1, msg, and data containing the actual response payload.
statusintegerResponse status. 1 indicates success.
msgstringStatus message, typically "operation successful".
dataobjectThe actual response data containing graph query results.
querystringEcho of the original question.
resultsarrayArray of drug-condition relationships with FDA evidence.
drugobjectDrug information
namestringGeneric drug name
brand_namesarrayBrand names for the drug
manufacturerstringDrug manufacturer
ndcarrayNational Drug Code identifiers
routearrayAdministration routes (e.g., ORAL, TOPICAL)
relationshipobjectRelationship between drug and condition
typestringRelationship type: "warning", "contraindication", "interaction", "adverse_reaction"
conditionstringMedical condition or effect
severitystringSeverity level: "life_threatening", "serious", "moderate", "mild", or null if not specified
evidencearrayFDA evidence segments supporting this relationship
textstringOriginal FDA label text
fingerprintstring128-bit binary fingerprint for verification
sectionstringFDA label section name
sourceobjectOfficial DailyMed URL
metadataobjectQuery metadata including result count and timing information.
countintegerTotal number of results returned
query_time_msfloatQuery execution time in milliseconds
Use Cases
Error Responses
All error responses follow a standard structure with status: 0, errorCode, and msg fields: