Forums: 

When supplying the level of detail I want for various extended properties, the API returns inconsistent values. For example, sending in this query:

<QUERIES>
              <AUTH>
                <CLIENT>xxx</CLIENT>
                <USER>xxx</USER>
              </AUTH>
              <QUERY CMD=""ALBUM_FETCH"">
                <GN_ID>163876391-04B79D721D1953011CEEB1B27F636238</GN_ID>
                <OPTION>
                  <PARAMETER>SELECT_EXTENDED</PARAMETER>
                  <VALUE>ARTIST_OET</VALUE>
                </OPTION>
                <OPTION>
                  <PARAMETER>SELECT_DETAIL</PARAMETER>
                  <VALUE>ARTIST_TYPE:2LEVEL</VALUE>
                </OPTION>
              </QUERY>
            </QUERIES>

results in the following (correct) result, with two levels of artist type.

 

<RESPONSES>
 <RESPONSE STATUS="OK">
   <ALBUM>
      <GN_ID>163876387-8491CF882B3898163ACE6DAB681AF635</GN_ID>
      <ARTIST>Ben Folds</ARTIST>
      <ARTIST_ORIGIN ID="29908">United States</ARTIST_ORIGIN>
      <ARTIST_TYPE ORD="1" ID="29422">Male</ARTIST_TYPE>
      <ARTIST_TYPE ORD="2" ID="29426">Male</ARTIST_TYPE>
      <ARTIST_ERA ID="29483">2000&apos;s</ARTIST_ERA>
      <TITLE>Way To Normal</TITLE>
      <PKG_LANG>ENG</PKG_LANG>
      <DATE>2008</DATE>
      <GENRE NUM="105245" ID="35493">Western Pop</GENRE>
      <MATCHED_TRACK_NUM>4</MATCHED_TRACK_NUM>
      <TRACK_COUNT>12</TRACK_COUNT>
      <TRACK>
         <TRACK_NUM>4</TRACK_NUM>
         <GN_ID>163876391-04B79D721D1953011CEEB1B27F636238</GN_ID>
         <ARTIST>Ben Folds Feat. Regina Spektor</ARTIST>
         <ARTIST_ORIGIN ID="29908">United States</ARTIST_ORIGIN>
         <ARTIST_TYPE ORD="1" ID="29424">Mixed</ARTIST_TYPE>
         <ARTIST_TYPE ORD="2" ID="29471">Mixed Duo</ARTIST_TYPE>
         <ARTIST_ERA ID="29483">2000&apos;s</ARTIST_ERA>
         <TITLE>You Don&apos;t Know Me</TITLE>
         <GENRE NUM="105245" ID="35493">Western Pop</GENRE>
      </TRACK>
   </ALBUM>
 </RESPONSE>
</RESPONSES>

However, when I pass in 3LEVEL, the result falls back to only one level of details, presumably because only 2 levels of detail exist:

<RESPONSES>
 <RESPONSE STATUS="OK">
   <ALBUM>
      <GN_ID>163876387-8491CF882B3898163ACE6DAB681AF635</GN_ID>
      <ARTIST>Ben Folds</ARTIST>
      <ARTIST_ORIGIN ID="29908">United States</ARTIST_ORIGIN>
      <ARTIST_TYPE ID="29422">Male</ARTIST_TYPE>
      <ARTIST_ERA ID="29483">2000&apos;s</ARTIST_ERA>
      <TITLE>Way To Normal</TITLE>
      <PKG_LANG>ENG</PKG_LANG>
      <DATE>2008</DATE>
      <GENRE NUM="105245" ID="35493">Western Pop</GENRE>
      <MATCHED_TRACK_NUM>4</MATCHED_TRACK_NUM>
      <TRACK_COUNT>12</TRACK_COUNT>
      <TRACK>
         <TRACK_NUM>4</TRACK_NUM>
         <GN_ID>163876391-04B79D721D1953011CEEB1B27F636238</GN_ID>
         <ARTIST>Ben Folds Feat. Regina Spektor</ARTIST>
         <ARTIST_ORIGIN ID="29908">United States</ARTIST_ORIGIN>
         <ARTIST_TYPE ID="29424">Mixed</ARTIST_TYPE>
         <ARTIST_ERA ID="29483">2000&apos;s</ARTIST_ERA>
         <TITLE>You Don&apos;t Know Me</TITLE>
         <GENRE NUM="105245" ID="35493">Western Pop</GENRE>
      </TRACK>
   </ALBUM>
 </RESPONSE>
</RESPONSES>

This is unhelpful, as it means that I would need to query the API three times (once for each level of detail) to know I got the full information back. Why does 3LEVEL not return "up to 3 levels" rather than "if 3, then 3, else 1"?

Hi,
When using SELECT_DETAIL option, the API only accept values as specified in the documentation. For example: GENRE:3LEVEL, as specified in the table in docs https://developer.gracenote.com/sites/default/files/web/webapi/index.html#music-web-api/SELECT_DETAIL Option1.html (refer to "Lable" column).
And the number of levels returned will depend on the data available for that artist/album/track.
When you set a value that the API does not recognize, like GENRE:2LEVEL, it will only return 1 level.

If the API only accepts values in the documentation, then I would recommend correcting the documentation. It doesn't specify these are the only acceptable values, it just says that I can specify how many levels to return (in fact, it says three times that the level can be specified), which is obviously incorrect.

Alternatively, just make the API simpler. If the only acceptable value is GENRE:3LEVEL for genre then why specify the level at all? Why not just "simplified" and "detailed"?

Forum Discussions