Purpose
Find and extract all marketplace selling listings matching a release, master, artist, album, catalog number, or other Discogs-searchable release text.
When to Use
Use when the caller wants sellers, prices, conditions, shipping origin, or other marketplace offers for a release. The caller may provide a known Discogs master/release ID or only descriptive search text. Optional destination filtering such as shipping to a country may be applied.
Workflow
- Keep the browser session on the configured sticky US proxy for every navigation.
- If the caller already provides a Discogs master ID, go directly to
https://www.discogs.com/sell/list?master_id={master-id}&ships_to={country-code}&limit=250(omitships_towhen no destination filter is requested). Thelimit=250parameter substantially reduces pagination. - If no opaque ID is available, resolve it before constructing the marketplace URL. Navigate directly to
https://www.discogs.com/search/?q={encodeURIComponent(query)}&type=master, then evaluate the search results to collect/master/{id}links. Select the result whose visible title and artist best match{query}; never guess the numeric ID. Build the direct marketplace URL from the selected ID as in step 2. - On the loaded marketplace page, run this
evaluate()extractor:
(() => {
const text = (el) => (el?.textContent || "").replace(/\\s+/g, " ").trim();
const abs = (href) => (href ? new URL(href, location.origin).href : null);
const rows = [
...document.querySelectorAll(
'tr, [data-testid="listing-card"], .marketplace_listing',
),
];
const listings = [];
const seen = new Set();
for (const row of rows) {
const sellerLink = row.querySelector('a[href*="/seller/"]');
if (!sellerLink) continue;
const priceEl = row.querySelector(
'.price, [class*="price"], [data-testid*="price"]',
);
const conditionEl = row.querySelector(
'.item_condition, [class*="condition"], [data-testid*="condition"]',
);
const shipsEl = row.querySelector(
'.seller_info li, .ships_from, [class*="ships"], [class*="location"], [data-testid*="location"]',
);
const titleLink = row.querySelector(
'.item_description a, [class*="description"] a, a[href*="/release/"]',
);
const wholeText = text(row);
const price =
text(priceEl) ||
(wholeText.match(/(?:US\\$|\\$|EUR|GBP|€|£)\\s?[\\d,.]+/) || [])[0] ||
null;
const condition =
(text(conditionEl) || "").replace(/^Media Condition:\s*/i, "") || null;
const listing = {
seller: text(sellerLink),
sellerUrl: abs(sellerLink.getAttribute("href")),
price,
condition,
shipsFrom: text(shipsEl) || null,
title: text(titleLink) || null,
url: abs(titleLink?.getAttribute("href")) || null,
};
const key = [
listing.sellerUrl,
listing.price,
listing.condition,
listing.url,
].join("|");
if (!seen.has(key)) {
seen.add(key);
listings.push(listing);
}
}
const next = document.querySelector(
'a[rel="next"], a[aria-label*="Next"], a[href*="page="]',
);
return {
listings,
nextPage: next ? abs(next.getAttribute("href")) : null,
totalOnPage: listings.length,
};
})();- If the extractor returns a non-null
nextPage, navigate to that absolute URL and run the same extractor, concatenating results and deduplicating by seller URL, price, condition, and listing URL untilnextPageis null. Close the browser session after collection. - If Discogs presents a Cloudflare challenge, solve it once before evaluating or continuing navigation, while retaining the same proxy/session.
Site-Specific Gotchas
- The fastest precise marketplace route is
/sell/list?master_id={master-id}&ships_to={country-code}&limit=250; the master ID is opaque and must be resolved from/search/?q={query}&type=masterwhen absent. - A free-text marketplace URL also exists at
/sell/list?q={query}&ships_to={country-code}, but master-ID URLs are preferable for exact release-family matching and all formats. ships_tois an optional destination-country filter; use the site's country code, such asUS, only when requested.limit=250is an optional page-size parameter, not a guarantee that pagination is unnecessary; follownextPageif present.- Discogs may trigger Cloudflare between search and marketplace navigation. Solve the challenge rather than changing proxy or session.
- Marketplace markup varies between table rows and listing-card layouts. The extractor intentionally supports both; selectors containing
[class*="..."]are pragmatic fallbacks and should be revalidated if Discogs changes its DOM. - Deduplicate listings while stitching pages because the same offer may appear through overlapping or repeated DOM containers.
Expected Output
Return an object with listings, an array of seller-offer objects containing seller, sellerUrl, price, condition, shipsFrom, title, and url; nextPage, the absolute next marketplace URL or null; and totalOnPage. For multi-page results, return the concatenated, deduplicated listings.