Apollo Pharmacy APIapollopharmacy.in ↗
Search Apollo Pharmacy's medicine catalog via API. Get price, MRP, discount, manufacturer, pack size, and availability for up to 20 products per query.
What is the Apollo Pharmacy API?
The Apollo Pharmacy API exposes one endpoint, search_medicines, that queries the apollopharmacy.in catalog and returns up to 20 matching products per search. Each result includes 9 structured fields: product name, SKU, selling price, MRP, discount percentage, manufacturer, stock availability, pack size, and prescription requirement status. Optionally pass a 6-digit Indian PIN code to get location-specific delivery availability.
curl -X GET 'https://api.parse.bot/scraper/1008a848-ec78-4d94-98ee-7458bbe7a770/search_medicines' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace apollopharmacy-in-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""
Apollo Pharmacy Medicine Search API Client
Search for medicines on Apollo Pharmacy with real-time pricing, availability,
and manufacturer information. Get your API key from: https://parse.bot/settings
"""
import os
import requests
from typing import Optional, Any
from dataclasses import dataclass
@dataclass
class Medicine:
"""Represents a medicine product from Apollo Pharmacy."""
name: str
sku: str
price: float
mrp: float
discount_percentage: int
manufacturer: Optional[str]
availability: str
pack_size: str
is_prescription_required: bool
tags: list
class ParseClient:
"""Client for Apollo Pharmacy Medicine Search API."""
def __init__(self, api_key: Optional[str] = None):
"""
Initialize the Parse API client.
Args:
api_key: API key for Parse API. If not provided, reads from PARSE_API_KEY env var.
Raises:
ValueError: If no API key is provided and PARSE_API_KEY is not set.
"""
self.base_url = "https://api.parse.bot"
self.scraper_id = "1008a848-ec78-4d94-98ee-7458bbe7a770"
self.api_key = api_key or os.getenv("PARSE_API_KEY")
if not self.api_key:
raise ValueError(
"API key not provided. Set PARSE_API_KEY environment variable "
"or pass api_key parameter."
)
def _call(self, endpoint: str, method: str = "POST", **params) -> dict:
"""
Make a request to the Parse API.
Args:
endpoint: API endpoint name (e.g., 'search_medicines')
method: HTTP method ('GET' or 'POST')
**params: Parameters to pass to the endpoint
Returns:
Response data as dictionary
Raises:
requests.RequestException: If API request fails
"""
url = f"{self.base_url}/scraper/{self.scraper_id}/{endpoint}"
headers = {
"X-API-Key": self.api_key,
"Content-Type": "application/json",
}
if method.upper() == "GET":
response = requests.get(url, headers=headers, params=params)
elif method.upper() == "POST":
response = requests.post(url, headers=headers, json=params)
else:
raise ValueError(f"Unsupported HTTP method: {method}")
response.raise_for_status()
return response.json()
def search_medicines(
self, query: str, pincode: str = "110055"
) -> dict:
"""
Search for medicines by name on Apollo Pharmacy.
Args:
query: Medicine name or keyword to search for (e.g., 'paracetamol', 'dolo 650')
pincode: Indian PIN code for delivery availability check. Defaults to Delhi (110055)
Returns:
Dictionary containing search results with products list and metadata
"""
return self._call(
"search_medicines",
method="GET",
query=query,
pincode=pincode,
)
def _parse_product(self, product_data: dict) -> Medicine:
"""Convert API product response to Medicine dataclass."""
return Medicine(
name=product_data.get("name", ""),
sku=product_data.get("sku", ""),
price=product_data.get("price", 0.0),
mrp=product_data.get("mrp", 0.0),
discount_percentage=product_data.get("discount_percentage", 0),
manufacturer=product_data.get("manufacturer"),
availability=product_data.get("availability", ""),
pack_size=product_data.get("pack_size", ""),
is_prescription_required=product_data.get("is_prescription_required", False),
tags=product_data.get("tags", []),
)
def main():
"""
Practical workflow: Search for medicines and analyze pricing/availability.
"""
# Initialize client
client = ParseClient()
# List of medicines to search for
search_queries = ["paracetamol", "amoxicillin", "dolo"]
pincode = "110055" # Delhi
all_medicines = []
print("=" * 80)
print("APOLLO PHARMACY MEDICINE SEARCH - PRICE COMPARISON")
print("=" * 80)
# Search for each medicine
for query in search_queries:
print(f"\n📋 Searching for: {query.upper()}")
print("-" * 80)
try:
# Call API to search medicines
result = client.search_medicines(query=query, pincode=pincode)
total_results = result.get("total_results", 0)
products = result.get("products", [])
if not products:
print(f" ❌ No results found for '{query}'")
continue
print(f" ✓ Found {total_results} results (showing top {len(products)})")
# Process each product
for idx, product_data in enumerate(products[:5], 1): # Show top 5
medicine = client._parse_product(product_data)
all_medicines.append(medicine)
# Calculate savings
savings = medicine.mrp - medicine.price
savings_percent = medicine.discount_percentage
# Availability indicator
status_icon = "✓ In Stock" if medicine.availability == "in-stock" else "✗ Out of Stock"
# Prescription indicator
rx_indicator = " [Rx Required]" if medicine.is_prescription_required else ""
print(f"\n {idx}. {medicine.name}{rx_indicator}")
print(f" SKU: {medicine.sku}")
print(f" Price: ₹{medicine.price} | MRP: ₹{medicine.mrp} | Save: ₹{savings:.2f} ({savings_percent}%)")
print(f" Pack: {medicine.pack_size} | {status_icon}")
if medicine.manufacturer:
print(f" Manufacturer: {medicine.manufacturer}")
if medicine.tags:
print(f" Tags: {', '.join(medicine.tags)}")
except requests.exceptions.RequestException as e:
print(f" ❌ API Error: {e}")
except ValueError as e:
print(f" ❌ Error: {e}")
# Summary analysis
print("\n" + "=" * 80)
print("SUMMARY & ANALYSIS")
print("=" * 80)
if all_medicines:
# Find cheapest medicine
cheapest = min(all_medicines, key=lambda m: m.price)
print(f"\n💰 Cheapest Medicine: {cheapest.name} - ₹{cheapest.price}")
# Find best discount
best_discount = max(all_medicines, key=lambda m: m.discount_percentage)
print(f"🎉 Best Discount: {best_discount.name} - {best_discount.discount_percentage}% off")
# Count by availability
in_stock = sum(1 for m in all_medicines if m.availability == "in-stock")
out_of_stock = len(all_medicines) - in_stock
print(f"\n📦 Availability: {in_stock} in-stock, {out_of_stock} out-of-stock")
# Prescription requirement analysis
rx_required = sum(1 for m in all_medicines if m.is_prescription_required)
print(f"💊 Prescription Required: {rx_required} medicines")
# Average pricing
avg_price = sum(m.price for m in all_medicines) / len(all_medicines)
avg_mrp = sum(m.mrp for m in all_medicines) / len(all_medicines)
avg_savings = avg_mrp - avg_price
print(f"\n📊 Average Pricing:")
print(f" - Average Price: ₹{avg_price:.2f}")
print(f" - Average MRP: ₹{avg_mrp:.2f}")
print(f" - Average Savings: ₹{avg_savings:.2f}")
print("\n" + "=" * 80)
if __name__ == "__main__":
main()Search medicines by name on Apollo Pharmacy. Returns up to 20 matching products with pricing, availability, manufacturer, and pack size information. Results are sorted by relevance to the search query.
| Param | Type | Description |
|---|---|---|
| queryrequired | string | Medicine name or keyword to search for (e.g. 'paracetamol', 'dolo 650', 'amoxicillin'). |
| pincode | string | Indian PIN code for delivery availability check. 6-digit string (e.g. '110055' for Delhi). |
{
"type": "object",
"fields": {
"query": "string",
"products": "array of product objects with name, sku, price, mrp, discount_percentage, manufacturer, availability, pack_size, is_prescription_required, tags",
"total_results": "integer"
},
"sample": {
"query": "paracetamol",
"products": [
{
"mrp": 9.5,
"sku": "PAR0083",
"name": "Paracip-500 Tablet 10's",
"tags": [
"Paracetamol-500Mg",
"Pain & Fever"
],
"price": 8.07,
"pack_size": "10 Tablet",
"availability": "in-stock",
"manufacturer": null,
"discount_percentage": 15,
"is_prescription_required": false
},
{
"mrp": 19,
"sku": "CRO0091",
"name": "Crocin Advance Tablet 20's",
"tags": [
"Paracetamol-500Mg",
"Pain & Fever"
],
"price": 19,
"pack_size": "20 Tablet",
"availability": "in-stock",
"manufacturer": "GlaxoSmithKline Pharmaceuticals Ltd",
"discount_percentage": 0,
"is_prescription_required": false
}
],
"total_results": 20
}
}About the Apollo Pharmacy API
What the API Returns
The search_medicines endpoint accepts a query string — a medicine name, brand name, or active ingredient (e.g. 'paracetamol', 'dolo 650', 'amoxicillin') — and returns a products array alongside a total_results count and an echo of the original query. Each product object contains name, sku, price (selling price), mrp (maximum retail price), discount_percentage, manufacturer, availability, pack_size, and is_prescription_required.
Filtering and Location
Results are ordered by relevance to the search query. The optional pincode parameter accepts a 6-digit Indian PIN code (e.g. '110055' for Delhi) and adjusts the availability field to reflect whether the product can be delivered to that location. Without a PIN code, availability reflects general stock status rather than location-specific delivery feasibility.
Data Scope and Limitations
The API returns up to 20 products per query — there is no pagination parameter to retrieve additional pages of results. The is_prescription_required flag distinguishes OTC products from those that require a prescription, which is useful for filtering workflows. Price fields (price, mrp, discount_percentage) reflect current listed values on Apollo Pharmacy and can change without notice as the platform updates inventory.
The Apollo Pharmacy API is a managed, monitored endpoint for apollopharmacy.in — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when apollopharmacy.in changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official apollopharmacy.in API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Compare selling price vs. MRP across generic and branded paracetamol variants using
priceandmrpfields. - Check
is_prescription_requiredto filter OTC medicines from prescription-only drugs in a health app. - Verify
availabilityfor a specific PIN code before displaying a medicine in a local delivery interface. - Retrieve
manufacturerandpack_sizefields to build a medicine comparison table for patient-facing tools. - Monitor
discount_percentagechanges over time for price-tracking or alerting workflows. - Look up
skuidentifiers to cross-reference Apollo Pharmacy listings against other pharmacy catalogs. - Populate an autocomplete medicine search using partial brand or generic name queries.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Apollo Pharmacy offer an official developer API?+
What does the `availability` field actually reflect?+
pincode, availability indicates general stock status for the product. When you supply a valid 6-digit Indian PIN code, the field reflects whether Apollo Pharmacy can fulfill delivery to that specific location, which can differ from the general stock status.Does the API return more than 20 results or support pagination?+
search_medicines endpoint returns up to 20 products per query and does not expose a pagination parameter. If you need deeper result sets for a given query, that capability is not currently available. You can fork this API on Parse and revise it to add offset or page-based pagination.Can I retrieve product detail pages, images, or customer reviews?+
sku field returned by search_medicines.