# Talabat Mart Grocery Scraper (`autofacts/talabat-mart-grocery-scraper`) Actor

Extract the full Talabat Mart grocery catalog across Dubai's dark stores: SKU-level prices, discounts, live stock counts, EAN barcodes, and product URLs for every delivery zone. Clean structured JSON for price monitoring, q-commerce market intelligence, and cross-retailer matching.

- **URL**: https://apify.com/autofacts/talabat-mart-grocery-scraper.md
- **Developed by:** [Richard Feng](https://apify.com/autofacts) (community)
- **Categories:** E-commerce, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Talabat Mart Scraper (GCC q-commerce grocery) — MVP: Dubai

First **maintained, structured, PPE, agent-ready** Talabat Mart dark-store grocery SKU + price Actor.
Play ③ uncovered-in-demand (existing Apify `talabat-scraper` actors are RESTAURANT menus, not
q-commerce grocery). Single retailer + single city to start; schema/architecture reserve
multi-retailer (Noon Minutes / Careem Quik) + multi-city.

### Pipeline (3 stages, all pure HTTP — confirmed by recon 2026-07-23)

1. **AREA** `GET /uae/groceries/<areaId>/<slug>` → `__NEXT_DATA__.props.pageProps.talabatMartData.branchId`
   \= the Talabat Mart dark store for that area. Dedup branchIds across areas → the Dubai tMart set.
2. **STORE** `GET /uae/grocery/<branchId>/<slug>?aid=<areaId>` → the category-listing links.
   *(The `?aid=<areaId>` param is required — without it the store URL 307-redirects to `/uae`.)*
3. **CATALOG** `GET /uae/grocery/<branchId>/<slug>/<category>/<subcategory>?aid=<areaId>`
   (Next.js `grocery-items` page) → the **full item list is SSR'd** into
   `__NEXT_DATA__.props.pageProps.initialState`. No BFF, no browser.

**Confirmed item schema** (per item in the SSR payload):
`{ id (uuid), sku, title, slug, description, originalPrice, price, discount, discountPercentage,
image, images[], stockAmount, attributes[] }` — and the **EAN/UPC barcode lives inside
`attributes`** (a 12–14-digit `characteristic` value; the cross-retailer matching key).

### Anti-bot (determined by recon 2026-07-23, and VALIDATED live)

- Edge = **Cloudflare Bot Management** — permissive; static bot-UA blocklist; **no JS challenge**
  (a real browser from a clean IP passed instantly; a `python-requests` UA → **403**).
- Session = Delivery Hero **Perseus** cookies + `__cf_bm` + `tlb_country`; catalog **geo-gated to UAE**.
- ⇒ **HTTP crawler** (got-scraping browser-TLS, **no headless browser**) + realistic **mobile UA**
  - **RESIDENTIAL-AE proxy** + **SessionPool** + moderate rate. See `src/crawler.ts`.
- Note: catalog + prices render even from a non-AE IP, but **accurate `stockAmount` needs a UAE IP**
  → residential-AE is required, not optional.

### Run

```bash
npm install
npm run build
apify run -p --input-file test.json      # default = 1 zone (Al Badaa) × 50 products, fast + cheap
```

Default input is intentionally small/fast — the Apify daily auto-tester runs it; a slow/failing
default flags the Actor UNDER\_MAINTENANCE.

### Monetization (Console-only config)

Pure **PPE + limited permissions + structured output** → auto `agentic=true` (x402/MCP funnel).

- main event: per-product-result ~$2–4 / 1k SKU
- aux event: per-store/zone start ~$0.02
- free top-N SKU sample (wedge, mirrors Actowiz's free PoC)

### Observability (Scraper Insight)

Every fetch is reported to the Scraper Insight hub (`https://insight.auto7lab.com`, override via
`INSIGHT_URL`) with machine auth (`X-App-ID` + `X-App-Secret`, this Actor's registered app;
override via `INSIGHT_APP_ID` / `INSIGHT_APP_SECRET`): successes with real status + latency from
`src/crawler.ts`'s requestHandler, exhausted-retry failures from `failedRequestHandler` with an
HTTP-style classified status (`src/insight.ts` — Cloudflare block throws carry `(status 403)` and
classify accordingly, timeouts → 504). Reporting is fire-and-forget: a dead Insight endpoint never
fails the crawl. This feeds the dashboard, alert rules, and the Cloudflare-escalation health signal.

### Validation gate (do NOT skip)

Off-platform demand (Actowiz dashboards, LinkedIn basket use-case) proves *interest*, not that
buyers convert to a self-serve Actor. **≥ 8–10 distinct paying accounts within 60 days of listing,
or downgrade / re-scope.** Day-20 leading indicator: free-sample pulls ≈ 0 → fail fast.

### Remaining before scale

- Decode the useful `attributes[]` characteristics beyond barcode (weight/volume/returnable) if needed.

### Area list maintenance

`src/dubaiZones.ts` (153 Dubai areas, from Talabat's UAE areas sitemap) is the single source of
truth. The Console multiselect for `areaIds` is generated from it — after refreshing the zone map
from the sitemap, re-sync the input schema:

```bash
npm run build && node scripts/sync-area-enum.mjs
```

`categories` stays free-form on purpose: category slugs are per-store and discovered at runtime,
so there is no closed vocabulary to enumerate.

### Icon

`.actor/icon.png` (256×256) is Talabat's own favicon (brand orange `#f55905`), the mark that
identifies what this Actor scrapes. Apify has **no `actor.json` icon field** — set it in
**Console → Publication → Display information → Icon** by uploading this file.

### Output — shared spec `Product` (`src/spec.ts`)

Records follow the fleet-wide product spec (same contract as farfetch / asos / boohoo / ulta):
`source` / `title` / `description` / `details` / `brand` / `categories` / `medias` / `variants`
/ `price` / `extraInfo`. Fleet conventions:

- **Prices in minor units** (fils, AED × 100): `price.current = 1250` = AED 12.50;
  `price.currentFormatted = "AED 12.50"`; `previous` falls back to `current` when there is no
  was-price; a real was-price also fills `original`.
- **One record per product-offer at one dark store.** `source.id` = the Talabat global-catalog
  uuid (cross-store product identity), so the same product at two dark stores = two records;
  offer uniqueness = (`source.id`, `extraInfo.darkStore.id`).
- **Grocery = single-variant products**: `variants` has exactly one entry carrying the retailer
  `sku` and the same `price`.
- **`extraInfo` carries the q-commerce dimensions** the spec has no first-class slot for:
  `scrapedAt`, `city`, `darkStore {id, name, zone, areaId}`, `barcode` (EAN/UPC — the
  cross-retailer matching key), `size`, `discountPercentage`, `superSaver`, `fulfilment
  {deliveryFeeAed, etaMinutes, minOrderAed}`.

### Output hygiene

Everything fetched is a **public SSR page**, so URLs are already public (no hidden BFF/token to
leak). `source.canonicalUrl` = the **public product detail page**
`/uae/grocery/<branchId>/<storeSlug>/product/<slug>/s/<sku>?aid=<areaId>` (confirmed live
2026-07-30; falls back to the category page if an item ever lacks `slug`/`sku`).
`source.crawlUrl` = the public category page the item was parsed from. The `?aid=<areaId>` query
param is part of the public URL scheme (pages 307-redirect without it), not an internal token.
Keep it that way.

# Actor input Schema

## `retailer` (type: `string`):

MVP: Talabat Mart only. Noon Minutes / Careem Quik are planned (schema + adapters reserved).

## `city` (type: `string`):

MVP: Dubai only.

## `areaIds` (type: `array`):

Dubai areas (dark-store zones) to cover — all 153 Talabat grocery areas are listed. Each area resolves its Talabat Mart dark store at runtime; many areas share one store (deduped automatically). Empty = Al Badaa only (fast sample).

## `categories` (type: `array`):

Only scrape these grocery categories. Empty = all.

## `maxProductsPerStore` (type: `integer`):

Cap per dark store. Keeps the default run fast + cheap (the daily auto-tester runs the default input).

## `proxy` (type: `object`):

Residential UAE strongly recommended: Cloudflare scores datacenter IPs badly AND the catalog is geo-gated to the UAE.

## Actor input object example

```json
{
  "retailer": "talabat_mart",
  "city": "dubai",
  "areaIds": [
    "1172"
  ],
  "categories": [],
  "maxProductsPerStore": 200,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "AE"
  }
}
```

# Actor output Schema

## `products` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("autofacts/talabat-mart-grocery-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("autofacts/talabat-mart-grocery-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 '{}' |
apify call autofacts/talabat-mart-grocery-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,autofacts/talabat-mart-grocery-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/4QsbQVPShMidIuGkt/builds/FJ0qJk5I4aShhLd9s/openapi.json
