Find Products on Target

Site target.comTask find-a-productVersion v3Updated Nov 20, 2026Category shopping

Search Target.com for products, resolve TCINs, optionally verify PDP fulfillment, and set or inspect a session store ZIP code when local availability is needed. This skill was captured from a live agent session on target.com and is published here as a reusable recipe for agents.

NoteSelectors and URL schemes drift as sites change. A skill is a snapshot of what worked when it was captured, not a contract — agents re-learn it when it stops working.

Given a free-text Target product query, return genuine matching product summaries with title, brand, price, original price, rating, rating count, TCIN, canonical URL, image URL, and optional store-scoped fulfillment signals. The workflow can verify a resolved PDP and configure a caller-supplied ZIP code for local pickup or delivery context. It is read-only with respect to cart and purchase state.

Use Cases

  • Search Target for one or more products by description, brand, model, or attributes.
  • Return stable TCINs and canonical product URLs.
  • Paginate or sort a Target product collection.
  • Verify fulfillment, pickup, shipping, delivery, price, returns, or store-specific availability on a PDP.
  • Set the Target session's store-location ZIP code when the caller supplies a postal code.
  • Use the browser-rendered search page when the search request or its required parameters are unavailable.

Automation Flow

  1. For each {query}, open https://www.target.com/s?searchTerm={URL-encoded-query}. Wait for the grid. In the loaded page, use performance.getEntriesByType('resource').map(entry => new URL(entry.name)).find(url => url.origin === 'https://redsky.target.com' && url.pathname.endsWith('/plp_search_v2') && url.searchParams.get('keyword') === query) to identify its search request (query is the safely encoded JavaScript string for the caller's search term). Read key and pricing_store_id from that URL's searchParams. If either is missing, use step 5. Never hard-code, log, or return the key.
  2. Use the search response from the current browser session, or reuse the observed request there for additional pages. Keep the observed key, channel, keyword, page, visitor_id, and pricing_store_id. pricing_store_id controls localized pricing; store_ids controls availability. Only scope availability to a specific store when requested, and use a store ID observed in the session.
  3. Parse data.search.search_response. Require a nonempty facet_list before treating data.search.products[] as genuine results. Report metadata.auto_corrected_keyword when present. Paginate with offset=0,24,48,...; do not use page_number.
  4. Extract products from data.search.products[], preferably requiring __typename === "ProductSummary". Read the TCIN from the API object or product URL; never infer an opaque ID from a name.
  5. If the search response or required parameters are unavailable, run the browser extractor below on the search page already opened in step 1. Dismiss any Health Data Consent dialog via its visible Continue shopping control, then wait for the grid.
  6. For PDP verification, navigate directly to https://www.target.com/-/A-{tcin} or the known canonical buy_url.
  7. When a caller supplies {postal-code} for local fulfillment, use the shortest available PDP flow: click button#zip-code-id-btn when present; otherwise click #web-store-id-msg-btn. In the resulting store/location dialog, fill input#zip-code-city-or-state with {postal-code} and submit using the dialog's accessible Continue, Apply, Save, or Done control. Wait for the location state to settle. Do not claim that the ZIP was accepted unless the resulting page or dialog exposes the postal code or updated store context.
  8. Run the PDP/store evaluator below after location selection. Never add to cart, navigate to checkout, or submit an order.

Browser search-page extractor

(() => {
  const text = e => (e?.innerText || e?.textContent || e?.getAttribute('aria-label') || '').replace(/\s+/g, ' ').trim();
  const cards = [...document.querySelectorAll('[data-test="@web/site-top-of-funnel/ProductCardWrapper"], [data-test*="ProductCardWrapper"]')];
  const products = cards.map(card => {
    const link = card.querySelector('a[href*="/-/A-"], a[href*="/p/"]');
    const href = link?.href || '';
    const match = href.match(/(?:\/-\/A-|A-)(\d+)/i);
    return {
      tcin: match?.[1] || null,
      title: text(card.querySelector('[data-test="product-title"], [data-test*="product-title"]')) || text(link),
      price: text(card.querySelector('[data-test="product-price"], [data-test*="product-price"]')) || null,
      rating: text(card.querySelector('[data-test="ratings"], [data-test*="rating"]')) || null,
      product_url: href || null,
      card_text: text(card).slice(0, 1200)
    };
  }).filter(p => p.tcin || p.title || p.product_url);
  return {url: location.href, products};
})()

PDP, ZIP-code, and fulfillment extractor

Run this on the loaded PDP after any ZIP-code interaction has settled:

