1. Go to this page and download the library: Download ricbra/php-discogs-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$client = Discogs\ClientFactory::factory([]);
$oauth = new GuzzleHttp\Subscriber\Oauth\Oauth1([
'consumer_key' => $consumerKey, // from Discogs developer page
'consumer_secret' => $consumerSecret, // from Discogs developer page
'token' => $token['oauth_token'], // get this using a OAuth library
'token_secret' => $token['oauth_token_secret'] // get this using a OAuth library
]);
$client->getHttpClient()->getEmitter()->attach($oauth);
$response = $client->search([
'q' => 'searchstring'
]);