GET
https://pill-finder-backend.vercel.app/api/find
Search for medicine information. The API will first check the database for existing information. If not found, it will use AI to generate accurate information about medicines available in Pakistan.
Query Parameters:
name
(required) — The
name of the medicine to search. Must contain only letters,
numbers, and spaces.
Response Fields:
name
— Name of the medicineprice
— Price in PKR (e.g., 'PKR 2995')type
— Type of medicine (e.g., 'tablet', 'syrup',
'capsule')
uses
— Uses of the medicine (e.g., 'Pain relief',
'Anti-inflammatory')
purpose
— Purpose or intended use (e.g., 'Treats
fever', 'Reduces pain')
warnings
— Warnings and safety precautionsdosage
— Suggested dosage (e.g., 'Take 1 tablet every
6 hours')
side_effects
— Possible side effectsingredients
— Active ingredients (e.g., 'Paracetamol
500mg')
official_website
— Official website for more
information
manufacturer
— Manufacturer or brand nameexpiration_date
— Expiration date of the medicine
storage_instructions
— How to store the medicine
Note: If any information is not available, the field will contain "N/A".
POST
https://pill-finder-backend.vercel.app/api/report
Use this endpoint to report issues or incorrect information about a medicine.
Request Body:
{ "medicineName": "Name of the medicine to report", "reason": "Detailed reason for the report" }
Required Fields:
medicineName
(required) — Name of the medicine
you want to report
reason
(required) —
Detailed explanation of why you're reporting this medicine
GET https://pill-finder-backend.vercel.app/api/find?name=panadol%20extra
POST https://pill-finder-backend.vercel.app/api/report Headers: Content-Type: application/json Authorization: Bearer YOUR_API_KEY_HERE { "medicineName": "Panadol Extra", "reason": "The price information is outdated. Current market price is 150 PKR." }
{ "_id": "680f7691aed963debc4f1d62", "name": "Panadol Extra", "price": "PKR 120", "type": "Tablet", "uses": "Relief of strong pain such as headache, toothache, backache, rheumatic and muscle pain, and period pain.", "purpose": "Pain Relief, Fever Reduction", "warnings": "Always read the label. Use only as directed.", "dosage": "2 tablets every 4-6 hours as required", "side_effects": "Side effects are rare. Stop using if you experience allergic reactions.", "ingredients": "Paracetamol 500mg and Caffeine 65mg", "official_website": "https://www.panadol.com/en-pk", "manufacturer": "GSK Consumer Healthcare Pakistan Ltd.", "expiration_date": "N/A", "storage_instructions": "Store below 25°C. Keep out of reach of children." }
{ "message": "Report submitted successfully" }
// Missing required fields { "error": "Missing required fields", "required": ["medicineName", "reason"] } // Email authentication failed { "error": "Email authentication failed", "details": "Please check your SMTP credentials" } // Connection failed { "error": "Email connection failed", "details": "Please check your internet connection and SMTP settings" }
// Missing medicine name { "error": "Medicine name is required" } // Invalid medicine name format { "error": "Medicine name must only contain letters, numbers, and spaces" } // Invalid medicine name type { "error": "Medicine name must be a string" } // AI model error { "error": "Error generating medicine data", "details": "The AI model is not available. Please check your API key and model access." } // Database error { "error": "Failed to store medicine data", "details": "Database operation failed" }
400
- Medicine name is required.400
- Medicine name must be a string.400
- Medicine name must only contain letters, numbers,
and spaces.
400
- Invalid medicine information. Please provide a
more accurate medicine name.
401
- Unauthorized. Valid API key is required.405
- Method not allowed. Only GET requests are
accepted.
500
- Server error. Could be due to AI model or
database issues.
400
- Required fields are missing (medicineName,
reason).
401
- Unauthorized. Valid API key is required.405
- Method not allowed. Only POST requests are
accepted.
500
- Server error. Could be due to email service
issues.
Important: To use the API, you must have a valid
API Key
.
Pass your API key in the header of your request:
Headers: Authorization: Bearer YOUR_API_KEY_HERE
To buy an API key, please follow the steps below:
Plans:
Email: learnfromshehbaz08@gmail.com
Phone/WhatsApp: 03183790054