Discogs database search
Search the Discogs music database (releases, masters, artists, labels) by keyword or by any field: title, artist, label, genre, style, country, year, format, catalog number, barcode, track or credit. Each result has its id, type, title, year, country, format, label, genre, style, catno, barcode, master_id, url, community have/want counts and the record in raw (image links are not included). total is the site's match count. Pass next_page back as page; null on the last page (at most 200 pages).
Every response includes credits_used: the credits this call cost.
Part of the Discogs API: 13 endpoints with prices, use cases and example responses.
Parameters
| name | type | description |
|---|---|---|
q | string | Keywords (or use the field filters below; at least one is needed). Example: nirvana nevermind |
type | release | master | artist | label | Only this kind of entry. |
title | string | Title. |
release_title | string | Release title. |
artist | string | Artist. |
anv | string | Artist name variation. |
credit | string | A credited person or group. |
label | string | Label. |
genre | string | e.g. Rock, Electronic, Jazz. |
style | string | e.g. Grunge, House. |
country | string | Release country, e.g. US, UK, Germany. |
year | string | Release year (4 digits). |
format | string | e.g. Vinyl, CD, Cassette, LP, Album. |
catno | string | Catalog number. |
barcode | string | Barcode. |
track | string | A track title. |
submitter | string | Username of the submitter. |
contributor | string | Username of a contributor. |
limit | integer | Results per page (1-100, default 50). |
page | integer | Page number (1-based). |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/discogs/v1/search?q=nirvana+nevermind&type=release" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/discogs/v1/search",
params={"q": "nirvana nevermind", "type": "release"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/discogs/v1/search");
url.searchParams.set("q", "nirvana nevermind");
url.searchParams.set("type", "release");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).
Example response (real call, trimmed: lists cut to 2 items, long text shortened, raw left out)
{"query": {"q": "nirvana nevermind","type": "release","page": "1","per_page": "50"},"page": 1,"per_page": 50,"total": 1352,"total_pages": 28,"next_page": 2,"count": 50,"results": [{"id": 7097051,"type": "release","title": "Nirvana - Nevermind","year": "2015","country": "Europe","format": ["Vinyl","LP","… 3 more"],"label": ["DGC","Sub Pop","… 10 more"],"genre": ["Rock"],"style": ["Alternative Rock","Grunge"],"catno": "424 425-1","barcode": ["720642442517","0 720642 442517","… 5 more"],"master_id": 13814,"url": "https://www.discogs.com/release/7097051-Nirvana-Nevermind","community": {"want": 13456,"have": 77657}},{"id": 4819086,"type": "release","title": "Nirvana - Nevermind","year": "2013","country": "US","format": ["Vinyl","LP","… 4 more"],"label": ["DGC","Sub Pop","… 11 more"],"genre": ["Rock"],"style": ["Grunge"],"catno": "DGC-24425","barcode": ["BMI","7 20642 44251 7","… 3 more"],"master_id": 13814,"url": "https://www.discogs.com/release/4819086-Nirvana-Nevermind","community": {"want": 5282,"have": 21443}},"… 48 more"],"cached": false,"credits_used": 1}