Pull Newest Products from Glamorique

Site glamorique.shopTask pull-newest-products-for-promoVersion v4Updated Oct 19, 2026Category ecommerce

Retrieve and identify the newest products from Glamorique's Shopify catalog or a specified collection for promotional use, using only products currently exposed by the store. This skill was captured from a live agent session on glamorique.shop 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.

Retrieve the most recently published products from Glamorique's live Shopify catalog or a named collection, including fields needed for promotional use. The default result is the three newest products; when a collection is specified, restrict the result to products currently returned by that collection's Shopify JSON endpoint.

Use Cases

Use when a caller needs current products from Glamorique's catalog or collections, especially when promotional output must contain only products presently exposed by the site.

Automation Flow

  1. Build the direct Shopify JSON URL, without visiting the homepage or collection grid:
    • Entire catalog: https://glamorique.shop/collections/all/products.json?limit=250
    • Named collection: https://glamorique.shop/collections/{collection-handle}/products.json?limit=250
    • Newly listed collection: https://glamorique.shop/collections/new-and-necessary/products.json?limit=250
  2. Optional collection handles confirmed on the site include accessories, new-and-necessary, sale, mystery-boxes, under-30, and best-sellers.
  3. In the same browser call, navigate to the selected URL and run this evaluate() function on the loaded JSON document:
(() => {
  try {
    const data = JSON.parse(document.body.innerText);
    const products = Array.isArray(data.products) ? data.products : [];
    const timestamp = p => p.published_at || p.created_at || '';
    const newest = products
      .slice()
      .sort((a, b) => timestamp(b).localeCompare(timestamp(a)));

    return {
      count: products.length,
      products: newest.map(p => ({
        id: p.id ?? null,
        title: p.title ?? null,
        handle: p.handle ?? null,
        created: p.created_at ?? null,
        published: p.published_at ?? null,
        price: p.variants?.[0]?.price ?? null,
        image: p.images?.[0]?.src ?? null,
        url: p.handle ? `https://glamorique.shop/products/${p.handle}` : null
      }))
    };
  } catch (e) {
    return { error: String(e), sample: document.body.innerText.slice(0, 300) };
  }
})()
  1. If the response can exceed 250 products, request additional Shopify-supported pages, combine their products arrays, then sort the combined set before selecting the newest three.

Possible Friction Points

  • Glamorique exposes live Shopify collection contents through /collections/{handle}/products.json; this avoids collection-grid markup and duplicate product links.
  • The JSON response is rendered as raw JSON in document.body.innerText, not as a normal product-grid page.
  • Sort descending by published_at, falling back to created_at when publication time is absent.
  • The new-and-necessary collection page is at /collections/new-and-necessary; use its JSON counterpart when the request refers to newly listed products.
  • Use each product's handle for its canonical URL; do not infer URLs from titles.
  • Collection-grid pages may require delays and expose mixed navigation/content text; prefer the JSON endpoint for reliable product-only extraction.
  • The collection endpoint is the source of truth for ensuring promotional products are currently present on the site.

Call it

GET https://production-sfo.browserless.io/skills?token=TOKEN-HERE&domain=glamorique.shop&task=pull-newest-products-for-promo