Tablet Info API Documentation

API Endpoints

Find Medicine

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 medicine
  • price — 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 precautions
  • dosage — Suggested dosage (e.g., 'Take 1 tablet every 6 hours')
  • side_effects — Possible side effects
  • ingredients — Active ingredients (e.g., 'Paracetamol 500mg')
  • official_website — Official website for more information
  • manufacturer — Manufacturer or brand name
  • expiration_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".

Report Medicine

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

Example Requests

Find Medicine

GET https://pill-finder-backend.vercel.app/api/find?name=panadol%20extra

Report Medicine

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."
}

Example Responses

Find Medicine (Success)

{
  "_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."
}

Report Medicine (Success)

{
  "message": "Report submitted successfully"
}

Report Medicine (Error Examples)

// 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"
}

Find Medicine (Error Examples)

// 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"
}

Possible Errors

Find Medicine

Report Medicine

Authentication (Paid Access)

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

Payment Instructions (for API Access)

To buy an API key, please follow the steps below:

  1. Send the payment to one of the following numbers:
    • Easypaisa: 03122346473 (Account Title: Muhammad Sajid Khan)
    • JazzCash: 03183790054 (Account Title: Muhammad Shahbaz Khan)
  2. After payment, send your transaction ID or screenshot and email to: learnfromshehbaz08@gmail.com also message on Phone/WhatsApp: 03183790054
  3. We will verify your payment and send you your API key within 24 hours.

Plans:

Contact Support

Email: learnfromshehbaz08@gmail.com

Phone/WhatsApp: 03183790054