<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic whyyy api. just why in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/whyyy-api-just-why/m-p/5874568#M12645</link>
    <description>&lt;P&gt;i just spent an embarrassing amount of openai assistant tokens to figure out that i have the reading comprehension skills of a goldfish.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;api, why must you pluralize the object type in your response if the request is singular?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;request:&lt;/P&gt;&lt;PRE&gt;curl --request GET url 'https://api.spotify.com/v1/search?q=PIG&amp;amp;&lt;FONT size="5" color="#FF6600"&gt;&lt;STRONG&gt;type=artist&lt;/STRONG&gt;&lt;/FONT&gt;&amp;amp;limit=20&amp;amp;offset=0'&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;response:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;&lt;FONT color="#FF6600"&gt;artists&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;": &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;href&lt;/SPAN&gt;&lt;SPAN&gt;": &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://api.spotify.com/v1/search?query=PIG&amp;amp;type=artist&amp;amp;locale=en-US%2Cen%3Bq%3D0.9&amp;amp;offset=0&amp;amp;limit=20" target="_blank"&gt;https://api.spotify.com/v1/search?query=PIG&amp;amp;type=artist&amp;amp;locale=en-US%2Cen%3Bq%3D0.9&amp;amp;offset=0&amp;amp;limit=20&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;limit&lt;/SPAN&gt;&lt;SPAN&gt;": &lt;/SPAN&gt;&lt;SPAN&gt;20&lt;/SPAN&gt;&lt;SPAN&gt;, ... } }&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now i have to have an "s" just hanging around reminding me about this whole experience. forever.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;def search(...)&lt;BR /&gt;   ...&lt;BR /&gt;   response_key = f'{query_type}&lt;FONT size="7"&gt;&lt;STRONG&gt;&lt;FONT color="#FF6600"&gt;s&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;' # Convert from singular to plural form&lt;BR /&gt;   if response_key in result['data']:&lt;BR /&gt;      items = [SpotifyMusicObject(item, {"type": query_type, "query": query}) &lt;BR /&gt;      for item in result['data'][response_key].get('items', [])]&lt;BR /&gt;   return {'status': 'success', 'data': items}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 09 Feb 2024 03:42:24 GMT</pubDate>
    <dc:creator>thats_sir_nasty_to_u</dc:creator>
    <dc:date>2024-02-09T03:42:24Z</dc:date>
    <item>
      <title>whyyy api. just why</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/whyyy-api-just-why/m-p/5874568#M12645</link>
      <description>&lt;P&gt;i just spent an embarrassing amount of openai assistant tokens to figure out that i have the reading comprehension skills of a goldfish.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;api, why must you pluralize the object type in your response if the request is singular?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;request:&lt;/P&gt;&lt;PRE&gt;curl --request GET url 'https://api.spotify.com/v1/search?q=PIG&amp;amp;&lt;FONT size="5" color="#FF6600"&gt;&lt;STRONG&gt;type=artist&lt;/STRONG&gt;&lt;/FONT&gt;&amp;amp;limit=20&amp;amp;offset=0'&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;response:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;&lt;FONT color="#FF6600"&gt;artists&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;": &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;href&lt;/SPAN&gt;&lt;SPAN&gt;": &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://api.spotify.com/v1/search?query=PIG&amp;amp;type=artist&amp;amp;locale=en-US%2Cen%3Bq%3D0.9&amp;amp;offset=0&amp;amp;limit=20" target="_blank"&gt;https://api.spotify.com/v1/search?query=PIG&amp;amp;type=artist&amp;amp;locale=en-US%2Cen%3Bq%3D0.9&amp;amp;offset=0&amp;amp;limit=20&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;limit&lt;/SPAN&gt;&lt;SPAN&gt;": &lt;/SPAN&gt;&lt;SPAN&gt;20&lt;/SPAN&gt;&lt;SPAN&gt;, ... } }&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now i have to have an "s" just hanging around reminding me about this whole experience. forever.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;def search(...)&lt;BR /&gt;   ...&lt;BR /&gt;   response_key = f'{query_type}&lt;FONT size="7"&gt;&lt;STRONG&gt;&lt;FONT color="#FF6600"&gt;s&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;' # Convert from singular to plural form&lt;BR /&gt;   if response_key in result['data']:&lt;BR /&gt;      items = [SpotifyMusicObject(item, {"type": query_type, "query": query}) &lt;BR /&gt;      for item in result['data'][response_key].get('items', [])]&lt;BR /&gt;   return {'status': 'success', 'data': items}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Feb 2024 03:42:24 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/whyyy-api-just-why/m-p/5874568#M12645</guid>
      <dc:creator>thats_sir_nasty_to_u</dc:creator>
      <dc:date>2024-02-09T03:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: whyyy api. just why</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/whyyy-api-just-why/m-p/5875739#M12649</link>
      <description>&lt;P&gt;Because `artist` is the type of the query, and the response returns a &lt;STRONG&gt;&lt;EM&gt;set of objects &lt;/EM&gt;&lt;/STRONG&gt;that have the type `artist`, it therefore makes sense to use &lt;STRONG&gt;artists&lt;/STRONG&gt; in searching, since many artists can share the same name. For example, using your own query 'PIG', there are at least 5 artists whose names are 'PIG', the returned response contains all the &lt;STRONG&gt;artists&lt;/STRONG&gt; whose names are 'PIG'. There's nothing wrong with the API design here.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 17:45:11 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/whyyy-api-just-why/m-p/5875739#M12649</guid>
      <dc:creator>daydream-nation</dc:creator>
      <dc:date>2024-02-09T17:45:11Z</dc:date>
    </item>
  </channel>
</rss>

