WebScrapingAPI Docs
Retailer APIsTarget Search APITarget Search Types

Target Product

Scrape Target products in real time with the Target Search API.

Collect product details from Target using a product URL or ID. Use engine=target, type=product, and async=false for synchronous requests. This is the default mode: the API waits up to 120 seconds in total, including any internal job processing, and returns HTTP 200 with results when collection finishes.

If an accepted job is still running at the deadline, the API returns HTTP 504 with a snapshot_id. The job continues; retrieve that existing job instead of submitting it again.

Product inputs

ParameterRequiredTypeDescription
urlOne product locatorstringA Target product URL on www.target.com or target.com.
product_idOne product locatorstringTarget product ID, such as A-89846564 or 89846564. Use this instead of url.
zipcodeNostringFive-digit US ZIP code for localized product information.
all_variationsNobooleanCollect available product variations.

The product ID appears at the end of a Target product URL. For example, https://www.target.com/p/-/A-89846564 identifies product A-89846564.

Send GET for a single product. To collect a batch, send POST with a JSON array of input objects and put api_key, engine, type, and execution options in the query string. See all parameters for discovery modes and batch limits.

Code samples

These examples request one product synchronously and allow 125 seconds for the response. Replace <YOUR_API_KEY> with your WebScrapingAPI key and run the code on your server. Read the response body even on HTTP errors so you can recover an accepted job's snapshot_id.

curl --get "https://ecom.webscrapingapi.com/v1" \
  --data-urlencode "api_key=<YOUR_API_KEY>" \
  --data-urlencode "engine=target" \
  --data-urlencode "type=product" \
  --data-urlencode "product_id=A-89846564" \
  --max-time 125 --fail-with-body
const API_KEY = "<YOUR_API_KEY>";
const SCRAPER_URL = "https://ecom.webscrapingapi.com/v1";

const params = new URLSearchParams({
  api_key: API_KEY,
  engine: "target",
  type: "product",
  product_id: "A-89846564",
});

const response = await fetch(`${SCRAPER_URL}?${params}`, {
  signal: AbortSignal.timeout(125_000),
});
const data = await response.text();

console.log(data);
import requests

API_KEY = "<YOUR_API_KEY>"
SCRAPER_URL = "https://ecom.webscrapingapi.com/v1"

PARAMS = {
    "api_key": API_KEY,
    "engine": "target",
    "type": "product",
    "product_id": "A-89846564",
}

response = requests.get(SCRAPER_URL, params=PARAMS, timeout=125)

print(response.text)
<?php

$apiKey = '<YOUR_API_KEY>';
$scraperUrl = 'https://ecom.webscrapingapi.com/v1';

$query = http_build_query([
    'api_key' => $apiKey,
    'engine' => 'target',
    'type' => 'product',
    'product_id' => 'A-89846564',
]);

$context = stream_context_create([
    'http' => ['timeout' => 125, 'ignore_errors' => true],
]);
$response = file_get_contents("{$scraperUrl}?{$query}", false, $context);

echo $response;
package main

import (
    "fmt"
    "io"
    "net/http"
    "net/url"
    "time"
)

func main() {
    apiKey := "<YOUR_API_KEY>"
    baseURL := "https://ecom.webscrapingapi.com/v1"

    params := url.Values{}
    params.Add("api_key", apiKey)
    params.Add("engine", "target")
    params.Add("type", "product")
    params.Add("product_id", "A-89846564")

    req, err := http.NewRequest("GET", baseURL+"?"+params.Encode(), nil)
    if err != nil { panic(err) }
    client := &http.Client{Timeout: 125 * time.Second}
    res, err := client.Do(req)
    if err != nil { panic(err) }
    defer res.Body.Close()

    body, err := io.ReadAll(res.Body)
    if err != nil { panic(err) }
    fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.time.Duration;

public class Main {
    public static void main(String[] args) throws Exception {
        String apiKey = "<YOUR_API_KEY>";
        String url = "https://ecom.webscrapingapi.com/v1"
            + "?api_key=" + URLEncoder.encode(apiKey, StandardCharsets.UTF_8)
            + "&engine=target"
            + "&type=product"
            + "&product_id=A-89846564";

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(125))
            .GET()
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient().send(
            request,
            HttpResponse.BodyHandlers.ofString()
        );

        System.out.println(response.body());
    }
}
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var apiKey = "<YOUR_API_KEY>";
        var url = "https://ecom.webscrapingapi.com/v1"
            + "?api_key=" + WebUtility.UrlEncode(apiKey)
            + "&engine=target"
            + "&type=product"
            + "&product_id=A-89846564";

        using var client = new HttpClient { Timeout = TimeSpan.FromSeconds(125) };
        var response = await client.GetAsync(url);
        var body = await response.Content.ReadAsStringAsync();

        Console.WriteLine(body);
    }
}
require "net/http"
require "uri"

