· 7 years ago · Apr 12, 2018, 08:38 PM
1$consumer_key = getenv('DISCOGS_CONSUMER_KEY');
2$secret_key = getenv('DISCOGS_CONSUMER_SECRET');
3$options = array('http' => array('user_agent' => 'Example/alpha +https://example.com'));
4$context = stream_context_create($options);
5$results = file_get_contents('https://api.discogs.com/database/search?q='.$term.'&key='.$consumer_key.'&secret='.$secret_key.'&per_page=10', false, $context);