I'm pleased to announce our major new release: track metadata!

I always felt that once we added tracks to the existing release and artist APIs we'd have a much more complete API. Well, now we have, and we continue to offer our CD and musical image APIs too.

The track database currently comprises over 15m tracks, with information about the track's writers, performers, releases the track is contained on, and more. The tracks can be found using either the track and artist name, or the Acoustid fingerprint for the track.

What is the track API useful for? It's great when you want to look up data for a particular song, not the release it appears on. An example may be if you are working with music collections with lots of miscellaneous tracks, rather than being stored in complete albums.

As ever, the key benefit of using OneMusicAPI is that it's a one stop shop for all of the online free databases. In this case, we pool all the track data out there from MusicBrainz, Discogs and others and serve it through one API, making integration a one-time activity. Even if those free databases change their APIs you are unaffected; we don't shut down APIs used by paying customers!

How to use the tracks API

As we're adding a major new API we've decided to move the API version onwards. The API version is a timestamp and appears in the URLs you query OneMusicAPI with. As above, if you are a paying customer, we won't disable any version you are currently using. We do though encourage you to move to the latest version! The new API version is 20150623.

Let's start with the simplest example: using the track and artist name. Here's an example query:

http://api.onemusicapi.com/20150623/track?user_key=[my key]&title=Free+Satpal+Ram&artist=Asian+Dub+Foundation

This returns:

[
    {
        "title": "Free Satpal Ram",
        "artists": [
            "Asian Dub Foundation"
        ],
        "releases": [
            {
                "title": "Rafi's Revenge",
                "artist": "Asian Dub Foundation",
                "year": "1998",
                "genre": "dub",
                "media": [
                    {
                        "totalDiscs": "1",
                        "position": "1",
                        "tracks": [
                            {
                                "title": "Naxalite",
                                "number": "1",
                                "artists": [
                                    "Asian Dub Foundation"
                                ]
                            },
                            {
                                "title": "Operation Eagle Lie",
                                "number": "10",
                                "artists": [
                                    "Asian Dub Foundation"
                                ]
                            },
                            ...
                        ]
                    }
                ],
                "images": [
                    {
                        "url": "http://api.onemusicapi.com/20150623/images/asin/B000024ZJ0.jpg",
                        "width": "300",
                        "height": "294"
                    }
                ],
                "uris": [
                    "http://musicbrainz.org/release/859087c5-a653-47db-a97a-65022ea1e04f"
                ],
                "position": {
                    "medium": "1",
                    "track": "7"
                },
                "types": [
                    "Album"
                ],
                "score": 1
            },
            ...
            {
                "title": "Time Freeze 1995 / 2007: The Best of Asian Dub Foundation",
                "artist": "Asian Dub Foundation",
                "year": "2007",
                "genre": "dub",
                "media": [
                    {
                        "totalDiscs": "2",
                        "position": "1",
                        "tracks": [
                            {
                                "title": "Rebel Warrior",
                                "number": "1",
                                "artists": [
                                    "Asian Dub Foundation"
                                ]
                            },
                            {
                                "title": "Real Great Britain",
                                "number": "10",
                                "artists": [
                                    "Asian Dub Foundation"
                                ]
                            },
                            ...
                        ]
                    },
                    {
                        "totalDiscs": "2",
                        "position": "2",
                        "tracks": [
                            {
                                "title": "Debris",
                                "number": "1",
                                "artists": [
                                    "Asian Dub Foundation"
                                ]
                            },
                            {
                                "title": "Journey",
                                "number": "10",
                                "artists": [
                                    "Asian Dub Foundation"
                                ]
                            },
                            ...
                        ]
                    }
                ],
                "images": [
                    {
                        "url": "http://api.onemusicapi.com/20150623/images/asin/B000NA1TH0.jpg",
                        "width": "497",
                        "height": "500"
                    }
                ],
                "uris": [
                    "http://musicbrainz.org/release/4e768942-a8b7-48e9-becc-50fd35357cfc"
                ],
                "position": {
                    "medium": "1",
                    "track": "8"
                },
                "types": [
                    "Album",
                    "Compilation"
                ],
                "score": 1
            }
        ],
        "uris": [
            "http://musicbrainz.org/recording/31c57c42-df81-44bc-ad24-29a21602d3ba"
        ]
    }
]

(I've truncated that data heavily).

The other method of querying is using an Acoustid fingerprint. A query such as (again, truncated due to the length of the fingerprint):

http://api.onemusicapi.com/20150623/track?user_key=[my key]&track.1.duration=449&track.1.fingerprint=AQADtEoY...

Gives the same result (assuming the fingerprint is for the same track named above of course!).

Check out the documentation for the track API here.

Other improvements

There are a number of other improvements in this version of OneMusicAPI:

  • Added "type" to release results signifying the type of the release (e.g. album, single etc) (version 20150623 onwards)
  • We now support barcode lookups for releases (version 20140925 onwards)
  • Various performance improvements

To give OneMusicAPI a try all you need to do is sign up and you'll get 250 free queries. Further queries can be purchased on a rolling monthly basis or as a credit top-up.

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