# Target Product Scraper (`shahidirfan/target-product-scraper`) Actor

Scrape Target.com product data instantly. Extract prices, reviews, ratings, images & inventory levels. Perfect for price monitoring, competitive analysis & market research. Full product details, zero coding required. Reliable & fast data extraction.

- **URL**: https://apify.com/shahidirfan/target-product-scraper.md
- **Developed by:** [Shahid Irfan](https://apify.com/shahidirfan) (community)
- **Categories:** E-commerce, Automation, Developer tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Target Product Scraper

Collect product listings from Target search with rich product details ready for analysis, monitoring, and automation. This actor helps you build structured datasets for pricing intelligence, assortment tracking, and catalog research.

---

### Features

- **Search-focused extraction** - Collect products by keyword or search URL.
- **Rich product fields** - Capture title, pricing, ratings, brand, images, and product links.
- **Pagination support** - Gather results across multiple pages with safety limits.
- **Marketplace visibility** - Identify marketplace items directly in output.
- **Clean dataset output** - Records are saved without empty null fields.

---

### Use Cases

#### Price Monitoring
Track price changes and comparisons over time for selected categories or seasonal keywords.

#### Competitor Assortment Tracking
Analyze which products, brands, and item types are appearing for key searches.

#### Product Research
Build focused datasets for market research, trend reporting, or merchandising analysis.

#### Ratings Intelligence
Review product rating averages and rating counts for quality and demand insights.

---

### Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `startUrl` | String | No | Example prefill | Target search URL. If set, keyword and related values are inferred from it. |
| `keyword` | String | No | `"womens tops"` | Search keyword used for product collection. |
| `sort_by` | String | No | `"relevance"` | Sort mode (`relevance`, `newest`). |
| `results_wanted` | Integer | No | `20` | Maximum number of products to collect. |
| `max_pages` | Integer | No | `10` | Maximum pages to process. |
| `include_sponsored` | Boolean | No | `true` | Include sponsored products in results. |
| `proxyConfiguration` | Object | No | Disabled | Proxy settings for reliability. |

Store context and visitor identifier are handled internally by the actor. If your `startUrl` already includes those query parameters, they are respected.

---

### Output Data

Each dataset item may include the following fields:

| Field | Type | Description |
|---|---|---|
| `position` | Integer | Product position in result flow. |
| `page` | Integer | Page number where the product was collected. |
| `search_keyword` | String | Keyword used in the run. |
| `tcin` | String | Target product identifier. |
| `parent_tcin` | String | Parent identifier for variation groups. |
| `title` | String | Product title. |
| `brand` | String | Product brand. |
| `formatted_current_price` | String | Current displayed price. |
| `formatted_comparison_price` | String | Comparison price if available. |
| `rating_average` | Number | Average star rating. |
| `rating_count` | Integer | Number of ratings. |
| `is_marketplace` | Boolean | Marketplace flag. |
| `item_type` | String | Product classification label. |
| `department_id` | Integer | Target department ID. |
| `buy_url` | String | Product page URL. |
| `primary_image_url` | String | Main product image. |
| `response_id` | String | Result response identifier. |
| `sort_by` | String | Sort mode used in request. |
| `scraped_at` | String | Record timestamp in ISO format. |

---

### Usage Examples

#### Basic Search

```json
{
	"keyword": "womens tops",
	"results_wanted": 20
}
````

#### Start URL Driven Collection

```json
{
	"startUrl": "https://www.target.com/s?searchTerm=womens+tops&category=0%7CAll%7Cmatchallpartial%7Call+categories&searchTermRaw=womw",
	"results_wanted": 50,
	"max_pages": 5
}
```

#### Sorted Collection with Store Context

```json
{
	"keyword": "running shoes",
	"sort_by": "newest",
	"results_wanted": 100,
	"max_pages": 10
}
```

***

### Sample Output

```json
{
	"position": 1,
	"page": 1,
	"search_keyword": "womens tops",
	"tcin": "89513491",
	"parent_tcin": "87193107",
	"title": "INSPIRE CHIC Women's Ruffle V Neck Puff Sleeve Summer Casual Chiffon Peasant Top X-Large Black",
	"brand": "INSPIRE CHIC",
	"formatted_current_price": "$28.99 - $31.99",
	"formatted_comparison_price": "$38.69 - $42.69",
	"rating_average": 3.62,
	"rating_count": 18,
	"is_marketplace": true,
	"item_type": "Shirts",
	"department_id": 287,
	"buy_url": "https://www.target.com/p/allegra-k-women-s-ruffle-v-neck-puff-sleeve-summer-casual-chiffon-peasant-top-black-x-large/-/A-89513491",
	"primary_image_url": "https://target.scene7.com/is/image/Target/GUEST_98f735e4-29c7-4875-bafc-fbded857596a",
	"response_id": "search-31762b4a-701d-424d-b792-94adc23d8614",
	"sort_by": "relevance",
	"scraped_at": "2026-04-07T08:00:00.000Z"
}
```

***

### Tips For Best Results

#### Use Specific Keywords

Targeted search terms improve relevance and make downstream analysis easier.

#### Start Small, Then Scale

Begin with `results_wanted` set to `20` for quick validation, then increase gradually.

#### Configure Proxy For Reliability

Residential proxy settings improve consistency for larger data collection runs.

#### Tune Pagination Safely

Use `max_pages` as a guardrail to control runtime and data volume.

***

### Integrations

- **Google Sheets** - Export product datasets for quick analysis.
- **Airtable** - Build searchable product tracking tables.
- **Make** - Trigger automated workflows after each run.
- **Zapier** - Send product events to business tools.
- **Webhooks** - Deliver fresh data to custom systems.

#### Export Formats

- **JSON** - Programmatic workflows and APIs
- **CSV** - Spreadsheet and BI analysis
- **Excel** - Business reporting
- **XML** - System integrations

***

### Frequently Asked Questions

#### How many products can I collect?

You can collect as many as available for your search, limited by your `results_wanted` and `max_pages` settings.

#### Can I use a full Target search URL?

Yes. Provide `startUrl` and the actor will use it as the source for search settings.

#### Why do some items have fewer fields?

Some products may not publish every attribute. The actor saves only available values and excludes nulls.

#### Does this support pagination automatically?

Yes. The actor moves through result pages until limits are reached.

#### Is sponsored content included?

Yes by default. You can disable it using `include_sponsored`.

***

### Support

For issues or feature requests, use the Apify Console issue and support channels.

#### Resources

- [Apify Documentation](https://docs.apify.com/)
- [Apify API Reference](https://docs.apify.com/api/v2)
- [Apify Scheduling](https://docs.apify.com/platform/schedules)

***

### Legal Notice

This actor is intended for legitimate data collection and analysis. Users are responsible for complying with website terms and applicable laws in their jurisdiction.

# Actor input Schema

## `startUrl` (type: `string`):

Optional Target listing URL. If provided, keyword and page context are inferred from this URL unless explicitly overridden.

## `keyword` (type: `string`):

Search keyword used to collect products.

## `sort_by` (type: `string`):

Sort mode for product results.

## `results_wanted` (type: `integer`):

Maximum number of products to save.

## `max_pages` (type: `integer`):

Safety cap for pagination depth.

## `include_sponsored` (type: `boolean`):

Include sponsored products in the response.

## `proxyConfiguration` (type: `object`):

Proxy settings for reliable data collection.

## Actor input object example

```json
{
  "startUrl": "https://www.target.com/s?searchTerm=womens+tops&category=0%7CAll%7Cmatchallpartial%7Call+categories&searchTermRaw=womw",
  "keyword": "womens tops",
  "sort_by": "relevance",
  "results_wanted": 20,
  "max_pages": 10,
  "include_sponsored": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "startUrl": "https://www.target.com/s?searchTerm=womens+tops&category=0%7CAll%7Cmatchallpartial%7Call+categories&searchTermRaw=womw",
    "keyword": "womens tops",
    "sort_by": "relevance",
    "results_wanted": 20,
    "max_pages": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahidirfan/target-product-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 = {
    "startUrl": "https://www.target.com/s?searchTerm=womens+tops&category=0%7CAll%7Cmatchallpartial%7Call+categories&searchTermRaw=womw",
    "keyword": "womens tops",
    "sort_by": "relevance",
    "results_wanted": 20,
    "max_pages": 10,
}

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

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

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

```

## CLI example

```bash
echo '{
  "startUrl": "https://www.target.com/s?searchTerm=womens+tops&category=0%7CAll%7Cmatchallpartial%7Call+categories&searchTermRaw=womw",
  "keyword": "womens tops",
  "sort_by": "relevance",
  "results_wanted": 20,
  "max_pages": 10
}' |
apify call shahidirfan/target-product-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=shahidirfan/target-product-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Target Product Scraper",
        "description": "Scrape Target.com product data instantly. Extract prices, reviews, ratings, images & inventory levels. Perfect for price monitoring, competitive analysis & market research. Full product details, zero coding required. Reliable & fast data extraction.",
        "version": "1.0",
        "x-build-id": "Q0ki8oPDFqZDoX2Yy"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/shahidirfan~target-product-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-shahidirfan-target-product-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/shahidirfan~target-product-scraper/runs": {
            "post": {
                "operationId": "runs-sync-shahidirfan-target-product-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/shahidirfan~target-product-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-shahidirfan-target-product-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "startUrl": {
                        "title": "Start URL",
                        "type": "string",
                        "description": "Optional Target listing URL. If provided, keyword and page context are inferred from this URL unless explicitly overridden."
                    },
                    "keyword": {
                        "title": "Keyword",
                        "type": "string",
                        "description": "Search keyword used to collect products."
                    },
                    "sort_by": {
                        "title": "Sort By",
                        "enum": [
                            "relevance",
                            "newest"
                        ],
                        "type": "string",
                        "description": "Sort mode for product results.",
                        "default": "relevance"
                    },
                    "results_wanted": {
                        "title": "Maximum Number of Products",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of products to save.",
                        "default": 20
                    },
                    "max_pages": {
                        "title": "Maximum Number of Pages",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Safety cap for pagination depth.",
                        "default": 10
                    },
                    "include_sponsored": {
                        "title": "Include Sponsored Products",
                        "type": "boolean",
                        "description": "Include sponsored products in the response.",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings for reliable data collection.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
