Search code examples
c#gracenote

Using Gracenote to get Information about Music Artists, Albums and Tracks


I am developing an application which takes artist's name and lists all of his/her albums titles, I'm trying Gracenote for this, But, The problem is when i retrieve first 100 albums, It says :

ERROR - GCSP: Search error: [22] search: Invalid range START=101: only the first 100 results can be accessed

How can I get an artist's all songs and albums titles?

    int i = 1;
    int j = 20;
    try
    {
        SearchResult gcSearch;
        do
        {
            var gcClient = new GracenoteClient(GracenoteClientId);
            var criteria = new SearchCriteria
            {
                Artist = "Adele",
                SearchMode = SearchMode.Default,
                Range = new Range(i, j)
            };

            gcSearch = gcClient.Search(criteria);
            foreach (Album album in gcSearch.Albums)
            {
                _tempList.Add(album);
            }
            i = j + 1;
            j = j + 20;
        } while (j < gcSearch.Count);
    } 

Solution

  • You might check out FreeDB

    This is another database of music metadata; it is the open version of CDDB. It was formed in response to the actions of Escient, which through its subsidiary, Gracenote, bought the rights to CDDB and restricted access to the data.