(() => {
  const text = e => (e?.innerText || e?.textContent || e?.getAttribute('aria-label') || '').replace(/\s+/g, ' ').trim();
  const tcin = (location.href.match(/(?:\/-\/A-|A-)(\d+)/i) || [])[1] || null;
  const dialog = document.querySelector('[role="dialog"]');
  const zipInput = document.querySelector('input#zip-code-city-or-state');
  const zipValue = zipInput?.value || null;
  const body = text(document.body);
  const pick = document.querySelector('#PICKUP');
  const ship = document.querySelector('#SHIPPING');
  const delivery = document.querySelector('#DELIVERY');
  const returnsEl = document.querySelector('#ShippingAndReturns-accordion-scroll-id');
  const storeButton = document.querySelector('#web-store-id-msg-btn, #zip-code-id-btn');
  const prices = []; const seen = new Set();
  for (const e of document.querySelectorAll('span, div, p, h2, h3')) {
    const t = text(e);
    if (t.includes('$') && t.length < 60 && !seen.has(t)) {
      seen.add(t); prices.push({text: t, test: e.getAttribute('data-test')});
      if (prices.length >= 25) break;
    }
  }
  const postal = body.match(/\b\d{5}(?:-\d{4})?\b/);
  const stock = /[0-9]+ in stock|Limited stock|Only [0-9]+ left/i.exec(body);
  return {
    url: location.href,
    tcin,
    title: text(document.querySelector('#pdp-product-title-id, [data-test="product-title"], h1')),
    store_selector: text(storeButton) || null,
    location_dialog_open: !!dialog,
    zip_input_present: !!zipInput,
    zip_value: zipValue,
    visible_postal_code: postal ? postal[0] : null,
    pickup: pick ? {text: text(pick), aria: pick.getAttribute('aria-label') || null} : null,
    shipping: ship ? text(ship) : null,
    delivery: delivery ? text(delivery) : null,
    fulfillment: text(document.querySelector('[aria-label="Fulfillment"]')) || null,
    prices,
    stock_signal: stock ? stock[0] : null,
    returns: returnsEl ? text(returnsEl).slice(0, 2000) : null,
    store_context: /Pickup at/i.test(body) ? body.match(/.{0,120}Pickup at.{0,500}/i)?.[0] || null : null
  };
})()

API product mapping

Map .tcin, .item.product_description.title after HTML-entity decoding, .item.primary_brand.name, .price.formatted_current_price, .price.formatted_comparison_price, .ratings_and_reviews.statistics.rating.average, .ratings_and_reviews.statistics.rating.count, .item.enrichment.buy_url, .item.enrichment.image_info.primary_image.url, and .desirability_cues[].display.

Possible Friction Points

  • Target product pages use opaque numeric TCINs such as /-/A-{tcin}. Resolve them from an API object, search-result href, or caller-supplied URL; never guess them.
  • pricing_store_id and store_ids are independent: the former affects pricing and the latter scopes availability.
  • The ZIP/store selector has more than one observed entry control. button#zip-code-id-btn can open the postal-code flow directly; #web-store-id-msg-btn is another PDP store-selector control.
  • The observed postal-code field is input#zip-code-city-or-state. Dialog button labels and generated descendants vary, so use accessible names such as Continue, Apply, Save, or Done rather than a generated button selector.
  • A ZIP-code field being opened is not proof that the location was saved. Confirm the value or resulting store/location context after submission.
  • PDP fulfillment sections commonly use #PICKUP, #SHIPPING, and #DELIVERY; missing sections do not imply availability.
  • A cold session may show a Health Data Consent dialog; dismiss its accessible Continue shopping control before interacting with the page.
  • If Target presents a CAPTCHA or verification challenge, report that the search is blocked rather than retrying the request or bypassing the challenge.
  • The redsky API may return recommendation padding when no genuine matches exist; check facet_list.
  • Target titles can contain raw HTML entities; decode them before returning results. Preserve null brand, rating, and price fields, including See price in cart.
  • Never add to cart, navigate to checkout, submit an order, or claim pickup eligibility without explicit PDP evidence.

Example Result

{
  "url": "https://example.com/-/A-123",
  "tcin": "123",
  "title": "Example Title",
  "store_selector": null,
  "location_dialog_open": false,
  "zip_input_present": false,
  "zip_value": null,
  "visible_postal_code": null,
  "pickup": null,
  "shipping": null,
  "delivery": null,
  "fulfillment": null,
  "prices": [
    {
      "text": "$12",
      "test": null
    }
  ],
  "stock_signal": null,
  "returns": null,
  "store_context": null
}

Call it

GET https://production-sfo.browserless.io/skills?token=TOKEN-HERE&domain=target.com&task=find-a-product