A "track" is a recording of a musical work. A given musical work may have been recorded multiple times, including in live events, cover versions and so on.

Tracks can sometimes be portions of a longer, uninterrupted work. This is quite common within classical pieces, where tracks may delineate the boundaries between different movements.

Querying tracks

GET /20151208/track
POST /20151208/track

The track endpoint allows clients to retrieve metadata about given musical tracks, given search parameters. The parameters are used to query OneMusicAPI's aggregated database of MusicBrainz, Discogs and Wikipedia data.

Queries can be sent as a GET or POST request.

Mandatory parameters for all queries

All queries must contain the following:

user_key
Your API key.

Title query

Title queries allow tracks to be queried according to the track title and artist name.

Mandatory parameters

title
The title of the track that will be returned.
artist
The name of the artist that recorded the track.

Examples

/20151208/track?user_key=myUserKey&title=Pantomime+Horse&artist=Suede

Retrieves information about Pantomime Horse by Suede.

Fingerprint query

OneMusicAPI accepts queries for tracks using Acoustid fingerprints.

Mandatory parameters

track.n.duration
The duration of a track in seconds, where 'n' is an indexing integer used to identify the track within the results.
track.n.fingerprint
The Acoustid fingerprint for a track, where 'n' is an indexing integer which identifies the track in the results. Use the Acoustid 'fp_calc' tool to generate fingerprints.

Examples

/20151208/track?user_key=myUserKey&track.1.duration=255&track.1.fingerprint=AQABz00mRVOLmkqD[...]

Retrieves information about the track with the specified fingerprint.

Optional parameters for all queries

In addition, all queries can be further constrained with the following parameters:

inc
Additional data to return. Basic metadata is always returned, but if inc is set then the following additional items may be retrieved:
images
Return images associated with the releases for this track.
If the requested data is not available, the disc information is still returned.
minCertainty
A number between 0 and 1, relating to the minimum certainty onemusicapi.com must have of the information being correct for this track. The default is 1.
maxResultCount
Number of tracks to return. The default is 10.

Response

Here's an example response:

http://api.onemusicapi.com/20151208/track?title=Wildfire&artist=SBTRKT
[
    {
        "title": "Wildfire",
        "artists": [
            "SBTRKT"
        ],
        "releases": [
            {
                "title": "SBTRKT",
                "artist": "SBTRKT",
                "year": "2011",
                "genre": "bass",
                "media": [
                ],
                "images": [
                    {
                        "url": "http://api.onemusicapi.com/20151208/images/caa/63b4acff-866a-4b80-90fa-9f4a2af3445d/4110790212.jpg",
                        "width": "800",
                        "height": "800"
                    },
                    {
                        "url": "http://api.onemusicapi.com/20151208/images/asin/B004Y6CS8I.jpg",
                        "width": "360",
                        "height": "360"
                    }
                ],
                "uris": [
                    "http://musicbrainz.org/release/63b4acff-866a-4b80-90fa-9f4a2af3445d"
                ],
                "score": 1
            },
            {
                "title": "SBTRKT",
                "artist": "SBTRKT",
                "year": "2011",
                "genre": "bass",
                "media": [
                ],
                "images": [
                    {
                        "url": "http://api.onemusicapi.com/20151208/images/caa/2ffe2124-a770-442a-9a98-f450416cec92/2596669746.jpg",
                        "width": "800",
                        "height": "800"
                    }
                ],
                "uris": [
                    "http://musicbrainz.org/release/2ffe2124-a770-442a-9a98-f450416cec92"
                ],
                "score": 1
            }
        ],
        "uris": [
            "http://musicbrainz.org/recording/1a325657-73bd-4ab9-8660-3bf302e84d42"
        ]
    }
]
comments powered by Disqus
© 2012-2018 elsten software limited, Unit 4934, PO Box 6945, London, W1A 6US, UK | terms and conditions | privacy policy