1mg.com API1mg.com ↗
Access 1mg.com medicine search, product details, Ayurveda herbs, category tree, and offers data via a structured REST API with 5 endpoints.
curl -X GET 'https://api.parse.bot/scraper/f703cd2f-7d9c-47bc-8106-6d9631d9b223/search_medicines?query=paracetamol' \ -H 'X-API-Key: $PARSE_API_KEY'
Search for medicines and health products on 1mg.com. Returns generic drugs and branded products matching the query, with pagination support via page number or scroll_id.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number (starts from 0). |
| limit | integer | Number of results per page. |
| queryrequired | string | Medicine name or keyword to search for. |
| scroll_id | string | Scroll ID for deep pagination, returned from a previous search response. |
{
"type": "object",
"fields": {
"query": "string, the search query echoed back",
"results": "array of objects, each with type (generic or product), id, name, url, and additional fields depending on type",
"scroll_id": "string, pagination token for fetching next page",
"total_found": "boolean or integer indicating if results were found"
},
"sample": {
"data": {
"query": "paracetamol",
"results": [
{
"id": "210459",
"url": "https://www.1mg.com/generics/paracetamol-210459",
"name": "Paracetamol",
"type": "generic",
"description": "Paracetamol is used for pain relief and fever."
}
],
"scroll_id": "HmIUzR6-j5-655J_cjOIiU4A_8u3CuIixjhNDHn9Rw8=",
"total_found": true
},
"status": "success"
}
}About the 1mg.com API
The 1mg.com API exposes 5 endpoints covering medicine search, product detail pages, Ayurveda herb listings, and the full category hierarchy from India's largest online pharmacy. The search_medicines endpoint returns both generic drugs and branded products with pagination via scroll_id, while get_medicine_detail delivers widget sections and Q&A content keyed by a product slug.
Medicine Search and Product Data
The search_medicines endpoint accepts a query string and returns an array of results, each typed as either generic or product, with fields including id, name, and url. Deep pagination is handled through a scroll_id token returned in each response — pass it back in the next request instead of incrementing page. The total_found field confirms whether the query produced results. The get_medicine_detail endpoint takes a slug_id (for example, dolo-650-tablet-15-s-143883) and returns widgets (related product sections), qna (questions and answers), the full page url, and the extracted sku_id.
Ayurveda Herbs and Category Tree
The get_ayurveda_herbs endpoint lets you browse herb listings alphabetically using the alphabet parameter (a–z) with standard page-based pagination. Each herb object in the ayurvedas array includes name, description, slug, and image_url. The meta object provides count and total_count for building paginated views. The get_category_tree endpoint takes no parameters and returns the complete product taxonomy as a udp_tree array — each node carries name, id, slug, url, children, image_url, and display_text, covering the full top-to-leaf hierarchy in one call.
Offers Page Status
The get_offers endpoint is scoped to confirming that the 1mg.com promotions page is reachable, returning the page url and its HTTP status_code. Because offers content is server-side rendered and dynamic, the endpoint does not return individual offer details or structured deal data.
- Build a medicine price-comparison tool using product names and URLs from
search_medicines - Populate a drug information card using
widgetsandqnadata fromget_medicine_detail - Create an Ayurveda herb encyclopedia by iterating
get_ayurveda_herbsacross all 26 alphabet letters - Generate a navigable pharmacy category directory from the
udp_treereturned byget_category_tree - Distinguish generic vs branded drug listings in search results using the
typefield insearch_medicines - Sync a health app's herb database using
name,description, andimage_urlfields from herb listings
| 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 | 250 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 1mg have an official public developer API?+
How does pagination work in `search_medicines`?+
page integer parameter starting from 0, or use the scroll_id token returned in each response to fetch the next page of deep results. scroll_id is preferable for iterating through large result sets because it maintains consistent result ordering across pages.What data does `get_medicine_detail` return, and what does it not include?+
widgets (related product sections), a qna object with community questions and answers, the full page url, and the sku_id. It does not currently return structured pricing, stock availability, or seller information as discrete fields. You can fork the API on Parse and revise it to add an endpoint targeting those fields.Does the API return actual promotional deals or discount details from the offers page?+
get_offers endpoint only returns the offers page url and its HTTP status_code — it does not return structured deal objects, coupon codes, or discount percentages. You can fork the API on Parse and revise it to add an endpoint that parses individual offer listings.