# Target 🎯 Data Extractor (`jupri/target-scraper`) Actor

💫 All-in-One Target.com Scraper

- **URL**: https://apify.com/jupri/target-scraper.md
- **Developed by:** [cat](https://apify.com/jupri) (community)
- **Categories:** E-commerce
- **Features:** Full permissions
- **Stats:** 98 total users, 1 monthly users, 100.0% runs succeeded, 3 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/actors/running/actors-in-store.md#pay-per-usage

## 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

## Welcome to Target.com Browser

![dont be sad readme is here](https://raw.githubusercontent.com/JupriGH/resources/main/cats/catframe.png)

### 🎯 About Target.com

![enter image description here](https://target.scene7.com/is/content/Target/GUEST_ca8f1d56-9000-4407-be78-2c33be983dab)

**Target Corporation** ([doing business as](https://en.wikipedia.org/wiki/Doing_business_as "Doing business as")  **Target** and stylized in [all lowercase](https://en.wikipedia.org/wiki/All_lowercase "All lowercase") since 2018) is an American [big box](https://en.wikipedia.org/wiki/Big-box_store "Big-box store")  [department store](https://en.wikipedia.org/wiki/Department_store "Department store") chain headquartered in [Minneapolis, Minnesota](https://en.wikipedia.org/wiki/Minneapolis "Minneapolis"). It is the seventh largest retailer in the United States, and a component of the [S\&P 500 Index](https://en.wikipedia.org/wiki/S%26P_500_Index "S\&P 500 Index").[\[4\]](https://en.wikipedia.org/wiki/Target_Corporation#cite_note-4) Target was established as the discount division of [Dayton's](https://en.wikipedia.org/wiki/Dayton%27s "Dayton's") department store of Minneapolis in 1962. It began expanding the store nationwide in the 1980s (as part of the Dayton-Hudson Corporation), and introduced new store formats under the Target brand in the 1990s.

### 🎯 About This Actor

Scrape Target.com for Product Info, Reviews, Store info, etc.

![enter image description here](https://image.shutterstock.com/image-vector/vector-illustration-under-construction-sign-260nw-1665084250.jpg)

### 🎯  Tutorial

#### 🛒 Basic Usage

Searching product

```yaml
{ "query": ["warp drive"], "limit": 40 }
```

#### 🛒 Advanced Usage

##### TARGET  Query Language (`TCQL`)

```html
[ <COMMAND:> | # | @ ] [ <NAME> | <ID> | <KEYWORD> | <URL> ] [ /<SECTION> ]  
```

##### Possible `QUERY`  values

| Format | Example | Description |
|-|-|-|
| **<*KEYWORDS*>** | `search terms` |***Search Anything***|
| **<*NAVIGATION_ID*>** | `N-5yc1vZcgy4` | ***Browse Category***
| **<*PRODUCT_ID*>** | `90994512` |***Product Data*** |
| `/info` | `90994512/info` | Product info |
| `/variations` | `90994512/variations` | Product variations |
| `/photos` | `90994512/photos` |  User submitted images |
| `/reviews` | `90994512/reviews` | Product reviews |
| **store:<*STORE_ID*>** | `store:3217` | **Store Data** |
| `/info` | `store:3217/info` | Store info |
| **https:<*URL*>** | `https://www.target.com` |***Start URL*** |
|  | `https://www.target.com/s/...` | Search page |
|  | `https://www.target.com/p/...` | Product page |

### 🎯 Examples

![enter image description here](https://image.shutterstock.com/image-vector/vector-illustration-under-construction-sign-260nw-1665084250.jpg)

### 🎯 Output Samples

![enter image description here](https://image.shutterstock.com/image-vector/vector-illustration-under-construction-sign-260nw-1665084250.jpg)

### 🎯 Support

⚡️ Feel free to [reach out](https://console.apify.com/actors/0B5cm65GuThvdONgh/issues) to the developer for any issues or suggestions for improvement.

<img src="https://apify-uploads-prod.s3.us-east-1.amazonaws.com/5SxZhwYwpknFk8ek9-cat.gif" width="240">

# Actor input Schema

## `query` (type: `array`):

💡 Search Terms or URL

## `limit` (type: `integer`):

💡 Number of results (per query)

## `filters.sort` (type: `string`):

Sorting key

## `filters.store` (type: `string`):

💡 Store Location \[Store-ID (digits) / Zip-Code (5-9 digits) or Place]

## `filters.location` (type: `string`):

💡 Delivery Location (Zip-Code) \[Must be digits]

## `dev_proxy_config` (type: `object`):

💡 <b>Supported protocol:</b><br><br><b>HTTP(S), SOCKS5</b><br><code>{http|socks5}://{user:pass}@{hostname|ip-address}:port</code><br><br><b>Example</b>: <code>socks5://example.com:9000</code>

## `dev_custom_headers` (type: `array`):

💡 Additional HTTP Headers

## `dev_custom_cookies` (type: `array`):

💡 Additional HTTP Cookies

## `dev_transform_fields` (type: `array`):

💡 <b>Transform the resulting output. Select only needed fields.</b><br><br>For nested object use <b>DOT</b>. For example: <pre>address.streetAddress</pre><br>For nested array use <b>NUMBER</b> <i>(index of array element starting from index=0)</i>. For example: <pre>images.0.url</pre>

## `dev_dataset_name` (type: `string`):

💡 <b>Save results into custom named Dataset, use mask to customize dataset name</b><br><br><code>{ACTOR} = actor name<br>{DATE} = date (YYYYMMDD)<br>{TIME} = time (HHMMSS)</code><br><br>This masks can be used to autogenerate Dataset Name.<br><br>example: <i><code>data-{DATE}</code></i><br>Depending on today date the dataset name will be: <code>data-20230603</code><i><br><br>default: <code>data-{ACTOR}-{DATE}-{TIME}</code></i>

## `dev_dataset_clear` (type: `boolean`):

Clear Dataset before insert/update.

## `dev_no_strip` (type: `boolean`):

💡 Keep/Save empty values <i><code>(NULL, FALSE, empty ARRAY, empty OBJECT, empty STRING)</code></i>

## Actor input object example

```json
{
  "query": [
    "Warp drive"
  ],
  "limit": 5,
  "dev_proxy_config": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# 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 = {
    "query": [
        "Warp drive"
    ],
    "limit": 5,
    "dev_proxy_config": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("jupri/target-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 = {
    "query": ["Warp drive"],
    "limit": 5,
    "dev_proxy_config": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("jupri/target-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 '{
  "query": [
    "Warp drive"
  ],
  "limit": 5,
  "dev_proxy_config": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call jupri/target-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jupri/target-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/0B5cm65GuThvdONgh/builds/JekcJfBdG6fMPa6dM/openapi.json
