Discover/1mg API
live

1mg API1mg.com

Access 1mg.com medicine search, product details, Ayurveda herbs, category tree, and offers data via a structured REST API with 5 endpoints.

This API takes change requests — .
Endpoint health
verified 6d ago
search_medicines
get_medicine_detail
get_ayurveda_herbs
get_category_tree
get_offers
5/5 passing latest checkself-healing
Endpoints
5
Updated
28d ago

What is the 1mg 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.

Try it
Page number (zero-based).
Number of results per page.
Medicine name or keyword to search for.
Scroll ID for deep pagination, returned from a previous search response.
api.parse.bot/scraper/f703cd2f-7d9c-47bc-8106-6d9631d9b223/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/f703cd2f-7d9c-47bc-8106-6d9631d9b223/search_medicines?page=0&limit=5&query=paracetamol' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

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 1mg-com-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.

"""Walkthrough: 1mg.com Pharmacy API — search medicines, browse herbs, explore categories."""
from parse_apis.onemg_pharmacy_api import OneMg, Alphabet, MedicineNotFound

client = OneMg()

# Search for medicines — limit caps total items fetched across all pages.
for result in client.searchresults.search(query="paracetamol", limit=3):
    print(result.name, result.type, result.url)

# Drill into a specific medicine's detail page by slug.
detail = client.medicinedetails.get(slug_id="dolo-650-tablet-15-s-143883")
print(detail.sku_id, detail.url)
for widget in detail.widgets[:2]:
    print(widget.header, widget.type)

# Browse Ayurveda herbs alphabetically using the Alphabet enum.
for herb in client.herbs.list(alphabet=Alphabet.A, limit=3):
    print(herb.name, herb.slug)

# Fetch category tree to discover product categories.
category = client.categories.list(limit=1).first()
if category:
    print(category.name, category.id, category.display_text)

# Typed error handling: catch when a medicine slug is invalid.
try:
    client.medicinedetails.get(slug_id="nonexistent-medicine-000000")
except MedicineNotFound as exc:
    print(f"Medicine not found: {exc.slug_id}")

# Check offers page availability.
offers = client.offersstatuses.check()
print(offers.url, offers.status_code)

print("exercised: searchresults.search / medicinedetails.get / herbs.list / categories.list / offersstatuses.check")
All endpoints · 5 totalmissing one? ·

Full-text search over medicines and health products on 1mg.com. Returns generic drugs and branded products matching the query. Paginates via page number or scroll_id from a previous response. Each result carries type (generic or product), identity, URL, and type-specific fields (price/rating for products, description for generics).

Input
ParamTypeDescription
pageintegerPage number (zero-based).
limitintegerNumber of results per page.
queryrequiredstringMedicine name or keyword to search for.
scroll_idstringScroll ID for deep pagination, returned from a previous search response.
Response
{
  "type": "object",
  "fields": {
    "query": "string, the search query echoed back",
    "results": "array of search result objects, each with type, id, name, url, and additional fields depending on type",
    "scroll_id": "string, pagination token for fetching the next page",
    "total_found": "boolean 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."
        },
        {
          "id": "143883",
          "mrp": 33.76,
          "url": "https://www.1mg.com/drugs/dolo-650-tablet-15-s-143883",
          "name": "Dolo 650 Tablet",
          "type": "product",
          "brand": "Micro Labs Ltd",
          "image": "https://onemg.gumlet.io/example.jpg",
          "price": 30.38,
          "rating": 4.6,
          "discount": "10% off",
          "pack_size": "strip of 15 tablets",
          "availability": true,
          "rating_count": 1200
        }
      ],
      "scroll_id": "HmIUzR6-j5-655J_cjOIiU4A_8u3CuIixjhNDHn9Rw8=",
      "total_found": true
    },
    "status": "success"
  }
}

About the 1mg API

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.

Reliability & maintenanceVerified

The 1mg API is a managed, monitored endpoint for 1mg.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when 1mg.com 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 1mg.com 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.

Last verified
6d ago
Latest check
5/5 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Build a medicine price-comparison tool using product names and URLs from search_medicines
  • Populate a drug information card using widgets and qna data from get_medicine_detail
  • Create an Ayurveda herb encyclopedia by iterating get_ayurveda_herbs across all 26 alphabet letters
  • Generate a navigable pharmacy category directory from the udp_tree returned by get_category_tree
  • Distinguish generic vs branded drug listings in search results using the type field in search_medicines
  • Sync a health app's herb database using name, description, and image_url fields from herb listings
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 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.

Frequently asked questions
Does 1mg have an official public developer API?+
1mg does not publish a public developer API or API documentation for third-party access to its medicine catalog or product data.
How does pagination work in `search_medicines`?+
You can paginate using the 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?+
It returns 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?+
Not currently. The 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.
Are lab tests or doctor consultation listings covered?+
Not currently. The API covers medicine search, product detail pages, Ayurveda herbs, and the category tree. Lab test packages and doctor consultation data are not exposed by any current endpoint. You can fork the API on Parse and revise it to add endpoints for those sections.
Page content last updated . Spec covers 5 endpoints from 1mg.com.
Related APIs in HealthcareSee all →