How to Scrape Tata 1mg | 1mg.com Medicine Data Scraper
Learn how to scrape medicine names, prices, salt compositions, and lab tests from Tata 1mg (1mg.com) for pharmaceutical market research.
Free to start: 1,000 credits, no card, nothing to install.
About Tata 1mg
Learn what Tata 1mg offers and what valuable data can be extracted from it.
Overview of Tata 1mg
Tata 1mg, formerly known as 1mg, is India's leading digital healthcare platform and a subsidiary of the Tata Group. It operates as a comprehensive ecosystem providing online pharmacy services, diagnostic lab test bookings, and teleconsultations. The platform is the primary source for Indian consumers seeking reliable information on prescription drugs, OTC health products, and generic substitutes.
Data Depth and Structure
The website hosts an extensive database of pharmaceutical listings, including chemical salt compositions, manufacturer details, side effects, and pricing models across various dosages. This highly structured data makes it a premier target for competitive intelligence. Scrapers often target this site to build price comparison engines, analyze drug market trends, and verify product metadata for regulatory compliance.
Strategic Value for Scraping
Scraping Tata 1mg provides unparalleled insights into the Indian pharmaceutical landscape. It allows researchers to track medicine availability across different PIN codes, identify cheaper generic substitutes based on active ingredients, and monitor consumer sentiment through extensive user ratings and reviews. This data is essential for distributors, healthcare startups, and market analysts.

Why Scrape Tata 1mg?
Discover the business value and use cases for extracting data from Tata 1mg.
Competitive Price Monitoring
Track real-time fluctuations in drug prices and discounts to maintain a competitive edge in the Indian pharmacy market.
Generic Substitute Mapping
Extract salt compositions to build a database that identifies cheaper generic alternatives for branded medicines.
Market Share Analysis
Identify which pharmaceutical manufacturers dominate specific therapeutic classes by scraping product volumes and ratings.
Regional Availability Tracking
Monitor stock levels across various Indian PIN codes to identify supply chain gaps and regional medicine shortages.
Scraping Challenges
Technical challenges you may encounter when scraping Tata 1mg.
Advanced WAF Protection
Cloudflare's Web Application Firewall effectively detects and blocks standard automated requests and headless browsers.
Regional Pricing Logic
Prices and availability vary by PIN code, necessitating the use of regional proxies and session management to capture accurate data.
Dynamic Content Loading
The site uses React for asynchronous data loading, meaning traditional HTML parsers will fail to see the content without JS rendering.
Scrape Tata 1mg with AI
No coding required. Extract data in minutes with AI-powered automation.
How It Works
Describe What You Need
Tell the AI what data you want to extract from Tata 1mg. Just type it in plain language — no coding or selectors needed.
AI Extracts the Data
Our artificial intelligence navigates Tata 1mg, handles dynamic content, and extracts exactly what you asked for.
Get Your Data
Receive clean, structured data ready to export as CSV, JSON, or send directly to your apps and workflows.
Why Use AI for Scraping
No-Code Web Scrapers for Tata 1mg
Point-and-click alternatives to AI-powered scraping
Several no-code tools like Browse.ai, Octoparse, Axiom, and ParseHub can help you scrape Tata 1mg. These tools use visual interfaces to select elements, but they come with trade-offs compared to AI-powered solutions.
Typical Workflow with No-Code Tools
Common Challenges
Learning curve
Understanding selectors and extraction logic takes time
Selectors break
Website changes can break your entire workflow
Dynamic content issues
JavaScript-heavy sites often require complex workarounds
CAPTCHA limitations
Most tools require manual intervention for CAPTCHAs
IP blocking
Aggressive scraping can get your IP banned
Code Examples
import requests
from bs4 import BeautifulSoup
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36'
}
def scrape_1mg_basic(url):
# Note: Requests often gets blocked by Cloudflare on 1mg. Proxies are required.
try:
response = requests.get(url, headers=headers, timeout=10)
if response.status_code == 200:
soup = BeautifulSoup(response.text, 'html.parser')
# Example selector for product titles
titles = soup.select('.style__pro-title___3G3mI')
for title in titles:
print(f'Medicine: {title.get_text()}')
else:
print(f'Blocked: {response.status_code}')
except Exception as e:
print(f'Error: {e}')
scrape_1mg_basic('https://www.1mg.com/categories/all-medicines-1')When to Use
Best for static HTML pages where content is loaded server-side. The fastest and simplest approach when JavaScript rendering isn't required.
Advantages
- ●Fastest execution (no browser overhead)
- ●Lowest resource consumption
- ●Easy to parallelize with asyncio
- ●Great for APIs and static pages
Limitations
- ●Cannot execute JavaScript
- ●Fails on SPAs and dynamic content
- ●May struggle with complex anti-bot systems
import asyncio
from playwright.async_api import async_playwright
async def scrape_1mg_playwright():
async with async_playwright() as p:
# Launch browser with stealth settings
browser = await p.chromium.launch(headless=True)
page = await browser.new_page()
# Go to a category page
await page.goto('https://www.1mg.com/categories/fitness-supplements-63', wait_until='networkidle')
# Wait for product cards to load
await page.wait_for_selector('.style__product-card___1Y_A-')
# Extract data
products = await page.query_selector_all('.style__product-card___1Y_A-')
for item in products:
name = await (await item.query_selector('.style__pro-title___3G3mI')).inner_text()
price = await (await item.query_selector('.style__price-tag___3yJdp')).inner_text()
print(f'Product: {name} | Price: {price}')
await browser.close()
asyncio.run(scrape_1mg_playwright())When to Use
Use when content loads dynamically via JavaScript, or when you need to interact with the page (clicks, scrolls, form fills). Handles modern anti-bot detection better.
Advantages
- ●Executes JavaScript like a real browser
- ●Handles SPAs and dynamic content
- ●Better anti-bot evasion with stealth plugins
- ●Can take screenshots and PDFs
Limitations
- ●Slower than HTTP requests
- ●Higher memory/CPU usage
- ●More complex to set up
import scrapy
class OneMgSpider(scrapy.Spider):
name = 'one_mg'
allowed_domains = ['1mg.com']
start_urls = ['https://www.1mg.com/categories/all-medicines-1']
def parse(self, response):
# Scrapy-Playwright middleware is recommended for this site
for product in response.css('.style__product-card___1Y_A-'):
yield {
'name': product.css('.style__pro-title___3G3mI::text').get(),
'price': product.css('.style__price-tag___3yJdp::text').get(),
'link': response.urljoin(product.css('a::attr(href)').get())
}
# Handle simple pagination
next_page = response.css('ul.pagination li.next a::attr(href)').get()
if next_page:
yield response.follow(next_page, self.parse)When to Use
Ideal for large-scale crawling projects that need to scrape thousands of pages. Built-in support for rate limiting, retries, and data pipelines.
Advantages
- ●Built for scale (millions of pages)
- ●Automatic request throttling
- ●Built-in data export pipelines
- ●Middleware system for proxies/headers
Limitations
- ●Steeper learning curve
- ●Overkill for small projects
- ●No native JavaScript rendering
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
// Masking fingerprint
await page.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36');
try {
await page.goto('https://www.1mg.com/categories/homeopathy-57', { waitUntil: 'networkidle2' });
const data = await page.evaluate(() => {
const items = Array.from(document.querySelectorAll('.style__product-card___1Y_A-'));
return items.map(i => ({
name: i.querySelector('.style__pro-title___3G3mI')?.innerText,
price: i.querySelector('.style__price-tag___3yJdp')?.innerText
}));
});
console.log(data);
} catch (e) {
console.error('Scraping failed:', e);
} finally {
await browser.close();
}
})();When to Use
Choose this if you're in a Node.js/JavaScript ecosystem or need tight integration with frontend tools. Similar capabilities to Playwright.
Advantages
- ●Native JavaScript/TypeScript support
- ●Chrome DevTools Protocol access
- ●Large ecosystem and community
- ●Good for JS-heavy projects
Limitations
- ●Chrome-only (vs Playwright's multi-browser)
- ●Similar overhead to Playwright
- ●Less mature stealth options
What You Can Do With Tata 1mg Data
Explore practical applications and insights from Tata 1mg data.
Generic Medicine Comparison App
Create a platform that helps users save money by finding generic substitutes with identical salt concentrations.
How to implement:
- 1Scrape branded medicine data and their active salt ingredients.
- 2Filter the dataset to group products by identical salt composition and strength.
- 3Calculate the price difference and display the cheapest options to the user.
Use Automatio to extract data from Tata 1mg and build these applications without writing code.
Pharmacy Stock Monitoring
Assist distributors in identifying regional shortages by tracking 'Out of Stock' statuses geographically.
How to implement:
- 1Configure scrapers to run daily using proxies from different Indian metropolitan areas.
- 2Capture stock availability status for essential medicines.
- 3Generate alerts for manufacturers when specific regions show high stock depletion.
Use Automatio to extract data from Tata 1mg and build these applications without writing code.
Diagnostic Lab Price Benchmarking
Provide a transparency tool for health checkups by comparing prices across various pathology labs listed on 1mg.
How to implement:
- 1Extract lab test names, prices, and package inclusions from the 'Lab Tests' section.
- 2Categorize tests by type (e.g., CBC, Thyroid, Diabetes).
- 3Compare the cost-per-test across different labs and accreditation levels.
Use Automatio to extract data from Tata 1mg and build these applications without writing code.
Clinical Safety Data Aggregator
Build a database for medical professionals to quickly reference side effects and safety warnings.
How to implement:
- 1Crawl individual medicine detail pages to extract the 'Safety Advice' and 'Side Effects' blocks.
- 2Structure the unstructured text into standardized risk levels (e.g., Safe, Unsafe, Caution).
- 3Expose the data via an internal API for integration into clinical software.
Use Automatio to extract data from Tata 1mg and build these applications without writing code.
Supercharge your workflow with AI Automation
Automatio combines the power of AI agents, web automation, and smart integrations to help you accomplish more in less time.
What to get right first
Expert advice for successfully extracting data from Tata 1mg.
Set PIN Code via Cookies
To avoid PIN code pop-ups and get local pricing, set the 'city' and 'location' cookies in your request headers or use the site's location picker once and save the session.
Target AJAX Endpoints
Use the browser Network tab to find internal API calls like '/api/v1/search'. These return clean JSON and are often easier to parse than the React-rendered HTML.
Rotate Indian IPs
Data center IPs are frequently flagged. Use a residential proxy provider with a large pool of Indian IP addresses to mimic real local users.
Implement Random Delays
Avoid uniform scraping patterns. Use jitter (random delays between 3 to 15 seconds) to prevent triggering Cloudflare's behavioral detection.
Related Web Scraping

How to Scrape Carwow: Extract Used Car Data and Prices

Kalodata Scraper: Revenue, Item Sold, Unit Price in a table

How to Scrape HP.com: A Technical Guide to Product & Price Data

eBay Scraper: Titles, Prices and Condition in a table

How to Scrape ThemeForest Web Data

How to Scrape StubHub: The Ultimate Web Scraping Guide

AliExpress Scraper: Prices, Ratings and Sales in a table
Frequently Asked Questions
Find answers to common questions about Tata 1mg
Is it legal to scrape data from Tata 1mg?
Scraping publicly available data like medicine prices and names for research or comparison is generally acceptable. However, you must comply with their Terms of Service, avoid scraping private user data, and ensure your scraping frequency does not disrupt their service.
Does Tata 1mg have an official API for developers?
No, Tata 1mg does not provide a public API for catalog or price data. Businesses typically rely on web scraping or direct commercial partnerships to access their comprehensive pharmaceutical dataset.
Why am I getting blocked by Cloudflare when scraping 1mg?
1mg uses Cloudflare to detect bot-like behavior, such as high request rates or lack of browser fingerprints. To avoid this, use residential proxies and a browser-based scraping tool that can solve JavaScript challenges.
Can I scrape prices for specific Indian cities?
Yes, but you must either provide a specific Indian PIN code through the site's interface or set the appropriate location cookies. Using proxies based in those specific cities also helps in retrieving accurate local data.
How often do prices change on Tata 1mg?
While pharmaceutical base prices are somewhat regulated in India, discounts and promotional offers on 1mg change daily. For a price comparison engine, scraping every 24 hours is typically sufficient.
What is the best data format to save the scraped results?
JSON is the most effective format because of the hierarchical nature of medicine data, where one product has multiple salt components, side effects, and packaging options. CSV is better for simple price monitoring lists.
Does 1mg require login to see medicine prices?
No, medicine prices and most pharmaceutical details are publicly accessible without an account. Login is only required for placing orders, viewing medical records, or accessing specific teleconsultation features.
How do I handle the 'Infinite Scroll' on 1mg search pages?
1mg uses dynamic loading. If you are using a browser-based tool like Playwright, you should script a page scroll function that triggers the loading of new items before extracting the full list.