spotify / web-api

This issue tracker is no longer used. Join us in the Spotify for Developers forum for support with the Spotify Web API ➡️ https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer
983 stars 79 forks source link

UPC search not returning any results #1469

Open symeshan opened 4 years ago

symeshan commented 4 years ago

Issue found on February 6th 2020, after previously working consistently.

Endpoint(s):

Scope(s):

Steps to reproduce:

  1. Open the API Console
  2. Call the search endpoint with q upc:886443671584 and type album

Expected behaviour:

Reference to album id 4aawyAB9vmqN3uQ7FjRGTy.

When going the other way, calling https://api.spotify.com/v1/albums/4aawyAB9vmqN3uQ7FjRGTy (the sample id in the get-album call in the documentation) it returns an album object with the above UPC 886443671584 in its external_ids.

Actual behaviour:

No results found.

{
  "albums": {
    "href": "https://api.spotify.com/v1/search?query=upc%3A886443671584&type=album&offset=0&limit=20",
    "items": [],
    "limit": 20,
    "next": null,
    "offset": 0,
    "previous": null,
    "total": 0
  }
}
TobiasGabler commented 4 years ago

@symeshan : I just had the same issue. I believe that it has something to do with the available markets. In my case this request leads to the same empty result as yours: https://api.spotify.com/v1/search?type=album&query=upc:4061798422036

{
  "albums": {
    "href": "https://api.spotify.com/v1/search?query=upc%3A4061798422036&type=album&offset=0&limit=20",
    "items": [],
    "limit": 20,
    "next": null,
    "offset": 0,
    "previous": null,
    "total": 0
  }
}

As this release is not available in all markets i tried to add the market parameter and got a correct result:

https://api.spotify.com/v1/search?type=album&query=upc:4061798422036&market=DE

 "albums": {
    "href": "https://api.spotify.com/v1/search?query=upc%3A4061798422036&type=album&market=DE&offset=0&limit=20",
    "items": [
      {
        "album_type": "album",
        "artists": [
          {
            "external_urls": {
              "spotify": "https://open.spotify.com/artist/4QjY2fD869F1fnJadkjPGM"
            },
            "href": "https://api.spotify.com/v1/artists/4QjY2fD869F1fnJadkjPGM",
            "id": "4QjY2fD869F1fnJadkjPGM",
            "name": "Jeez",
            "type": "artist",
            "uri": "spotify:artist:4QjY2fD869F1fnJadkjPGM"
          }
        ],
        "external_urls": {
          "spotify": "https://open.spotify.com/album/17BEmad45O5cGj9mW2MNao"
        },
        "href": "https://api.spotify.com/v1/albums/17BEmad45O5cGj9mW2MNao",
        "id": "17BEmad45O5cGj9mW2MNao",
        "images": [
          {
            "height": 640,
            "url": "https://i.scdn.co/image/ab67616d0000b273749d8d751db5151adefc55c3",
            "width": 640
          },
          {
            "height": 300,
            "url": "https://i.scdn.co/image/ab67616d00001e02749d8d751db5151adefc55c3",
            "width": 300
          },
          {
            "height": 64,
            "url": "https://i.scdn.co/image/ab67616d00004851749d8d751db5151adefc55c3",
            "width": 64
          }
        ],
        "name": "Säg mau",
        "release_date": "2019-12-15",
        "release_date_precision": "day",
        "total_tracks": 7,
        "type": "album",
        "uri": "spotify:album:17BEmad45O5cGj9mW2MNao"
      }
    ],
    "limit": 20,
    "next": null,
    "offset": 0,
    "previous": null,
    "total": 1
  }
}