Documentation

Daraz.pk CLI

daraz-pp-cli

Install

npx -y @mvanhorn/printing-press-library install daraz

Installs the CLI binary and the agent skill for Claude Code, Codex, Cursor, Gemini CLI, Copilot, and more. Add --cli-only or --skill-only for one half. Requires Node.

Documentation

Every Daraz product search, plus a local price database, real-deal ranking, and drop alerts no Daraz scraper has.

daraz-pp-cli searches Daraz.pk listings, reads reviews, and extracts product detail like any scraper — then keeps it in a local SQLite store so it can do what one-shot scrapers cannot: track price history (price-history), rank genuine deals over fake discounts (deals, value), diff a saved search over time (since), and vet sellers (seller stats). Read-only, no login required.

Quick Start

# Health check — confirms daraz.pk is reachable; needs no credentials.
daraz-pp-cli doctor --dry-run

# Core search with a PKR price range, cheapest first.
daraz-pp-cli products --query "gaming laptop" --price 50000-150000 --sort priceasc

# Read recent reviews for a product by its item ID.
daraz-pp-cli reviews --item-id 599201597 --page-size 5

Unique Features

These capabilities aren't available in any other tool for this API.

Local price intelligence

  • price-history — See a product's recorded price trend and its lowest-ever price from your local store.

    Reach for this to judge whether a current price is actually low for that item, not just discounted on paper.

    daraz-pp-cli price-history 599201597 --agent
    
  • watch — Record current prices for every item matching a search into the local store so price history builds over time.

    Run periodically on a query you care about; then price-history shows the trend for any item it captured.

    daraz-pp-cli watch "gaming laptop"
    
  • since — Diff a saved search against its last local snapshot to show new listings and price moves since you last checked.

    Use to monitor a market over time instead of re-reading a full result list each run.

    daraz-pp-cli since "gaming mouse" --agent
    

Smart ranking

  • deals — Rank a search by a composite of discount, rating, and units sold to surface genuinely good deals.

    Use when the goal is the best-value item for a query, not raw listing order.

    daraz-pp-cli deals "laptop" --agent --select name,price,discountPct,rating
    
  • value — Flag inflated original-price discounts by comparing each item's claimed original price to the local median for that query.

    Use to avoid misleading discounts; it is the inverse of deals.

    daraz-pp-cli value "power bank" --agent
    
  • compare — Find the same item across sellers and show the cheapest and best-rated side by side.

    Use to pick the best seller/listing for an item before buying.

    daraz-pp-cli compare "airpods pro" --agent
    

Seller trust

  • seller stats — Aggregate a seller's catalog from the local store: average rating, price range, listing count, discount pattern.

    Use to vet a seller's track record before trusting a listing.

    daraz-pp-cli seller stats 1066739 --agent
    

Recipes

Agent-friendly search with field selection

daraz-pp-cli deals "wireless earbuds" --agent --select name,price,discountPct,rating,url

deals returns a flat, ranked array of listings, so --select trims each row to just the fields an agent needs and keeps payloads small.

Find the best-value items, not the biggest fake discount

daraz-pp-cli deals "power bank" --agent --select name,price,discountPct,rating

Ranks by a discount-times-rating-times-sales composite computed locally.

Start tracking a product's price

daraz-pp-cli watch 599201597

Records the current price so price-history builds a real trend over time.

See what changed in a market since last check

daraz-pp-cli since "gaming mouse" --agent

Diffs the current search against the last local snapshot for new listings and price moves.

Usage

Run daraz-pp-cli --help for the full command reference and flag list.

Commands

products

Search Daraz product listings

  • daraz-pp-cli products - Search products by keyword with sort and price filtering

reviews

Read product reviews and rating distribution

  • daraz-pp-cli reviews - List reviews for a product by its numeric item ID

Output Formats

# Human-readable table (default in terminal, JSON when piped)
daraz-pp-cli products --query example-value

# JSON for scripting and agents
daraz-pp-cli products --query example-value --json

# Filter to specific fields
daraz-pp-cli products --query example-value --json --select id,name,status

# Dry run — show the request without sending
daraz-pp-cli products --query example-value --dry-run

# Agent mode — JSON + compact + no prompts in one flag
daraz-pp-cli products --query example-value --agent

Agent Usage

This CLI is designed for AI agent consumption:

  • Non-interactive - never prompts, every input is a flag
  • Pipeable - --json output to stdout, errors to stderr
  • Filterable - --select id,name returns only fields you need
  • Previewable - --dry-run shows the request without sending
  • Read-only by default - this CLI does not create, update, delete, publish, send, or mutate remote resources
  • Offline-friendly - sync/search commands can use the local SQLite store when available
  • Agent-safe by default - no colors or formatting unless --human-friendly is set

Exit codes: 0 success, 2 usage error, 3 not found, 5 API error, 7 rate limited, 10 config error.

Health Check

daraz-pp-cli doctor

Verifies configuration and connectivity to the API.

Configuration

Config file: ~/.config/daraz-pp-cli/config.toml

Static request headers can be configured under headers; per-command header overrides take precedence.

Troubleshooting

Not found errors (exit code 3)

  • Check the resource ID is correct
  • Run the list command to see available items

API-specific

  • Empty results for a query that has products on the site — Drop filters and retry: daraz-pp-cli products --query "" — then re-add --price.
  • price-history or since shows nothing — Populate the local store first: daraz-pp-cli watch (for price-history) or run the same search once before since.
  • reviews returns nothing — Confirm the numeric item ID from a product URL (the digits after -i in .../products/...-i.html).

Sources & Inspiration

This CLI was built by studying these projects and resources:

Generated by CLI Printing Press

For agents: pass /documentation/daraz/agents.md to install this CLI from a prompt.