calliostro/php-discogs-api
Lightweight Discogs API client for PHP 8.1+ with clean, modern APIs and Guzzle support. Access public artist/release/label data without registration, and enable search plus user features with consumer credentials. Includes optional Symfony Bundle integration.
All versions below 2.1.3 were developed on the master branch.
For legacy support of 2.x versions, see the legacy/v2.x branch.
This library is based on the excellent work of:
v4.0.0 represents a fundamental architectural overhaul. This is not an incremental update – it's a complete rewrite prioritizing developer experience, type safety, and minimal code footprint.
DiscogsApiClient → DiscogsClientClientFactory → DiscogsClientFactoryAll 60 API methods renamed following consistent verb + noun patterns:
artistGet() → getArtist()artistReleases() → listArtistReleases()releaseGet() → getRelease()userEdit() → updateUser()collectionFolders() → listCollectionFolders()inventoryGet() → getUserInventory()listingCreate() → createMarketplaceListing()ordersGet() → getMarketplaceOrders()Revolutionary method signatures eliminate array parameters entirely:
// v3.x (OLD)
$artist = $discogs->artistGet(['id' => 5590213]);
$search = $discogs->search(['q' => 'Billie Eilish', 'type' => 'artist', 'per_page' => 50]);
$collection = $discogs->collectionItems(['username' => 'user', 'folder_id' => 0]);
// v4.0 (NEW) - Clean parameters
$artist = $discogs->getArtist(5590213);
$search = $discogs->search(query: 'Billie Eilish', type: 'artist', perPage: 50);
$collection = $discogs->listCollectionItems(username: 'user', folderId: 0);
Complete authentication rewrite with proper security standards:
createWithToken() → createWithPersonalAccessToken()// v3.x (OLD)
$discogs = ClientFactory::createWithToken('token');
// v4.0 (NEW)
$discogs = DiscogsClientFactory::createWithPersonalAccessToken('key', 'secret', 'token');
getArtist(123) vs getArtist(['id' => 123])DiscogsClient and DiscogsClientFactory handle everythingnull values rejected for required parameters__toString() method automatically convertedThis is a complete breaking change. Every method call in your codebase will need updating:
DiscogsApiClient → DiscogsClient, ClientFactory → DiscogsClientFactoryv4.0 prioritizes long-term developer experience:
OAuthHelper class for full authorization flowsDiscogsClient and DiscogsClientFactory for better claritygetRequestToken() – Get temporary request token for authorization flowgetAuthorizationUrl() – Generate user authorization URLgetAccessToken() – Exchange request token for permanent access tokencreateWithPersonalAccessToken() – Clean 3-parameter method for Personal Access TokenscreateWithOAuth() – Refined 4-parameter method for OAuth 1.0a tokens only3.1.0collectionFolder() method annotation (replaced with working collectionFolderGet())ClientFactory and DiscogsApiClient$client->artistGet(['id' => '5590213'])Discogs\* to Calliostro\Discogs\*squizlabs/php_codesniffer with friendsofphp/php-cs-fixer for code style checking.php-cs-fixer.php configuration file with PSR-12 rulescs and cs-fix now use php-cs-fixer instead of phpcs/phpcbfmain, legacy/v2.x, and feature/** branchesgetUserLists() – Get user's listsgetLists() - Get specific list itemsgetWantlist() - Get user's wantlistHow can I help you explore Laravel packages today?