ParkSquare.Gracenote
2.0.14
It no longer seems possible to get a developer API key for Gracenote, so we recommend you switch to Discogs for all your music metadata needs. Our Nuget package provides full, first-class support.
dotnet add package ParkSquare.Gracenote --version 2.0.14
NuGet\Install-Package ParkSquare.Gracenote -Version 2.0.14
<PackageReference Include="ParkSquare.Gracenote" Version="2.0.14" />
paket add ParkSquare.Gracenote --version 2.0.14
#r "nuget: ParkSquare.Gracenote, 2.0.14"
// Install ParkSquare.Gracenote as a Cake Addin #addin nuget:?package=ParkSquare.Gracenote&version=2.0.14 // Install ParkSquare.Gracenote as a Cake Tool #tool nuget:?package=ParkSquare.Gracenote&version=2.0.14
C# Gracenote Music Database Library
Background
This library provides access to the Gracenote music database, with support for track, album, artist and cover artwork searching.
Given the difficulty in obtaining new keys to access the Gracenote APIs, we will no longer be actively developing or supporting this Nuget package from 1 May 2021. Most of the original Gracenote Developer links are now dead. We recommend you use Discogs instead for your programmatic music metadata needs, using our Discogs Nuget Package.
Getting Started
The Gracenote Developer license is free for non-commercial use.
This C# library supports ALBUM_SEARCH and ALBUM_FETCH, with all options available that are exposed by the Gracenote API itself. For more information, visit the Gracenote Developer Zone.
To begin development, the first thing you need to do is get a Client ID - a Gracenote API key that authorizes you to make calls to the Gracenote service.
See Gracenote Developer Zone for further information. Once you have a Client ID, calling the Web API using
ParkSquare.Gracenote
is really easy.
Create a GracenoteClient
First, instantiate a new GracenoteClient
object, passing in your API key:
var client = new GracenoteClient("1111111-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
You can now perform an album search, or an album fetch.
Search for an Album
This perform a search of the Gracenote database. It is possible to specify any combination of Album Title, Artist or Track Title. There are three search modes available:
- Default - Returns all matching albums
- BestMatch - Returns a single album that best matches your search criteria
- BestMatchWithCover - As per BestMatch but also return the URL to an album art image, if available.
There are various other options that can include additional information about the album in the search results. Multiple flags can be specified.
var x = client.Search(new SearchCriteria
{
AlbumTitle = "Use Your Illusion",
Artist = "Guns 'n' Roses",
SearchMode = SearchMode.BestMatchWithCoverArt,
SearchOptions = SearchOptions.Mood | SearchOptions.Tempo
});
A wider search for all albums by the specified artist, with an image of the artist instead of the album artwork (if available):
var y = client.Search(new SearchCriteria
{
Artist = "Pet Shop Boys",
SearchMode = SearchMode.BestMatchWithCoverArt,
SearchOptions = SearchOptions.Cover | SearchOptions.ArtistImage
});
Get Album Metadata
This is used when you already have the GracenoteId
for an album and just want to retrieve it.
// Fetch an album using a known Gracenote ID
var x = client.Search("99337157-E1ED6101A3666CFD7D799529ED707E0F");
Download Album Artwork
If you have specified that you want artwork returned, and artwork is available, then you will see a collection of Artwork
objects available to you. These will generally contain URLs to a CDN containing the image.
You can call the Download()
method on any Artwork
object to retrieve the image and save it to your local file system.
var test = client.Search(new SearchCriteria
{
Artist = "Guns 'n' Roses",
TrackTitle = "November Rain",
SearchMode = SearchMode.BestMatchWithCoverArt,
SearchOptions = SearchOptions.ArtistImage
});
test.Albums.First().Artwork.First().Download("C:\temp\AlbumArt.jpg");
Paging
Where a search yields many results, or it is desirable to page through the results, you can specify a start item and end item in your request. For example, this will return only the 10th to 14th results in the response:
var k = client.Search(new SearchCriteria
{
Artist = "Guns 'n' Roses",
Range = new Range(10, 14)
});
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
2.0.14 | 927 | 11/22/2021 | |
2.0.12 | 782 | 11/18/2021 | |
2.0.6 | 938 | 5/16/2021 | |
2.0.5 | 877 | 4/18/2021 | |
2.0.3 | 1,022 | 4/18/2021 | |
2.0.2 | 1,320 | 7/2/2019 | |
2.0.1 | 1,162 | 6/5/2019 | |
2.0.0 | 1,162 | 6/4/2019 | |
1.6.4 | 1,668 | 7/4/2018 | |
1.6.3 | 2,008 | 1/7/2017 | |
1.6.2 | 1,578 | 1/7/2017 | |
1.6.1 | 1,540 | 1/7/2017 | |
1.6.0 | 1,559 | 1/7/2017 | |
1.5.0 | 1,511 | 1/7/2017 | |
1.4.0 | 1,804 | 8/23/2016 | |
1.3.0 | 3,024 | 2/19/2015 | |
1.2.0 | 2,041 | 9/6/2014 | |
1.1.0 | 1,930 | 5/28/2014 | |
1.0.3 | 1,772 | 8/23/2016 | |
1.0.2 | 1,958 | 4/29/2014 | |
0.9.0 | 1,850 | 4/25/2014 |