Skip to content

duck7000/DiscogsPHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

Discogs

PHP library for retrieving CD information from Discogs.
Retrieve most of the information you can see on Discogs page of specific CD.
Search for titles on Discogs by barcode, cd code, artist, album etc.
Get front poster image url.
Search is default for CD.
For each title found by search there are these methods available:

artist()
title()
year() (release year)
label()
country() (release country)
genre()
style()
released() (Discogs release ID)
photo() (front image url)
tracklist() (get track information, tracknumber, track title, track length)
credits()
barcode()
format()

Quick Start

  • If you're not using composer or an autoloader include bootstrap.php.
  • Get some data
$title = new \Discogs\Title($searchTerm);
$artist = $title->artist();
$albumTitle = $title->title();


Installation
============

This library scrapes discogs.com so changes to their site can cause parts of this library to fail.

Get the files with one of:
* Git clone. Checkout the latest release tag.
* [Zip/Tar download]

### Requirements
* PHP >= 7.4 - 8.1 (untested with lower versions)
* PHP cURL extension


Configuration
=============

DiscogsPHP needs no configuration but there are some options in config:

Default user agent
Default search: CD (this can be LP, cassette etc)
Default search limit: 10


Searching for a CD
====================

```php
// include "bootstrap.php"; // Load the class in if you're not using an autoloader
$search = new \Discogs\TitleSearch();
$results = $search->search('Batmobile');

// $results is an array of Titles
// The array will have artist, title, and Discogsid. And a link to the discogs page.

Credits to imdbphp, i used their search part to make this.

About

Search library for CD information

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages