Rx Overview
The Rx API allows you to search for medications, retrieve detailed drug information, and compare drug prices across different pharmacies. The API provides a comprehensive workflow for medication discovery and price comparison.
Architecture
The Rx API follows a three-step workflow:
- Search for Drugs: Use
searchto find medications by name (brand or generic) - Get Drug Details: Use
get-drug-detailsto retrieve comprehensive information about a specific drug - Compare Drug Prices: Use
drug-compareto compare prices across pharmacies using GoodRx integration
Each step builds upon the previous one, allowing you to progressively refine your medication search and price comparison.
Workflow
The typical workflow for using the Rx API is:
Key Concepts
Drug Search
The search endpoint uses fuzzy matching to find medications:
- Brand Drugs: Medications sold under brand names (e.g., "Lipitor", "Advil")
- Generic Drugs: Medications sold under their generic names (e.g., "atorvastatin", "ibuprofen")
- Similarity Scoring: Results are ranked by similarity score, with brand drugs prioritized
- Result Limit: Returns up to 10 matching drugs, sorted by relevance
Drug Details
The drug details endpoint provides comprehensive information:
- Brand Information: Brand name, description, website, images
- Generic Information: Generic name and associated brand names
- Safety Links: Links to safety information and prescription details
- Savings Links: Links to savings programs and coupons
- URL Normalization: All URLs are automatically normalized with
https://prefix
Price Comparison
The drug compare endpoint integrates with GoodRx to provide:
- Price Comparison: Compare prices across multiple pharmacies
- Location-Based: Prices vary by location (zipcode)
- Form and Dosage: Compare specific drug forms (tablet, capsule, etc.) and dosages
- Quantity Options: Compare prices for different quantities
- Pharmacy Types: Includes both retail and mail-order pharmacies
- Coupon Information: Provides coupon URLs and keys for additional savings
Brand vs Generic
- Brand Drugs: Original medications with patent protection
- Generic Drugs: Equivalent medications with the same active ingredients
- Price Differences: Generic drugs are typically less expensive
- Search Results: Both brand and generic drugs are returned in search results
Use Cases
The Rx API is used to:
- Search for medications by name (brand or generic)
- Retrieve detailed drug information including descriptions and links
- Compare drug prices across different pharmacies
- Find the best prices for specific medications
- Get coupon information for additional savings
- Support medication discovery and price transparency
Next Steps
- Search API - Search for medications by name
- Get Drug Details API - Retrieve detailed drug information
- Drug Compare API - Compare drug prices across pharmacies
- API Guidelines - General API response formats and error codes