SearchAPI¶
- class minim.api.discogs.SearchAPI(client: APIClient, /)[source]¶
Bases:
DiscogsResourceAPISearch-related endpoints for the Discogs API.
Note
This class groups search-related endpoints for convenience. Discogs does not provide a dedicated Search API.
Important
This class is managed by
DiscogsAPIClientand should not be instantiated directly.- Parameters:
- clientminim.api._shared.APIClient
API client instance used to make HTTP requests.
Methods
Database > Search: Search for artists, releases, labels, and masters in the Discogs catalog.
- search(query: str | None = None, /, *, resource_type: str | None = None, title: str | None = None, release: str | None = None, artist: str | None = None, artist_variation: str | None = None, track: str | None = None, credit: str | None = None, label: str | None = None, genre: str | None = None, style: str | None = None, release_country: str | None = None, release_format: str | None = None, release_year: int | str | None = None, catalog_number: str | None = None, barcode: str | None = None, submitter: str | None = None, contributor: str | None = None, limit: int | None = None, page: int | None = None) dict[str, Any][source]¶
Database > Search: Search for artists, releases, labels, and masters in the Discogs catalog.
User authentication
- User authentication
Access protected endpoints.
- Parameters:
- querystr; positional-only; optional
Search query.
Example:
"Nirvana".- resource_typestr; keyword-only; optional
Resource type to filter search results by.
Valid values:
"release","master","artist","label".- titlestr; keyword-only; optional
Combined artist and title search field to filter search results by.
Example:
"Nirvana - Nevermind".- releasestr; keyword-only; optional
Release title to filter search results by.
Example:
"Nevermind".- artiststr; keyword-only; optional
Artist name to filter search results by.
Example:
"Nirvana".- artist_variationstr; keyword-only; optional
Artist name variation to filter search results by.
Example:
"Nirvana (US)".- trackstr; keyword-only; optional
Track title to filter search results by.
Example:
"Smells Like Teen Spirit".- creditstr; keyword-only; optional
Release credit to filter search results by.
Example:
"Kurt Cobain".- labelstr; keyword-only; optional
Label name to filter search results by.
Example:
"DGC".- genrestr; keyword-only; optional
Genre to filter search results by.
Example:
"Rock".- stylestr; keyword-only; optional
Style to filter search results by.
Example:
"Grunge".- release_countrystr; keyword-only; optional
Release country to filter search results by.
Example:
"Canada".- release_formatstr; keyword-only; optional
Release format to filter search results by.
Example:
"Album".- release_yearint or str; keyword-only; optional
Release year to filter search results by.
Examples:
1991,"1991".- catalog_numberstr; keyword-only; optional
Catalog number to filter search results by.
Example:
"DGC-24425".- barcodestr; keyword-only; optional
Release barcode to filter search results by.
Example:
"7 2064-24425-2 4".- submitterstr; keyword-only; optional
Username of the Discogs user who submitted the release to filter search results by.
Example:
"milKt".- contributorstr; keyword-only; optional
Username of the Discogs user who contributed to the release’s metadata to filter search results by.
Example:
"jerome99".- limitint; keyword-only; optional
Maximum number of items to return.
Valid range:
1to100.API default:
50.- pageint; keyword-only; optional
Page number. Use with limit to get the next page of items.
Minimum value:
1.API default:
1.
- Returns:
- resultsdict[str, Any]
Page of Discogs metadata for the matching catalog items.
Sample response
{ "pagination": { "items": <int>, "page": <int>, "pages": <int>, "per_page": <int>, "urls": { "first": <str>, "last": <str>, "next": <str>, "prev": <str> } }, "results": [ { "cover_image": <str>, "id": <int>, "master_id": <int>, "master_url": <str>, "resource_url": <str>, "thumb": <str>, "title": <str>, "type": <str>, "uri": <str>, "user_data": { "in_collection": <bool>, "in_wantlist": <bool> } } ] }