Skip to content

Sam-2604/medication-guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Medication Guide (Web)

A browser-based drug information lookup tool. Enter any U.S.-approved medicine and read its purpose, dosage, ingredients, warnings, and drug interactions — pulled live from the FDA's official label database and cleaned up for plain reading.

Description

This is a rewrite of my CS50P final project - originally a Python CLI tool - as a self-contained web tool designed to live on my personal website.

The Python version is still useful for batch processing into CSV reports from the terminal. The web version prioritises in-browser readability with no setup required. A visitor opens the page, types in one or more brand names, and reads the official FDA label content rendered as readable cards.

Both versions share the same goal: filter out the dense clinical documentation intended for healthcare providers and surface only the parts a non-medical person actually wants to know.

Features

  • In-browser lookup: type any U.S. brand name, get the official FDA label
  • Multi-medicine batch entry via chip-style input
  • Two toggleable categories: Medicine Info (purpose, dosage, ingredients) and Caution Info (warnings, drug interactions, pregnancy advice)
  • Live data cleaning: strips invisible characters, repeated section headers, duplicate sentences, and other FDA formatting quirks
  • Long fields auto-collapse with a "Show more" toggle (threshold roughly 6 lines)
  • Two CSV downloads: a narrow machine-readable format and a vertical human-readable format
  • Mobile-optimised; works the same on phone, tablet, and desktop
  • Single self-contained HTML file, no build step, no dependencies

Requirements

  • A modern browser (Chrome, Safari, Firefox, Edge)
  • An internet connection to reach api.fda.gov

That's it. No installation, no Python, no API key.

Local Development

Open a terminal in the project folder and run:

python3 -m http.server 8000

Then visit http://localhost:8000/index.html in your browser.

Note: double-clicking the HTML file directly will not work reliably. Browsers block API calls from file:// URLs as a security measure, so the local server is required for testing.

Deployment

The file is deployed as a static page on Vercel as part of my personal site. Pushing to the main branch triggers an automatic redeploy.

Fields Returned

Medicine Info: Brand Name, Generic Name, Route, Product Type, Active Ingredient, Purpose, Indications, Dosage

Caution Info: Warnings, Do Not Use, Ask Doctor, Pregnancy, Stop Use, Drug Interactions

These are hand-picked from the openFDA response based on what a non-medical user is most likely to want. Fields like Clinical Pharmacology, Adverse Reactions, and Description are deliberately excluded as they target healthcare providers.

API

Uses the openFDA Drug Label API (https://open.fda.gov/apis/drug/label/). No API key required. Rate limits are 240 requests per minute and 1000 per day per IP - well above what any normal user would hit.

Technical Design Decisions

See TECHNICAL.md for a plain-language explanation of the architecture decisions, including why this is client-side JavaScript and how the text-cleaning logic works.

Limitations

  • Database Scope: U.S. FDA database only. Indian brands (Dolo 650, Cetzine, Zedex, etc.) and other non-U.S. medications will not be found.
  • Data Variability: Some prescription labels return only a subset of fields. The tool gracefully shows "no data on the FDA label for this section" where appropriate.
  • Brand Sensitivity: Generic search terms may occasionally return broader results despite validation. The tool always shows which specific brand label was matched.
  • Source Data Quirks: A small number of FDA labels contain genuine typos or near-duplicate sentences that the cleaner cannot resolve without risking false positives. Rare and minor.

Disclaimer

IMPORTANT: This tool is for informational purposes only. It is based on publicly available U.S. FDA information. Do not make medical decisions based on this report. Always consult a qualified physician or pharmacist before taking any action regarding your medication.

Author

Samarth Goradia

About

Look up any U.S.-approved medicine and read its purpose, ingredients, and warnings exactly as printed on the official FDA label. Add one or more medicines and the tool fetches each label, cleans it up, and lays it out as readable side-by-side cards.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors