# Shopify Product Search Scraper (`khadinakbar/shopify-product-search-scraper`) Actor

Search one public Shopify storefront by product keyword for discovery, price checks, and ranked result exports. Returns price, availability, variants, image, source URL, and search position. $0.005 per result + $0.00005 start.

- **URL**: https://apify.com/khadinakbar/shopify-product-search-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** E-commerce, Automation, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 shopify product search results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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

## Shopify Product Search Scraper

Search a known public Shopify storefront by product keyword and receive one normalized product row for each result found. This focused Actor works well for store-specific product discovery, in-store price checks, and ranked search exports.

Use it when you know the store and want to answer a query such as “Which coffee products does this brand show for `coffee`?” or “What running shoes currently match this store’s search?” Each product row includes its public URL, title, availability, price range, sale signal, image, vendor, type, variant count, and the result position observed by this run.

For a full catalog, collections, customer reviews, or merchant contact data, pair this search workflow with the [Shopify All-in-One Scraper](https://apify.com/khadinakbar/shopify-all-in-one-scraper). This Actor’s public storefront data surface keeps store-specific search, catalog research, and merchant research as clear separate workflows.

### Cost

The Actor uses Pay per event pricing: a small start event plus one event for each validated product row saved to the dataset. The configured product-search event is **$0.005 per result**; Apify platform usage is charged separately. Set `maxResults` to make the event-charge ceiling predictable, and consult the live Pricing tab for the effective current price.

### Input

Provide a public Shopify storefront URL and the product phrase you want to search. `maxResults` is the hard result and billing cap; `maxPages` controls how many public storefront search pages are inspected after the predictive-search route.

```json
{
  "storeUrl": "https://www.deathwishcoffee.com",
  "searchQuery": "coffee",
  "maxResults": 20,
  "maxPages": 3,
  "includeSoldOut": false
}
```

`includeSoldOut` defaults to `false`. Set it to `true` when unavailable products are useful to your research. Availability remains `null` only where the public Shopify response does not expose it.

### Output

The default dataset contains one product result per row. Every row includes source and freshness fields so it can be checked or reused in a spreadsheet, database, or agent workflow.

| Field                                                   | Meaning                                                                                 |
| ------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `title`, `productUrl`, `handle`                         | Public product identity and canonical product page.                                     |
| `position`, `searchQuery`                               | First-seen position for the supplied store query.                                       |
| `priceMin`, `priceMax`, `compareAtPriceMin`, `isOnSale` | Public product pricing and an explicit sale calculation when compare-at pricing exists. |
| `available`, `variantCount`, `sku`                      | Storefront availability and public variant signals.                                     |
| `vendor`, `productType`, `tags`, `imageUrl`             | Product classification and merchandising fields exposed by Shopify.                     |
| `dataSource`, `sourceUrl`, `scrapedAt`                  | Retrieval route, exact public endpoint, and collection time.                            |

Representative output shape:

```json
{
  "productId": "7420854370359",
  "handle": "power-surge-coffee",
  "title": "Power Surge Coffee",
  "productUrl": "https://www.deathwishcoffee.com/products/power-surge-coffee",
  "storeDomain": "www.deathwishcoffee.com",
  "searchQuery": "coffee",
  "position": 1,
  "available": true,
  "vendor": "Death Wish Coffee",
  "productType": "Coffee",
  "priceMin": 19.99,
  "priceMax": 84.99,
  "currency": null,
  "isOnSale": false,
  "variantCount": 3,
  "dataSource": "storefrontSearch",
  "sourceUrl": "https://www.deathwishcoffee.com/products/power-surge-coffee.js",
  "scrapedAt": "<ISO-8601 collection timestamp>"
}
```

`currency` is only populated when the public storefront search page exposes a three-letter currency value. A null currency is intentional; the Actor does not guess currency from symbols or prices.

### How it works

The Actor first calls Shopify’s public predictive-search endpoint for fast, query-relevant product candidates. It also inspects the selected storefront’s public `/search` pages to expand beyond predictive results, then reads the public product JSON endpoint for each bounded candidate. This produces richer product data while retaining a store-specific search workflow.

Public Shopify themes and merchant search settings differ. A valid query with no public match is recorded as `VALID_EMPTY`, while useful rows from an interrupted retrieval are retained with a `PARTIAL` outcome. `OUTPUT` and `RUN_SUMMARY` make the terminal outcome and source provenance available for dataset readback.

### Workflow: from search to price decision

A merchandising analyst starts with a known competitor store and a shopper-style phrase such as `coffee`. The Actor then returns the store’s query-matched products with prices, sale signals, availability, and source URLs. Next, the analyst exports the dataset, compares the price range with a prior run, and passes the selected product URLs into a catalog or pricing-monitoring workflow. This keeps the decision grounded in the public search result instead of a broad catalog snapshot.

### API example

Set your Apify token in an environment variable and start a bounded run:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/khadinakbar~shopify-product-search-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "storeUrl": "https://www.deathwishcoffee.com",
    "searchQuery": "coffee",
    "maxResults": 20,
    "maxPages": 3,
    "includeSoldOut": false
  }'
