When it comes to images, the most common use of OneMusicAPI is in finding front covers for CDs, vinyl and other media, and artist images. But some music collectors also want to collect the back covers, insert images and other otherwise-physical media delivered with a given musical release.

OneMusicAPI allows the discovery of these images using the minImageScore parameter specified when searching for releases. minImageScore is an integer, between 0 and 5. By default it is assumed to mean "5", meaning high quality front covers. However, if you specify a lower number, for example "3", you will also receive other connected images.

Here's an example query for Unknown Pleasures:

http://api.onemusicapi.com/20140925/release?artist=Joy+Division&title=Unknown+Pleasures&inc=images&minImageScore=3&maxResultCount=20&user_key=...

This gives, amongst other release matches:

{
    "title": "Unknown Pleasures",
    "artist": "Joy Division",
    "year": "1990",
    "genre": "Rock",
    "media": [
        {
            "totalDiscs": "1",
            "position": "1",
            "tracks": [
                {
                    "title": "Disorder",
                    "number": "1"
                },
                [...]
            ]
        }
    ],
    "images": [
        {
            "url": "http://api.onemusicapi.com/20140925/images/discogs/1634822/1233581185",
            "width": "600",
            "height": "592"
        }
    ],
    "score": 1
}

And that's the familiar artwork by Peter Saville listed as the release's single image.

However, if we specify minImageScore=3 we get more images:

http://api.onemusicapi.com/20140925/release?artist=Joy+Division&title=Unknown+Pleasures&inc=images&minImageScore=3&maxResultCount=20&user_key=...

This gives:

{
    "title": "Unknown Pleasures",
    "artist": "Joy Division",
    "year": "1990",
    "genre": "Rock",
    "media": [
        {
            "totalDiscs": "1",
            "position": "1",
            "tracks": [
                {
                    "title": "Disorder",
                    "number": "1"
                },
                [...]
            ]
        }
    ],
    "images": [
        {
            "url": "http://api.onemusicapi.com/20140925/images/discogs/1634822/1286882678",
            "width": "511",
            "height": "512"
        },
        {
            "url": "http://api.onemusicapi.com/20140925/images/discogs/1634822/1286882658",
            "width": "512",
            "height": "507"
        },
        {
            "url": "http://api.onemusicapi.com/20140925/images/discogs/1634822/1286882688",
            "width": "512",
            "height": "509"
        },
        {
            "url": "http://api.onemusicapi.com/20140925/images/discogs/1634822/1286882698",
            "width": "512",
            "height": "450"
        },
        {
            "url": "http://api.onemusicapi.com/20140925/images/discogs/1634822/1286882667",
            "width": "502",
            "height": "512"
        },
        {
            "url": "http://api.onemusicapi.com/20140925/images/discogs/1634822/1233581185",
            "width": "600",
            "height": "592"
        }
    ],
    "score": 1
}

This is a 1990 Australian re-release of Unknown Pleasures. As we specified minImageScore=3 we get extra images in the results, including the back cover and an image of the CD:

Unknown Pleasures track listing The Unknown Pleasures CD

This can be useful to present a list of pertinent images for each release, particularly for hardcore music collectors.

Thanks to Rubber Dragon who made the the image above available for sharing.
comments powered by Disqus
© 2012-2024 elsten software limited, Unit 4934, PO Box 6945, London, W1A 6US, UK | terms and conditions | privacy policy