Tata 1mg Category Products
tata-1mg.category.products
Preview the first products of a Tata 1mg category, such as hair care, with prices and discounts.
At a glance
- Endpoint ID
tata-1mg.category.products- Price
- 10 credits per call; failed calls are free
- Runs for up to
- 45 seconds
Request
Send the endpoint ID as capability and its fields as input. Set UPSCRAPE_API_KEY to your key first.
curl --request POST \ --url https://data.upscrape.com/execute \ --header "Authorization: Bearer $UPSCRAPE_API_KEY" \ --header "Content-Type: application/json" \ --header "Prefer: wait=30" \ --data '{ "capability": "tata-1mg.category.products", "input": { "category_url": "https://www.1mg.com/categories/hair-care-20", "limit": 20, "max_pages": 1, "page": 1, "pincode": "560001" }}'
import jsonimport osimport requestspayload = json.loads(r'''{ "capability": "tata-1mg.category.products", "input": { "category_url": "https://www.1mg.com/categories/hair-care-20", "limit": 20, "max_pages": 1, "page": 1, "pincode": "560001" }}''')response = requests.post( "https://data.upscrape.com/execute", headers={ "Authorization": f"Bearer {os.environ['UPSCRAPE_API_KEY']}", "Content-Type": "application/json", "Prefer": "wait=30", }, json=payload,)response.raise_for_status()print(json.dumps(response.json(), indent=2))
const response = await fetch("https://data.upscrape.com/execute", { method: "POST", headers: { "Authorization": `Bearer ${process.env.UPSCRAPE_API_KEY}`, "Content-Type": "application/json", "Prefer": "wait=30", }, body: JSON.stringify({ "capability": "tata-1mg.category.products", "input": { "category_url": "https://www.1mg.com/categories/hair-care-20", "limit": 20, "max_pages": 1, "page": 1, "pincode": "560001" }}),});if (!response.ok) { throw new Error(`Upscrape request failed: ${response.status}`);}console.log(JSON.stringify(await response.json(), null, 2));
Input
| Field | Type | Required | What it does | Example |
|---|---|---|---|---|
category_url |
string | yes | A Tata 1mg category page, such as https://www.1mg.com/categories/hair-care-20. | https://www.1mg.com/categories/hair-care-20 |
limit |
integer | no | How many products to return. | 20 |
max_pages |
integer | no | Keep at 1; later pages are not offered yet. | 1 |
page |
integer | no | The first page; later pages are not offered yet. | 1 |
pincode |
string | no | A six-digit Indian PIN code, for that delivery area. | 560001 |
Response
A finished call answers with HTTP 200; the data is in results[0].data, and billing.credits_charged is what it cost. A call still running after the wait answers 202: see jobs and results.
This is results[0].data from a real run:
{ "end_page": 1, "has_more": false, "start_page": 1, "products": [ { "name": "Pilgrim 3% Redensyl, 4% Anagain & 5% Capilia Stem Cell Complex Advanced Hair Growth Serum 30 ml Serum", "price": 652, "mrp": 795, "availability": "available", "currency": "INR", "discount_percent": 18, "product_id": "988798" }, { "name": "FCL Anti Dandruff T-Shampoo | with Salicylic Acid | Scalp Psoriasis, Nourises Scalp 200 ml Shampoo", "price": 1191, "mrp": 1250, "availability": "available", "currency": "INR", "discount_percent": 5, "product_id": "462289" } ]}
Fields
| Field | Type | What it is | Example |
|---|---|---|---|
products[].name |
string | The product name as Tata 1mg shows it. | Pilgrim 3% Redensyl, 4% Anagain & 5% Capilia Stem Cell Complex … |
products[].price |
integer | The selling price, in the currency given. | 652 |
products[].mrp |
integer | The maximum retail price printed for the product. | 795 |
products[].availability |
string | Whether the product can be ordered now. | available |
products[].currency |
string | The currency code of the prices. | INR |
products[].discount_percent |
integer | The discount off the MRP, in percent. | 18 |
products[].product_id |
string | Tata 1mg's ID for the product; the product and reviews endpoints take it. | 988798 |
end_page |
integer | The last results page read in this call. | 1 |
has_more |
boolean | Whether more results follow. | false |
products |
array | The products. | 3 records |
start_page |
integer | The first results page read in this call. | 1 |
If a call fails
A failed call costs nothing. The response carries an error.code you can branch on; Errors and retries lists every code and which ones to retry.
Other Tata 1mg endpoints
Something missing or unclear? Ask the team that builds the Tata 1mg endpoints.