# Lenskart Scraper: India Eyewear, Prices & Stock (`niches/lenskart-scraper`) Actor

Product name, price, stock, brand, rating, image and link from Lenskart (lenskart.com) in India. Search public listings with price tracking and CSV/JSON export.

- **URL**: https://apify.com/niches/lenskart-scraper.md
- **Developed by:** [Niches](https://apify.com/niches) (community)
- **Categories:** E-commerce, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.20 / 1,000 products

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Lenskart Scraper: India Eyewear, Prices & Stock

Read product listings from **Lenskart**, **lenskart.com**, in **India**. Each row contains a product’s name, published price, availability, brand, product link and image, with ratings where the source exposes them.

Send several searches in one run, export the resulting dataset, and schedule repeat runs to track price changes. Price history stays in your own Apify key-value store.

Tested in Apify's cloud. The example below is a real delivered cloud row.

### What you get

| Field | What it holds |
|---|---|
| productId / productName | Source product identifier and full published product name. |
| price / regularPrice / currency | Selling price, published list price when available, and native currency. |
| inStock / availability / stockCount | Source availability and quantity where provided. |
| brand / category / gtin | Published classification and barcode when available. |
| rating / reviewCount | Aggregate rating and exact published review count when available. |
| productUrl / image | Public product and image links. |
| searchTerm / inputUrl / rank | Which input found the product and the order returned for that input. |
| priceStatus / previousPrice / priceChange | Comparison with your prior delivered product prices. |
| scrapedAt / sourceUrl | UTC observation time and the public results URL used. |

### What people use it for

- **Price monitoring:** Schedule the same searches to find price drops and rises.
- **Catalog research:** Export the products offered for a category or search.
- **Availability checks:** Compare source availability flags over repeated runs.
- **Automation and analysis:** Feed a consistent JSON or CSV table into spreadsheets, reports or AI workflows.

### How to use it

1. Keep the example input or enter your searches in the retailer’s local language.
2. Choose the maximum products per input and a maximum run cost.
3. Run the Actor, then open the dataset for product rows and SUMMARY for counts and any source notes.
4. Run the same inputs again with the same trackingName to compare prices.

### Input

| Field | Example | Notes |
|---|---|---|
| searches | \["eyeglasses"] | Array of search words. Supplying searches alone replaces the default category URL. |
| urls | \["https://www.lenskart.com/eyeglasses.html"] | Array of public Lenskart India category URLs ending in .html. |
| maxProductsPerSearch | 20 | From 1 to 500; an upper limit, not a guaranteed result count. |
| trackPrices | true | Compare delivered rows with your last run. |
| trackingName | daily-watch | Optional separate price history name. |

### Output

Each result is one row in the run's dataset (download it as JSON, CSV, Excel, XML or HTML, or read it through the API). An example row (values shortened):

```json
{
  "resultId": "57f109967f830f9df97d8ac8e1102d89",
  "productId": "207671",
  "site": "Lenskart",
  "country": "India",
  "productName": "Dark Night Full Rim Square Lenskart Husltr LA E15417-W C10 Eyeglasses",
  "brand": "Lenskart Hustlr",
  "price": 1200,
  "regularPrice": 2000,
  "currency": "INR",
  "onSale": true,
  "rating": 4.8,
  "reviewCount": 44701,
  "stockCount": 143663,
  "inStock": true,
  "availability": "in_stock",
  "image": "https://static5.lenskart.com/media/catalog/product/pro/1/thumbnail/656x464/9df78eab33525d08d6e5fb8d27136e95//l/i/dark-night-full-rim-square-air-essentials-la-e15417-w-c10-eyeglasses_227532-pdp-2-23.jpg",
  "productUrl": "https://www.lenskart.com/lenskart-hustlr-la-e15417-c10-eyeglasses.html",
  "rank": 1,
  "searchTerm": null,
  "inputUrl": "https://www.lenskart.com/eyeglasses.html",
  "category": "Eyeglasses",
  "color": "Dark Night",
  "size": "Medium",
  "previousPrice": 59,
  "priceChange": 1141,
  "priceChangePercent": 1933.9,
  "priceStatus": "raised",
  "firstSeenAt": "2026-11-12T18:05:36Z",
  "scrapedAt": "2026-11-12T18:18:23Z",
  "sourceUrl": "https://www.lenskart.com/eyeglasses.html"
}
```

The free `SUMMARY` record in the run’s key-value store contains per-input row counts, source status, request and byte counts, skipped suggestions, charge counts and a price-change summary.

### Pricing

- $0.004 per delivered product ($4 per 1,000 products).
- Apify's start fee is $0.00005 per run. Empty searches, failed requests, duplicates and SUMMARY have no product or record charge.

What typical jobs cost at the list price:

| Job | Cost |
|---|---|
| 20 products | $0.08 |
| 1,000 products across inputs or runs | $4.00 |
| No matching products | $0 in product events |

Set **Maximum cost per run** in the Apify Console. Only products delivered within that budget are charged.

### Tips

- Use the local language for search terms and keep queries specific.
- Reuse trackingName to compare with the last run; use another name for a separate history.
- Set Maximum cost per run to control spending. The Actor checks the budget before requesting the next input.
- Read SUMMARY for counts, skipped rows, source failures, request traffic and price changes.

### Use it through the API

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("niches/lenskart-scraper").call(run_input={"maxProductsPerSearch": 20, "trackPrices": true, "urls": ["https://www.lenskart.com/eyeglasses.html"]})
for row in client.dataset(run.default_dataset_id).iterate_items():
    print(row)
```

**JavaScript**

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('niches/lenskart-scraper').call({"maxProductsPerSearch": 20, "trackPrices": true, "urls": ["https://www.lenskart.com/eyeglasses.html"]});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

**HTTP (one call, results back)**

```bash
curl -X POST 'https://api.apify.com/v2/acts/niches~lenskart-scraper/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"maxProductsPerSearch": 20, "trackPrices": true, "urls": ["https://www.lenskart.com/eyeglasses.html"]}'
```

### Integrations and schedules

- **Schedules:** run it every hour, day or week from the Apify Console (Schedules) and keep a history of results.
- **Make, Zapier, n8n, Google Sheets, Slack, Airtable:** connect it through Apify's integrations, or send each finished run to a **webhook**.
- **Datasets:** results stay in the run's dataset; export them or read them by API whenever you need them.

### Use it with AI agents (MCP)

Add Apify's MCP server with this Actor already pinned (`https://mcp.apify.com?tools=niches/lenskart-scraper`) to Claude, ChatGPT, Cursor, VS Code or any MCP client. The agent can find this Actor and run it for you: ask it for product prices and availability from Lenskart in India. AI agents can also pay for runs directly through Apify's agentic payments.

### Limits

- Uses public signed-out results from lenskart.com. It does not log in or solve access checks. A source that cannot be read is explained in SUMMARY.
- Prices are in the source currency. Taxes, shipping, address-specific delivery and personalized or membership discounts can differ at checkout.
- Null fields mean the source did not publish the value in these results. Stock flags and quantities describe the source response, not a delivery guarantee.
- A product appearing under more than one input is delivered and charged once per run. Its first matching input supplies its search context.
- At most 20 inputs, up to the selected product maximum per input, and at most 50 result pages per input. Site result limits can be lower.
- Public category URLs support paging. Keyword searches return their public page results; some search-only results do not expose a pageable category ID.
- Eyewear prices describe the displayed product or frame offer; prescription lenses and add-ons may change the final price.
- Inventory fields are null on paged catalog results. The initial web page supplies stock where published.

### FAQ

**Does this require a retailer account or API key?**

No. It reads public, signed-out product data.

**Why is a field null?**

The public search response did not expose that value. The Actor leaves it empty instead of estimating it.

**Can I track price changes?**

Yes. Keep trackPrices enabled and reuse trackingName. Delivered products are compared with the prior saved price; only delivered rows update history.

**Does a search return every product?**

It returns up to your chosen maximum from the supported result pages. See Limits for source-specific page limits.

### Support

Questions, a site that changed, or a field you need? Open an issue on this Actor's **Issues** tab: we answer there, usually within a day.

***

Also found as: Lenskart scraper, lenskart.com prices, India product data.

# Actor input Schema

## `urls` (type: `array`):

Public Lenskart India category pages ending in .html, for example https://www.lenskart.com/sunglasses.html. Up to 20 URLs per run; each is read page by page.

## `searches` (type: `array`):

Search words, for example round, aviator or blue light glasses. Up to 20 searches per run. When you give searches and no URLs, only the searches run.

## `maxProductsPerSearch` (type: `integer`):

Up to 500 products for each URL or search. A product found by more than one input is delivered and charged once.

## `trackPrices` (type: `boolean`):

Compare each product's price with your previous run. The history is kept in a named key-value store in your own Apify account.

## `trackingName` (type: `string`):

Optional name for a separate price history, for example daily-watch. Reuse it on later runs.

## Actor input object example

```json
{
  "urls": [
    "https://www.lenskart.com/eyeglasses.html"
  ],
  "maxProductsPerSearch": 20,
  "trackPrices": true
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset: the results.

## `summary` (type: `string`):

What each input returned, and notes.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://www.lenskart.com/eyeglasses.html"
    ],
    "maxProductsPerSearch": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("niches/lenskart-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "urls": ["https://www.lenskart.com/eyeglasses.html"],
    "maxProductsPerSearch": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("niches/lenskart-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://www.lenskart.com/eyeglasses.html"
  ],
  "maxProductsPerSearch": 20
}' |
apify call niches/lenskart-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,niches/lenskart-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/kr1Jx8AaXdZKtaBmC/builds/5bEWTcQhwYGibyw6f/openapi.json
