💊 RxSnap API
AI-powered medicine identification and drug interaction checking for developers.
v1.0 · REST API 🔒 HIPAA Compliant 🏛️ FDA-Data Powered

Getting Started

The RxSnap API lets you integrate AI-powered medicine identification and drug interaction checking into your healthcare application. All endpoints return JSON.

📬
To get an API key, contact us at api@rxsnap.app with your company name and use case. Keys are issued within 24 hours.

Base URL

https://your-deployment-url.com

Request Format

The /api/analyze endpoint accepts multipart/form-data (for image upload). The /api/interactions endpoint accepts application/json. All requests must include your API key in the x-api-key header.

Authentication

Every request to a protected endpoint must include your API key in the x-api-key HTTP header.

HTTP Header
x-api-key: pp_live_your_api_key_here
⚠️
Never expose your API key in client-side code or public repositories. Always call the RxSnap API from your backend server.

Key Format

All RxSnap API keys follow the format pp_live_ followed by 24 hexadecimal characters — e.g. pp_live_a3f9c2d1e8b047...

POST /api/analyze

Identify a medicine from an image. Returns structured medicine information including generic alternatives, food interactions, and FDA safety data.

POST /api/analyze multipart/form-data

Request Parameters

FieldTypeRequiredDescription
medicine File (image/*) Required Photo of the medicine packaging or pill. JPEG, PNG, or WebP.
conditions JSON string Optional JSON array of patient conditions to check. Values: "high_bp", "low_bp", "diabetes", "thyroid", "kidney"

Example Response

JSON Response — 200 OK
{
  "name": "Metformin HCl",
  "manufacturer": "Sun Pharmaceutical Industries",
  "dosage": "500mg",
  "usage": "Treatment of type 2 diabetes mellitus",
  "confidence": "high",
  "warnings": "Risk of lactic acidosis. Contraindicated in patients with renal impairment...",
  "adverse_reactions": "Diarrhea, nausea, vomiting, flatulence, indigestion, abdominal discomfort...",
  "contraindications": "Contraindicated in patients with renal impairment (eGFR below 30)...",
  "drug_interactions": "Carbonic anhydrase inhibitors may increase the risk of lactic acidosis...",
  "generic_alternatives": [
    "Glycomet 500mg — ₹30–₹50 for 20 tablets",
    "Bigomet 500mg — ₹25–₹45 for 20 tablets",
    "Walaphage 500mg — ₹20–₹40 for 20 tablets"
  ],
  "food_interactions": [
    "Alcohol — increases risk of lactic acidosis when combined with metformin",
    "High-carb meals — may reduce the effectiveness of blood sugar control"
  ],
  "condition_flags": [
    {
      "condition": "diabetes",
      "label": "Diabetes",
      "flagged": false,
      "reason": "No relevant keywords found"
    },
    {
      "condition": "kidney",
      "label": "Kidney",
      "flagged": true,
      "reason": "Found keyword: renal"
    }
  ],
  "disclaimer": "This is general medicine information only and not medical advice. Consult a doctor or pharmacist before making any health decisions."
}

POST /api/interactions

Check for clinically significant drug interactions between two medicines. Returns severity, effects, and a patient recommendation.

POST /api/interactions application/json

Request Body

FieldTypeRequiredDescription
medicine1 string Required Name of the first medicine (brand or generic)
medicine2 string Required Name of the second medicine (brand or generic)
JSON Request Body
{
  "medicine1": "Aspirin",
  "medicine2": "Warfarin"
}

Example Response

JSON Response — 200 OK
{
  "severity": "severe",
  "summary": "Aspirin significantly increases the anticoagulant effect of Warfarin, raising the risk of serious bleeding.",
  "effects": [
    "Increased risk of gastrointestinal bleeding",
    "Prolonged bleeding time and elevated INR levels",
    "Risk of intracranial hemorrhage in elderly patients",
    "Platelet inhibition compounding anticoagulation"
  ],
  "recommendation": "Avoid combining Aspirin with Warfarin unless explicitly directed by your physician; if both are necessary, monitor INR closely and watch for signs of bleeding."
}

Severity Levels

ValueMeaning
noneNo clinically significant interaction found
mildMinor interaction; generally safe with monitoring
moderateSignificant interaction; dosage adjustment may be needed
severeDangerous combination; avoid or use under strict supervision

Rate Limits & Plans

Usage is counted per API key, per calendar month. Limits reset on the 1st of each month. When your limit is exceeded, the API returns a 429 response.

Basic API
$49/mo
 100 API calls / month
 Medicine identification endpoint
 Drug interaction endpoint
 Email support
Get API Key
Most Popular
Pro API
$149/mo
 500 API calls / month
 All endpoints incl. prescription scanner
 Condition-aware side effect flagging
 Priority support
Get API Key
Enterprise API
$499/mo
 Unlimited API calls
 All endpoints
 White-label option
 BAA included
 Dedicated support + SLA
 Custom integrations
Contact Us

All plans billed monthly. Cancel anytime.

View Full Pricing →
💬
Need a custom volume deal or have questions? Email api@rxsnap.app and we'll find the right plan for you.

Error Codes

The API uses standard HTTP status codes. All errors return a JSON body with an error field.

StatusCode / MeaningResolution
400 Bad Request — missing required field Check that all required parameters are included in your request
401 API key required Add the x-api-key header to your request
403 Invalid or inactive API key Verify your key is correct; contact support if recently issued
429 Monthly limit exceeded Upgrade your plan or wait for the monthly reset. Response includes limit and used fields
500 Internal server error Retry after a short delay; contact support if the issue persists

Error Response Format

{
  "error": "Monthly limit exceeded",
  "limit": 500,
  "used": 500
}

Code Examples

Analyze a Medicine — JavaScript (fetch)

JavaScript
const analyzeMedicine = async (imageFile, conditions = []) => {
  const formData = new FormData();
  formData.append('medicine', imageFile);
  formData.append('conditions', JSON.stringify(conditions));

  const response = await fetch('https://your-deployment-url.com/api/analyze', {
    method: 'POST',
    headers: {
      'x-api-key': 'pp_live_your_api_key_here',
    },
    body: formData,
  });

  if (!response.ok) {
    const err = await response.json();
    throw new Error(err.error);
  }

  return response.json();
};

// Usage
const result = await analyzeMedicine(file, ['diabetes', 'kidney']);
console.log(result.name, result.warnings);

Check Drug Interactions — JavaScript (fetch)

JavaScript
const checkInteractions = async (medicine1, medicine2) => {
  const response = await fetch('https://your-deployment-url.com/api/interactions', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-api-key': 'pp_live_your_api_key_here',
    },
    body: JSON.stringify({ medicine1, medicine2 }),
  });

  return response.json();
};

const result = await checkInteractions('Aspirin', 'Warfarin');
console.log(result.severity, result.summary);

Analyze a Medicine — Python (requests)

Python
import requests
import json

def analyze_medicine(image_path, conditions=None):
    url = "https://your-deployment-url.com/api/analyze"
    headers = {"x-api-key": "pp_live_your_api_key_here"}

    with open(image_path, "rb") as img:
        files = {"medicine": img}
        data  = {"conditions": json.dumps(conditions or [])}
        response = requests.post(url, headers=headers, files=files, data=data)

    response.raise_for_status()
    return response.json()

# Usage
result = analyze_medicine("medicine.jpg", conditions=["high_bp", "diabetes"])
print(result["name"], result["dosage"])

Check Drug Interactions — Python (requests)

Python
import requests

def check_interactions(medicine1, medicine2):
    url     = "https://your-deployment-url.com/api/interactions"
    headers = {
        "Content-Type": "application/json",
        "x-api-key": "pp_live_your_api_key_here",
    }
    payload = {"medicine1": medicine1, "medicine2": medicine2}

    response = requests.post(url, headers=headers, json=payload)
    response.raise_for_status()
    return response.json()

# Usage
result = check_interactions("Aspirin", "Ibuprofen")
print(result["severity"], result["recommendation"])