Amazon

search-products

amazon.com · Cowork
Download for Coworkthe skill folder, zipped
How to use it in Coworkonce per skill
Download the skill (.zip)

One .zip per skill. Inside: SKILL.md with the intent and the frontmatter, and the code that runs in the page.

Open Skills in Cowork

Settings → Personalize → Skills. This is Cowork's own skill library, shared across every chat.

Add → pick the .zip

Click Add and choose the file you just downloaded. Cowork installs it once; no CLAUDE.md, no per-project setup.

Ask in plain language

The skill stays available in every session. Cowork runs it in your own Chrome, riding the session you are already signed into.

Side effectread
Authnone (no login needed; an open amazon.com tab supplies the origin and session)
Needsnavigate · evaluate
Summary

Search Amazon products by keyword, returning title, price, rating and reviews.

Params
{"query":"string, REQUIRED (search text, e.g. \"laptop stand\")","page":"int (optional, default 1)"}
Returns
{"count":"int","query":"string","page":"int","results":"array of { asin, title, url, price, rating, reviews, image, sponsored }"}
SKILL.md65 lines

amazon-search-products

Searches products by keyword. Each result's asin is what amazon-get-product takes, the first step of the chain. Resolves in a single bridge call: the extractor fetches the page same-origin and parses it, so the params actually drive the request and no page is opened.

The extractor lives as text in the site's localStorage (key amazon-search-products) and is rebuilt on each call with synchronous eval. It is stored once and then persists across navigation and browser restarts, so on every run except the first it is already there.

Default action: just call (step 1). The call itself reports NEEDS_STORE when the extractor is missing or out of date, only then do you store it (step 2) and call again.

Versioning. The stored extractor is gated by VER (must match the version in the frontmatter above). Both snippets carry VER = "1", keep them in sync with the frontmatter. When evaluate.js changes, bump version and VER in both snippets: the next call sees the mismatch, returns NEEDS_STORE, and re-stores automatically. Storage stays at two keys (amazon-search-products and amazon-search-products:ver), overwritten each store, versions never accumulate.

1. Call (do this every run, params only, single bridge call)

await (() => {
  const KEY = "amazon-search-products", VER = "1";
  const s = localStorage.getItem(KEY);
  if (!s || localStorage.getItem(KEY + ":ver") !== VER) return 'NEEDS_STORE';
  const fn = eval('(' + s + ')');
  return fn(document, { query: "laptop stand" });
})()

Returns the matching products (~22 per page). If it returns the string 'NEEDS_STORE', the extractor is missing or stale in this browser → do step 2 once, then run this exact call again.

Run this snippet verbatim. Never add an await before the eval, only the outer await is allowed.

Any amazon.com tab works, the extractor fetches what it needs and never reads the open page. The tab only supplies the origin and the session.

2. Store (only when step 1 returned NEEDS_STORE; persists until localStorage is cleared)

From any amazon.com tab, evaluate the following with the bridge, replacing <FN> with the contents of evaluate.js (the ( async (root, params) => { ... } ) function). Keep VER equal to the call snippet's:

(() => {
  const KEY = "amazon-search-products", VER = "1";
  const fn = (<FN>);
  localStorage.setItem(KEY, String(fn));
  localStorage.setItem(KEY + ":ver", VER);
  return 'stored';
})()

Returns "stored". The extractor passes through the model only here, once. Then go back to step 1.

Sponsored results

Amazon mixes ads into the grid; each result carries a sponsored flag. The first hits are frequently ads, so filter on sponsored: false when you want organic ranking.

Session locale

Text and currency follow the session, not this skill: the same call returns $ from a US session and ARS/Spanish from an Argentine one (verified). Prices come back as display strings exactly as amazon.com renders them, parse them against the currency you see, and never assume USD.

Errors

  • NEEDS_STORE → extractor missing or version-mismatched in this browser; run step 2 once, then retry step 1.
  • missing_params: query is required → pass a search text.
  • blocked → the site served a bot check instead of content. Open amazon.com in the tab, clear the check by hand, and retry.
  • tool-broken → the markup changed; the selectors need recapturing.
  • request_failed → no amazon.com tab open, or the call ran cross-origin.

Success assertion

{ "type": "json", "jsonPath": "count" }