Developer Documentation
Integrate DrugFYI data into your applications. Access drugs, drug classes, biological targets, interactions, side effects, and glossary terms through our JSON APIs and machine-readable endpoints.
API Endpoints
All API endpoints return JSON responses with Content-Type: application/json.
No authentication is required. Free to use. CORS enabled for all origins.
| Endpoint | Description | Cache |
|---|---|---|
GET /api/v1/drugs/ |
List drugs with pagination and filters | 1h |
GET /api/v1/drugs/{slug}/ |
Full drug detail with pharmacology, targets, interactions | 1h |
GET /api/v1/classes/ |
ATC drug classification hierarchy | 1h |
GET /api/v1/classes/{slug}/ |
Drug class detail with hierarchy and member drugs | 1h |
GET /api/v1/families/ |
Drug families with SAR analysis | 1h |
GET /api/v1/conditions/ |
Therapeutic areas / conditions | 1h |
GET /api/v1/targets/ |
Biological drug targets (proteins, enzymes, receptors) | 1h |
GET /api/v1/side-effects/ |
Drug side effects with MedDRA classification | 1h |
GET /api/v1/interactions/ |
Drug-drug interactions with severity | 1h |
GET /api/v1/search/?q= |
Search across 7 entity types | 5m |
GET /api/v1/glossary/ |
Pharmacology glossary terms | 1h |
GET /api/v1/openapi.json |
OpenAPI 3.1.0 specification | - |
Quick Start
Get drug detail
curl -s "https://drugfyi.com/api/v1/drugs/metformin/" | python3 -m json.tool
Search for drugs
curl -s "https://drugfyi.com/api/v1/search/?q=aspirin" | python3 -m json.tool
List interactions for a drug
curl -s "https://drugfyi.com/api/v1/interactions/?drug=warfarin&severity=major" | python3 -m json.tool
List ATC drug classes (level 1)
curl -s "https://drugfyi.com/api/v1/classes/?level=1" | python3 -m json.tool
Pagination
All list endpoints support pagination via page and per_page query parameters.
GET /api/v1/drugs/?page=2&per_page=50
Response includes pagination metadata:
{
"results": [...],
"count": 1250,
"page": 2,
"per_page": 50,
"total_pages": 25
}
AI / LLM Integration
DrugFYI provides machine-readable endpoints optimized for AI agents and LLMs.
/llms.txt
Recommended
Structured site summary for AI crawlers. Includes site purpose, content types, and navigation links.
*.md
Append .md to any page URL to get a Markdown representation.
Example: /drug/aspirin/.md
SEO & Standards
| Endpoint | Standard |
|---|---|
/robots.txt |
Robots Exclusion Protocol |
/sitemap.xml |
Sitemap Protocol (index + per-section) |
/.well-known/security.txt |
RFC 9116 — Security contact |
/llms.txt |
AI/LLM site summary |
JSON-LD |
Schema.org structured data on all pages |
hreflang |
15 languages with alternate links |
OpenAPI Specification
The full API specification is available in OpenAPI 3.1.0 format for code generation and documentation tools.
curl -s "https://drugfyi.com/api/v1/openapi.json" | python3 -m json.tool
Rate Limits & Usage
Free
No API key required
60/min
Recommended rate limit
CORS
All origins allowed
All API responses include Access-Control-Allow-Origin: *.
Responses are cached server-side (1 hour for most endpoints, 5 minutes for search).
Please be considerate with request volume.