<?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 Re: Is there a String Length Limit for the Search Endpoint Query String in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5400667#M4957</link>
    <description>&lt;P&gt;You are using&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;type=track&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;instead of&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;type=album&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;</description>
    <pubDate>Sat, 02 Jul 2022 12:59:19 GMT</pubDate>
    <dc:creator>Ximzend</dc:creator>
    <dc:date>2022-07-02T12:59:19Z</dc:date>
    <item>
      <title>Is there a String Length Limit for the Search Endpoint Query String</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5400531#M4955</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Plan&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Free/Premium&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Country&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;USA&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;iMac Late 2014&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Operating System&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;macOS Big Sir 11.6.4 (20G417)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Question or Issue&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When I attempt to execute the following query, either with Python or with the Spotify Developer Console, I get a 404 error.&amp;nbsp; &lt;U&gt;&lt;STRONG&gt;Does this error occur because of a query string length?&lt;/STRONG&gt;&lt;STRONG&gt; If YES, what is the limit?&lt;/STRONG&gt;&lt;/U&gt; Below is the code from the console:&lt;/P&gt;&lt;PRE&gt;curl -X "GET" "https://api.spotify.com/v1/search?q=artist%3APorridge%20Radio%20track%3AWaterslide%2C%20Diving%20Board%2C%20Ladder%20to%20the%20Sky%20album%3AWaterslide%2C%20Diving%20Board%2C%20Ladder%20to%20the%20Sky&amp;amp;type=track" -H "Accept: application/json" -H "Content-Type: application/json" -H&lt;/PRE&gt;&lt;P&gt;And this is the output:&lt;/P&gt;&lt;PRE&gt;{
  "error": {
    "status": 404,
    "message": "Not found."
  }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If I run this query without the Album Name, I do not get the error, but I get no results:&lt;/P&gt;&lt;PRE&gt;curl -X "GET" "https://api.spotify.com/v1/search?q=artist%3APorridge%20Radio%20track%3AWaterslide%2C%20Diving%20Board%2C%20Ladder%20to%20the%20Sky&amp;amp;type=track&amp;amp;market=US" -H "Accept: application/json" -H "Content-Type: application/json" -H&lt;/PRE&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;PRE&gt;{
  "tracks": {
    "href": "https://api.spotify.com/v1/search?query=artist%3APorridge+Radio+track%3AWaterslide%2C+Diving+Board%2C+Ladder+to+the+Sky&amp;amp;type=track&amp;amp;market=US&amp;amp;locale=en-US%2Cen%3Bq%3D0.5&amp;amp;offset=0&amp;amp;limit=20",
    "items": [
      {
        "album": {
          "album_type": "album",
          "artists": [
            {
              "external_urls": {
                "spotify": "https://open.spotify.com/artist/4vAQ4M7vgItwBtmBTgRu48"
              },
              "href": "https://api.spotify.com/v1/artists/4vAQ4M7vgItwBtmBTgRu48",
              "id": "4vAQ4M7vgItwBtmBTgRu48",
              "name": "Porridge Radio",
              "type": "artist",
              "uri": "spotify:artist:4vAQ4M7vgItwBtmBTgRu48"
            }
          ],
          "external_urls": {
            "spotify": "https://open.spotify.com/album/6wdThJ2V58nkaWfv1jA4B5"
          },
          "href": "https://api.spotify.com/v1/albums/6wdThJ2V58nkaWfv1jA4B5",
          "id": "6wdThJ2V58nkaWfv1jA4B5",
          "images": [
            {
              "height": 640,
              "url": "https://i.scdn.co/image/ab67616d0000b27303a583cc04f4005d5c81623d",
              "width": 640
            },
            {
              "height": 300,
              "url": "https://i.scdn.co/image/ab67616d00001e0203a583cc04f4005d5c81623d",
              "width": 300
            },
            {
              "height": 64,
              "url": "https://i.scdn.co/image/ab67616d0000485103a583cc04f4005d5c81623d",
              "width": 64
            }
          ],
          "name": "Waterslide, Diving Board, Ladder To The Sky",
          "release_date": "2022-05-20",
          "release_date_precision": "day",
          "total_tracks": 13,
          "type": "album",
          "uri": "spotify:album:6wdThJ2V58nkaWfv1jA4B5"
        },
        "artists": [
          {
            "external_urls": {
              "spotify": "https://open.spotify.com/artist/4vAQ4M7vgItwBtmBTgRu48"
            },
            "href": "https://api.spotify.com/v1/artists/4vAQ4M7vgItwBtmBTgRu48",
            "id": "4vAQ4M7vgItwBtmBTgRu48",
            "name": "Porridge Radio",
            "type": "artist",
            "uri": "spotify:artist:4vAQ4M7vgItwBtmBTgRu48"
          }
        ],
        "disc_number": 1,
        "duration_ms": 202720,
        "explicit": false,
        "external_ids": {
          "isrc": "US38W2145013"
        },
        "external_urls": {
          "spotify": "https://open.spotify.com/track/0on6oBOc1ZpX8FoeKSl8yK"
        },
        "href": "https://api.spotify.com/v1/tracks/0on6oBOc1ZpX8FoeKSl8yK",
        "id": "0on6oBOc1ZpX8FoeKSl8yK",
        "is_local": false,
        "is_playable": true,
        "name": "Waterslide, Diving Board, Ladder To The Sky",
        "popularity": 37,
        "preview_url": "https://p.scdn.co/mp3-preview/b71b236a8359ef63e1bee616c78d075fd0b2fbfd?cid=774b29d4f13844c495f206cafdad9c86",
        "track_number": 13,
        "type": "track",
        "uri": "spotify:track:0on6oBOc1ZpX8FoeKSl8yK"
      }
    ],
    "limit": 20,
    "next": null,
    "offset": 0,
    "previous": null,
    "total": 1
  }
}&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Jul 2022 01:21:19 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5400531#M4955</guid>
      <dc:creator>jospkelly</dc:creator>
      <dc:date>2022-07-02T01:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a String Length Limit for the Search Endpoint Query String</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5400667#M4957</link>
      <description>&lt;P&gt;You are using&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;type=track&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;instead of&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;type=album&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 12:59:19 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5400667#M4957</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2022-07-02T12:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a String Length Limit for the Search Endpoint Query String</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5400668#M4958</link>
      <description>&lt;P&gt;Ignore my comment, I think I did understand your problem wrong.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 13:03:03 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5400668#M4958</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2022-07-02T13:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a String Length Limit for the Search Endpoint Query String</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5401014#M4965</link>
      <description>&lt;P&gt;I got here while searching for answers to the same question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, there seems to be a limit to the "q" parameter length and it seems to be 100 characters (found by trial and error). This is another case where Spotify API insists to be frustrating to use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why there needs to be a limit at all? Any modern infrastructure should be able to easily handle long query strings at the request or data query level. And why does it needs to be so low?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why does it return 404 error? A more accurate http error code (and error message) could help diagnose the problem (400, 414).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the very least, this should be documented. Wasted too much time debugging this.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 15:34:41 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5401014#M4965</guid>
      <dc:creator>barduck</dc:creator>
      <dc:date>2022-07-03T15:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a String Length Limit for the Search Endpoint Query String</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5401028#M4966</link>
      <description>&lt;P&gt;I am using both. The track name and the album name are the same (in this example).&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 16:51:30 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5401028#M4966</guid>
      <dc:creator>jospkelly</dc:creator>
      <dc:date>2022-07-03T16:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a String Length Limit for the Search Endpoint Query String</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5401042#M4967</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.spotify.com/t5/user/viewprofilepage/user-id/25394733"&gt;@jospkelly&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I am using both. The track name and the album name are the same (in this example).&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It seems to be the total length of the "q" URL parameter (before it's url encoded).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your first example (with album) it's 121 characters, the request fails with the cryptic 404 error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your second example (without album) it's 71 characters. The request is successful and it returns 1 track item because you specified the type of the search as "track".&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 17:36:17 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Is-there-a-String-Length-Limit-for-the-Search-Endpoint-Query/m-p/5401042#M4967</guid>
      <dc:creator>barduck</dc:creator>
      <dc:date>2022-07-03T17:36:17Z</dc:date>
    </item>
  </channel>
</rss>