api_key = "<YOUR_API_KEY>"
uri = URI("https://ecom.webscrapingapi.com/v1")
uri.query = URI.encode_www_form({
  api_key: api_key,
  engine: "target",
  type: "product",
  product_id: "A-89846564",
})

response = Net::HTTP.start(uri.host, uri.port, use_ssl: true,
                          open_timeout: 125, read_timeout: 125) do |http|
  http.get(uri.request_uri)
end

puts response.body

Product data

Completed requests expose product records in results. Product fields depend on what Target exposes for the requested product and location; optional fields may be empty or absent. Prices and availability can change between requests.

FieldDescription
urlProduct page URL.
product_idTarget product identifier.
titleProduct name.
product_brandProduct brand when available.
product_description, manufacturer_descriptionProduct description and manufacturer details.
initial_price, final_price, currencyAvailable list price, current price, and currency.
price, sale_price, discount, price_rangeAdditional pricing and discount fields.
rating, reviews_countAvailable aggregate review information.
images, image_urlProduct images and the primary image URL.
is_available, availability, availability_text, availability_dateAvailability flag, status, page text, and expected availability date.
product_id, tcin_id, item_number, upc, upc_normalization, group_idProduct and group identifiers.
variations, variants, product_variant, variant_attributes, listing_has_variationsAvailable variants and current variant attributes.
product_specifications, fit_and_sytle, dimensions, item_weightSpecifications, fit and style, dimensions, and weight. The fit_and_sytle field uses this exact spelling.
breadcrumbs, breadcrumb_text, category_urls, related_categoriesCategory information.
offers, promotion_fulltext, find_alternativePromotions and alternative products.
seller_name, seller_url, seller_privacy_policy, seller_tos, retailerSeller and retailer details.
shipping_returns_policy, return_policy, return_window, shipping_weight, shipping_dimensionsShipping and return information.
customer_reviews, q&a, amount_of_stars, recommendations, what_customers_said, summary_of_reviews, review_images, reviews_relatedAvailable reviews, questions, answers, and review summaries. Access q&a with bracket notation in code.
zipcode, target_countries, store_country, is_available_binaryLocation and normalized availability fields.
timestamp, inputCollection timestamp and the submitted input, when returned.
error, error_code, warning, warning_codeIndividual input errors or warnings, when returned.

Use custom_output_fields to request a subset of supported fields, for example url|product_id|title|final_price|currency. Unknown field names are rejected. URL-encode the query value when building a request.

This illustrative response shows a subset of fields and is not a current price quote:

{
  "results": [
    {
      "url": "https://www.target.com/p/-/A-89846564",
      "product_id": "89846564",
      "title": "Example product",
      "final_price": 29.99,
      "currency": "USD",
      "is_available": true
    }
  ]
}

Inspect returned records for errors and warnings, including cases where a product no longer exists. See API errors for request-level failures.

Synchronous timeouts and recovery

A synchronous HTTP 200 response contains results. If an accepted job has not finished within the 120-second total wait, the API returns HTTP 504 with this structure. The snapshot ID and error text below are illustrative:

{
  "error": "The synchronous wait expired. Retrieve the existing snapshot instead of submitting again.",
  "error_code": "target_sync_timeout",
  "snapshot_id": "s_example_snapshot",
  "status": "running"
}

Save snapshot_id and use GET with engine=target, type=progress, and that ID to check progress, or type=snapshot to retrieve completed records. Use the same API key and omit the product inputs. See the retrieval examples in all eight languages.

HTTP statuserror_codeJob statusWhat to do
504target_sync_timeoutrunningThe accepted job continues. Poll its existing snapshot ID.
502target_job_failedfailedThe job failed. Stop polling and inspect the error.
502target_snapshot_unavailablerunningThe results could not be retrieved. Retry progress or result retrieval using the same snapshot ID.

Submissions initially use one credit per input object. Confirmed failed inputs are refunded automatically after collection completes; mixed batches receive partial refunds. A synchronous timeout leaves the job pending and does not itself trigger a refund. Progress and result retrieval consume zero additional credits, and you do not need to poll for a refund to be processed. Do not automatically resubmit the product request: another submission can create another job and consume more credits. If your connection ends before an ID is received, acceptance may be unknown; do not automatically resubmit in that case either.

On this page