```

After completion, read the default dataset through the actor response or Apify Console. For agent use, the hosted [Apify MCP configurator](https://mcp.apify.com/) exposes the same input schema and dataset fields.

### Agent prompt card

> Search `https://www.deathwishcoffee.com` for `coffee`. Return up to 20 currently available products with title, price range, sale status, variant count, product URL, and source timestamp. Treat a null currency as an unavailable storefront metadata field.

### Best results and scope

- Start with a concise shopper-style product phrase, such as `coffee`, `running shoes`, or `wireless charger`.
- Keep `maxResults` and `maxPages` low for first checks, then increase them only when the storefront has more matches to inspect.
- Product ordering reflects the public routes available during the run. Merchant search settings, localization, A/B tests, and theme markup shape the products a storefront returns.
- This Actor uses public storefront routes for a store-specific product-search workflow. Catalog, checkout, and marketplace research remain distinct workflows with their own appropriate data sources.
- Use the `dataSource`, `sourceUrl`, and `scrapedAt` fields when comparing a product across runs.

### Builder's note

I designed this Actor after separating search-led product research from generic Shopify catalog extraction in this portfolio. My goal was a clear workflow: a known store and one query in, query-matched product records out. That boundary keeps the input small, the cost cap legible, and the result practical for search-led product research.

### Responsible use

Collect public storefront data in line with the store’s terms, applicable law, and the privacy obligations that apply to your workflow. Keep account, checkout, and customer-information workflows within properly authorized systems.

# Actor input Schema

## `storeUrl` (type: `string`):

Public Shopify storefront to search, such as 'https://www.deathwishcoffee.com'. A bare domain such as 'deathwishcoffee.com' is also accepted and only its storefront origin is used. The default is a stable public storefront for a quick search check. This is not a product URL, admin URL, localhost address, or a private network target.

## `searchQuery` (type: `string`):

Keywords sent to the storefront's public Shopify product search, such as 'coffee beans' or 'women running shoes'. Use a concise product phrase of up to 200 characters and preserve the store's own relevance order. The default is 'coffee'. This is not a product URL, a collection handle, or a request to crawl the entire catalog.

## `maxResults` (type: `integer`):

Caps the product rows returned and billed by this run. Enter an integer from 1 to 100, for example 20. Defaults to 20 and each validated result costs $0.005 in event charges. This is not a page count and does not include separate platform usage charges.

## `maxPages` (type: `integer`):

Limits public storefront search pages inspected after the predictive-search route. Enter an integer from 1 to 10, for example 3. Defaults to 3, while maxResults remains the final output and charge cap. This is not an exact result count because Shopify theme page sizes differ.

## `includeSoldOut` (type: `boolean`):

Controls whether normalized product rows marked unavailable by Shopify are included. Set true to inspect unavailable catalog matches; false keeps only currently available products when the storefront exposes availability. Defaults to false. This does not infer inventory for products whose storefront does not expose an availability flag.

## Actor input object example

```json
{
  "storeUrl": "https://www.allbirds.com",
  "searchQuery": "running shoes",
  "maxResults": 20,
  "maxPages": 3,
  "includeSoldOut": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Default dataset of normalized Shopify product search results with price, availability, image, variant count, source URL, and store search position.

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

Compact terminal outcome, result counts, retrieval warnings, and default dataset link.

## `runSummary` (type: `string`):

Detailed terminal summary for monitoring systems that use a separate operational key.

# 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 = {
    "storeUrl": "https://www.deathwishcoffee.com",
    "searchQuery": "coffee",
    "maxResults": 10,
    "maxPages": 2,
    "includeSoldOut": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/shopify-product-search-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 = {
    "storeUrl": "https://www.deathwishcoffee.com",
    "searchQuery": "coffee",
    "maxResults": 10,
    "maxPages": 2,
    "includeSoldOut": False,
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/shopify-product-search-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 '{
  "storeUrl": "https://www.deathwishcoffee.com",
  "searchQuery": "coffee",
  "maxResults": 10,
  "maxPages": 2,
  "includeSoldOut": false
}' |
apify call khadinakbar/shopify-product-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khadinakbar/shopify-product-search-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/KoS7CzB93uErDMhTK/builds/hw77KkNPUKe8fu232/openapi.json
