In [3]:
import requests

In [4]:
response = requests.get('https://api.spotify.com/v1/search?query=80s&type=playlist')

In [6]:
print(response.text)


{
  "playlists" : {
    "href" : "https://api.spotify.com/v1/search?query=80s&offset=0&limit=20&type=playlist",
    "items" : [ {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/bigboss20100/playlist/3XqrCld9BEEW46L0CO4c0G"
      },
      "href" : "https://api.spotify.com/v1/users/bigboss20100/playlists/3XqrCld9BEEW46L0CO4c0G",
      "id" : "3XqrCld9BEEW46L0CO4c0G",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/594e915af057874fdc3c49e228f0f1eda381b722b5c50263ba2a35c0a46691c9f4a9ee235d79a1333ea672725b664fd1dae501120204ef688d17d1fa27c9e093bd5b9817deb910b41e9094388a3f2962",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/594e915af057874fdc3c49e228f0f1eda381b722b5c50263ba2a35c0a46691c9f4a9ee235d79a1333ea672725b664fd1dae501120204ef688d17d1fa27c9e093bd5b9817deb910b41e9094388a3f2962",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/594e915af057874fdc3c49e228f0f1eda381b722b5c50263ba2a35c0a46691c9f4a9ee235d79a1333ea672725b664fd1dae501120204ef688d17d1fa27c9e093bd5b9817deb910b41e9094388a3f2962",
        "width" : 60
      } ],
      "name" : "80s",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/bigboss20100"
        },
        "href" : "https://api.spotify.com/v1/users/bigboss20100",
        "id" : "bigboss20100",
        "type" : "user",
        "uri" : "spotify:user:bigboss20100"
      },
      "public" : null,
      "snapshot_id" : "QV8mI4dfz/L24vTOSAQY3gM2BGwgWSR0FtYeSqdh4CNs22udvpOlC62XoPUFvKtE",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/bigboss20100/playlists/3XqrCld9BEEW46L0CO4c0G/tracks",
        "total" : 1173
      },
      "type" : "playlist",
      "uri" : "spotify:user:bigboss20100:playlist:3XqrCld9BEEW46L0CO4c0G"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/cult_fan/playlist/4kqDp9JAKbvsgFqA5CCRw4"
      },
      "href" : "https://api.spotify.com/v1/users/cult_fan/playlists/4kqDp9JAKbvsgFqA5CCRw4",
      "id" : "4kqDp9JAKbvsgFqA5CCRw4",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/fe1bf713b3a5635d9e4f5a24482d059dff69873368d2d98e80941b0d17c5bd53ef9efb0b3e42abe4bfcba0de791c1464f5d3e2372e85b4eed1f7f1cf4e6b01cb00328c66031195efaddb0a4dd836b8e4",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/fe1bf713b3a5635d9e4f5a24482d059dff69873368d2d98e80941b0d17c5bd53ef9efb0b3e42abe4bfcba0de791c1464f5d3e2372e85b4eed1f7f1cf4e6b01cb00328c66031195efaddb0a4dd836b8e4",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/fe1bf713b3a5635d9e4f5a24482d059dff69873368d2d98e80941b0d17c5bd53ef9efb0b3e42abe4bfcba0de791c1464f5d3e2372e85b4eed1f7f1cf4e6b01cb00328c66031195efaddb0a4dd836b8e4",
        "width" : 60
      } ],
      "name" : "80s rock",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/cult_fan"
        },
        "href" : "https://api.spotify.com/v1/users/cult_fan",
        "id" : "cult_fan",
        "type" : "user",
        "uri" : "spotify:user:cult_fan"
      },
      "public" : null,
      "snapshot_id" : "WxxCyMBM+Nn2VTaaD1VKsMuCUAyH8wZkiVU7RlN9PVxfKq884hy1ClII6Ep5yk/y",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/cult_fan/playlists/4kqDp9JAKbvsgFqA5CCRw4/tracks",
        "total" : 109
      },
      "type" : "playlist",
      "uri" : "spotify:user:cult_fan:playlist:4kqDp9JAKbvsgFqA5CCRw4"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/spotify_uk_/playlist/4d9c5BkQVaG1kJiBSQJ68w"
      },
      "href" : "https://api.spotify.com/v1/users/spotify_uk_/playlists/4d9c5BkQVaG1kJiBSQJ68w",
      "id" : "4d9c5BkQVaG1kJiBSQJ68w",
      "images" : [ {
        "height" : null,
        "url" : "https://u.scdn.co/images/pl/default/0a1eabcfd770750abd32e3308aac6c4a4eb626db",
        "width" : null
      } ],
      "name" : "All Gold 80s",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/spotify_uk_"
        },
        "href" : "https://api.spotify.com/v1/users/spotify_uk_",
        "id" : "spotify_uk_",
        "type" : "user",
        "uri" : "spotify:user:spotify_uk_"
      },
      "public" : null,
      "snapshot_id" : "pKqadNfb07wKQhT8rJFbqj7G0oMnt5joKpeumOORPw139PHKFBIkjcuDb2lsLrWZ",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/spotify_uk_/playlists/4d9c5BkQVaG1kJiBSQJ68w/tracks",
        "total" : 99
      },
      "type" : "playlist",
      "uri" : "spotify:user:spotify_uk_:playlist:4d9c5BkQVaG1kJiBSQJ68w"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/1286553094/playlist/6UwtzUAvwXlo7UwAbcRTbq"
      },
      "href" : "https://api.spotify.com/v1/users/1286553094/playlists/6UwtzUAvwXlo7UwAbcRTbq",
      "id" : "6UwtzUAvwXlo7UwAbcRTbq",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/2886710f1bf14cc47b6d7588af406def6a31d6ebf88937e9c0c7329cef4b67364d16b28dc0ebcf0c14e45bc02528b145f78b37bc97b53647d899c7595fc4b1d3fa12a473b72599a2d950ad5696b20632",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/2886710f1bf14cc47b6d7588af406def6a31d6ebf88937e9c0c7329cef4b67364d16b28dc0ebcf0c14e45bc02528b145f78b37bc97b53647d899c7595fc4b1d3fa12a473b72599a2d950ad5696b20632",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/2886710f1bf14cc47b6d7588af406def6a31d6ebf88937e9c0c7329cef4b67364d16b28dc0ebcf0c14e45bc02528b145f78b37bc97b53647d899c7595fc4b1d3fa12a473b72599a2d950ad5696b20632",
        "width" : 60
      } ],
      "name" : "80s Country",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/1286553094"
        },
        "href" : "https://api.spotify.com/v1/users/1286553094",
        "id" : "1286553094",
        "type" : "user",
        "uri" : "spotify:user:1286553094"
      },
      "public" : null,
      "snapshot_id" : "4ALQxcBGX4ybPy9hmxW/BnOFUN/8Kf2BumdK4zVLrxyxXfb2JWmRpUQHEm6TcJ2/",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/1286553094/playlists/6UwtzUAvwXlo7UwAbcRTbq/tracks",
        "total" : 253
      },
      "type" : "playlist",
      "uri" : "spotify:user:1286553094:playlist:6UwtzUAvwXlo7UwAbcRTbq"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/gavinballard/playlist/6CXPHSOAGsvpp7Tb6ICTya"
      },
      "href" : "https://api.spotify.com/v1/users/gavinballard/playlists/6CXPHSOAGsvpp7Tb6ICTya",
      "id" : "6CXPHSOAGsvpp7Tb6ICTya",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/17df8a01dd260e782edfebf9aa0f9adaa9833eb5305b29425f26d0200d27605d2a572200df89da45ff8d208d8049907f0def04e4729acc73fb319c4d63e47b9e1420e2effd4d4537c464c27e6e598f2e",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/17df8a01dd260e782edfebf9aa0f9adaa9833eb5305b29425f26d0200d27605d2a572200df89da45ff8d208d8049907f0def04e4729acc73fb319c4d63e47b9e1420e2effd4d4537c464c27e6e598f2e",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/17df8a01dd260e782edfebf9aa0f9adaa9833eb5305b29425f26d0200d27605d2a572200df89da45ff8d208d8049907f0def04e4729acc73fb319c4d63e47b9e1420e2effd4d4537c464c27e6e598f2e",
        "width" : 60
      } ],
      "name" : "80s music",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/gavinballard"
        },
        "href" : "https://api.spotify.com/v1/users/gavinballard",
        "id" : "gavinballard",
        "type" : "user",
        "uri" : "spotify:user:gavinballard"
      },
      "public" : null,
      "snapshot_id" : "XXQP/Htns+0hWRzM+W3CIMQmfMSuftPr5Q5O2F5ZLEZriCsm/9P5ALMi4iEjT5hP",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/gavinballard/playlists/6CXPHSOAGsvpp7Tb6ICTya/tracks",
        "total" : 79
      },
      "type" : "playlist",
      "uri" : "spotify:user:gavinballard:playlist:6CXPHSOAGsvpp7Tb6ICTya"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/barryjackson1664/playlist/4gQS58GskTrUG01JutbhhH"
      },
      "href" : "https://api.spotify.com/v1/users/barryjackson1664/playlists/4gQS58GskTrUG01JutbhhH",
      "id" : "4gQS58GskTrUG01JutbhhH",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/bca7ab412002bb01a75039aa65408faa2fbf028ab5120637382e48dcebab77f0da40f9e69fb7aeeaec6de59a98a1a6b54e93dba18b570e2833d02aca57f7e47cbf6c3da3e2e451221bbe4784df39d7b0",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/bca7ab412002bb01a75039aa65408faa2fbf028ab5120637382e48dcebab77f0da40f9e69fb7aeeaec6de59a98a1a6b54e93dba18b570e2833d02aca57f7e47cbf6c3da3e2e451221bbe4784df39d7b0",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/bca7ab412002bb01a75039aa65408faa2fbf028ab5120637382e48dcebab77f0da40f9e69fb7aeeaec6de59a98a1a6b54e93dba18b570e2833d02aca57f7e47cbf6c3da3e2e451221bbe4784df39d7b0",
        "width" : 60
      } ],
      "name" : "80s",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/barryjackson1664"
        },
        "href" : "https://api.spotify.com/v1/users/barryjackson1664",
        "id" : "barryjackson1664",
        "type" : "user",
        "uri" : "spotify:user:barryjackson1664"
      },
      "public" : null,
      "snapshot_id" : "9yM8Nn0uNcdptGCI0X5qP6RqWh6o56C773zcxeblxwv5gGDL85ILaVr1sAap1zOk",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/barryjackson1664/playlists/4gQS58GskTrUG01JutbhhH/tracks",
        "total" : 129
      },
      "type" : "playlist",
      "uri" : "spotify:user:barryjackson1664:playlist:4gQS58GskTrUG01JutbhhH"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/12185397786/playlist/4JNv7yR3y9fhp5z9Arjyxm"
      },
      "href" : "https://api.spotify.com/v1/users/12185397786/playlists/4JNv7yR3y9fhp5z9Arjyxm",
      "id" : "4JNv7yR3y9fhp5z9Arjyxm",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/56db426ab15853baa3f68ebe49165e20bab5f22463e47b9e1420e2effd4d4537c464c27e6e598f2e9310c784b7034957a8728d6cdcc51efc20678f7a1585831d467bf5cd1dcbb732ca634591cc4bc2e4",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/56db426ab15853baa3f68ebe49165e20bab5f22463e47b9e1420e2effd4d4537c464c27e6e598f2e9310c784b7034957a8728d6cdcc51efc20678f7a1585831d467bf5cd1dcbb732ca634591cc4bc2e4",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/56db426ab15853baa3f68ebe49165e20bab5f22463e47b9e1420e2effd4d4537c464c27e6e598f2e9310c784b7034957a8728d6cdcc51efc20678f7a1585831d467bf5cd1dcbb732ca634591cc4bc2e4",
        "width" : 60
      } ],
      "name" : "Rock 80s 🎸🎸😎😎",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/12185397786"
        },
        "href" : "https://api.spotify.com/v1/users/12185397786",
        "id" : "12185397786",
        "type" : "user",
        "uri" : "spotify:user:12185397786"
      },
      "public" : null,
      "snapshot_id" : "FkhXscjLAkQ7CIq/y/ACOHTuU8U6vDcYzhJdk7QhkxOxxjSC3ZFlC6/n5D9CjE25",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/12185397786/playlists/4JNv7yR3y9fhp5z9Arjyxm/tracks",
        "total" : 617
      },
      "type" : "playlist",
      "uri" : "spotify:user:12185397786:playlist:4JNv7yR3y9fhp5z9Arjyxm"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/1257890335/playlist/0qi0cNbn62Xo6eeqjdpTSD"
      },
      "href" : "https://api.spotify.com/v1/users/1257890335/playlists/0qi0cNbn62Xo6eeqjdpTSD",
      "id" : "0qi0cNbn62Xo6eeqjdpTSD",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/5f15adf7a6de16e804fe461957957bba83c0c2beb524f9a3cca59c3f42e4c3f82a7ce69bf80b5737a4ada225c340acef2b5b888c2687ff45140e5930d9c974ac4ea17f450023c262938dbb41e07d97dd",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/5f15adf7a6de16e804fe461957957bba83c0c2beb524f9a3cca59c3f42e4c3f82a7ce69bf80b5737a4ada225c340acef2b5b888c2687ff45140e5930d9c974ac4ea17f450023c262938dbb41e07d97dd",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/5f15adf7a6de16e804fe461957957bba83c0c2beb524f9a3cca59c3f42e4c3f82a7ce69bf80b5737a4ada225c340acef2b5b888c2687ff45140e5930d9c974ac4ea17f450023c262938dbb41e07d97dd",
        "width" : 60
      } ],
      "name" : "60s, 70s, 80s Classic Rock",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/1257890335"
        },
        "href" : "https://api.spotify.com/v1/users/1257890335",
        "id" : "1257890335",
        "type" : "user",
        "uri" : "spotify:user:1257890335"
      },
      "public" : null,
      "snapshot_id" : "MJw3yCgBAWy0bClp3UvmPAGfylX4ueUl+j3DGezB9JHpf4LffkaJIU4loymiM2B6",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/1257890335/playlists/0qi0cNbn62Xo6eeqjdpTSD/tracks",
        "total" : 250
      },
      "type" : "playlist",
      "uri" : "spotify:user:1257890335:playlist:0qi0cNbn62Xo6eeqjdpTSD"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/1246447961/playlist/4XzcgE9F8EqAGzzstU3udv"
      },
      "href" : "https://api.spotify.com/v1/users/1246447961/playlists/4XzcgE9F8EqAGzzstU3udv",
      "id" : "4XzcgE9F8EqAGzzstU3udv",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/e160b9fc08866c311b1fb5d380ec0b99fbfc1a72e9fc18dfea678ec8bb9ff6bd1af3dcd8109ec8827d9e6882ab1387a7b894adeac8846319e2c77adf25fd92ef537b369583b1b2cadead0faa15163186",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/e160b9fc08866c311b1fb5d380ec0b99fbfc1a72e9fc18dfea678ec8bb9ff6bd1af3dcd8109ec8827d9e6882ab1387a7b894adeac8846319e2c77adf25fd92ef537b369583b1b2cadead0faa15163186",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/e160b9fc08866c311b1fb5d380ec0b99fbfc1a72e9fc18dfea678ec8bb9ff6bd1af3dcd8109ec8827d9e6882ab1387a7b894adeac8846319e2c77adf25fd92ef537b369583b1b2cadead0faa15163186",
        "width" : 60
      } ],
      "name" : "80s alternative",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/1246447961"
        },
        "href" : "https://api.spotify.com/v1/users/1246447961",
        "id" : "1246447961",
        "type" : "user",
        "uri" : "spotify:user:1246447961"
      },
      "public" : null,
      "snapshot_id" : "mfkY0u5fB8DeKiInmMnMHatlSi72qBr9IRzA2k0z5GaMQIhtYRhwcUozlSUzGuna",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/1246447961/playlists/4XzcgE9F8EqAGzzstU3udv/tracks",
        "total" : 293
      },
      "type" : "playlist",
      "uri" : "spotify:user:1246447961:playlist:4XzcgE9F8EqAGzzstU3udv"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/12143691853/playlist/5t30PswiZDYfZAIrTwGr2V"
      },
      "href" : "https://api.spotify.com/v1/users/12143691853/playlists/5t30PswiZDYfZAIrTwGr2V",
      "id" : "5t30PswiZDYfZAIrTwGr2V",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/eb646ba4b6c6db5fcc180d091512bdcf497ed3f063e47b9e1420e2effd4d4537c464c27e6e598f2ed1fec99e6c187e2f67bc28d5367d5db9664b1835f7c286b445154de89205dcfd05e3db6647555d87",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/eb646ba4b6c6db5fcc180d091512bdcf497ed3f063e47b9e1420e2effd4d4537c464c27e6e598f2ed1fec99e6c187e2f67bc28d5367d5db9664b1835f7c286b445154de89205dcfd05e3db6647555d87",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/eb646ba4b6c6db5fcc180d091512bdcf497ed3f063e47b9e1420e2effd4d4537c464c27e6e598f2ed1fec99e6c187e2f67bc28d5367d5db9664b1835f7c286b445154de89205dcfd05e3db6647555d87",
        "width" : 60
      } ],
      "name" : "lovesongs 80s to 90s",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/12143691853"
        },
        "href" : "https://api.spotify.com/v1/users/12143691853",
        "id" : "12143691853",
        "type" : "user",
        "uri" : "spotify:user:12143691853"
      },
      "public" : null,
      "snapshot_id" : "F/qsnuRryvlLyMoOV/eRYi2mA7++EZh9ZGR1Gch4mbzOR2yvYLCI+X+Xh4h3vARz",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/12143691853/playlists/5t30PswiZDYfZAIrTwGr2V/tracks",
        "total" : 100
      },
      "type" : "playlist",
      "uri" : "spotify:user:12143691853:playlist:5t30PswiZDYfZAIrTwGr2V"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/baliztik/playlist/5MpyWoy2l7HUoT2oBcUtFE"
      },
      "href" : "https://api.spotify.com/v1/users/baliztik/playlists/5MpyWoy2l7HUoT2oBcUtFE",
      "id" : "5MpyWoy2l7HUoT2oBcUtFE",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/5fc4b1d3fa12a473b72599a2d950ad5696b2063224bac4eefc9be3644dfc67d734f3de86153a44124c60ccb9eddd9e020607ba96f3a250ccce8d3bc8a850dfdc045482732a5a8e63c30cedc5d7a9ce3f",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/5fc4b1d3fa12a473b72599a2d950ad5696b2063224bac4eefc9be3644dfc67d734f3de86153a44124c60ccb9eddd9e020607ba96f3a250ccce8d3bc8a850dfdc045482732a5a8e63c30cedc5d7a9ce3f",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/5fc4b1d3fa12a473b72599a2d950ad5696b2063224bac4eefc9be3644dfc67d734f3de86153a44124c60ccb9eddd9e020607ba96f3a250ccce8d3bc8a850dfdc045482732a5a8e63c30cedc5d7a9ce3f",
        "width" : 60
      } ],
      "name" : "90s Country (and some 80s)",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/baliztik"
        },
        "href" : "https://api.spotify.com/v1/users/baliztik",
        "id" : "baliztik",
        "type" : "user",
        "uri" : "spotify:user:baliztik"
      },
      "public" : null,
      "snapshot_id" : "XHtgdGFQEH6QQBgiXaKajbvc1yq/WHBXOsGk2kv5RUQkP7HICPTmjAb9lk1PaSkx",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/baliztik/playlists/5MpyWoy2l7HUoT2oBcUtFE/tracks",
        "total" : 312
      },
      "type" : "playlist",
      "uri" : "spotify:user:baliztik:playlist:5MpyWoy2l7HUoT2oBcUtFE"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/1163425103/playlist/21n6LRgHoZerquVm55MI00"
      },
      "href" : "https://api.spotify.com/v1/users/1163425103/playlists/21n6LRgHoZerquVm55MI00",
      "id" : "21n6LRgHoZerquVm55MI00",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/478ae746dc59e525e9f2d697eb394e832531f507eb0b1c38c2c4b6309caea3ead6a23da8a51598856bb8a69c5de907cd33cecf3faa478550db5e54ad61e95b214e0afa7e8218284082dce0203c4bc14c",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/478ae746dc59e525e9f2d697eb394e832531f507eb0b1c38c2c4b6309caea3ead6a23da8a51598856bb8a69c5de907cd33cecf3faa478550db5e54ad61e95b214e0afa7e8218284082dce0203c4bc14c",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/478ae746dc59e525e9f2d697eb394e832531f507eb0b1c38c2c4b6309caea3ead6a23da8a51598856bb8a69c5de907cd33cecf3faa478550db5e54ad61e95b214e0afa7e8218284082dce0203c4bc14c",
        "width" : 60
      } ],
      "name" : "80s hits",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/1163425103"
        },
        "href" : "https://api.spotify.com/v1/users/1163425103",
        "id" : "1163425103",
        "type" : "user",
        "uri" : "spotify:user:1163425103"
      },
      "public" : null,
      "snapshot_id" : "AXQ6H9apvwwLHZe9/565ti6qrDNRi8u/x161W3SLzHNIuu94jmHQLrJjMjPKMhK3",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/1163425103/playlists/21n6LRgHoZerquVm55MI00/tracks",
        "total" : 169
      },
      "type" : "playlist",
      "uri" : "spotify:user:1163425103:playlist:21n6LRgHoZerquVm55MI00"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/burrjt/playlist/29dTrOurPDrMcrnio2q6hZ"
      },
      "href" : "https://api.spotify.com/v1/users/burrjt/playlists/29dTrOurPDrMcrnio2q6hZ",
      "id" : "29dTrOurPDrMcrnio2q6hZ",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/63e47b9e1420e2effd4d4537c464c27e6e598f2e1670f7c53f10dc10110e399bac65e5e6c87ae6acaaa97f6897dd033430cce37221b68524e39f6382ad974be288ee95dcfb4d4c551cdef16cca201c8b",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/63e47b9e1420e2effd4d4537c464c27e6e598f2e1670f7c53f10dc10110e399bac65e5e6c87ae6acaaa97f6897dd033430cce37221b68524e39f6382ad974be288ee95dcfb4d4c551cdef16cca201c8b",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/63e47b9e1420e2effd4d4537c464c27e6e598f2e1670f7c53f10dc10110e399bac65e5e6c87ae6acaaa97f6897dd033430cce37221b68524e39f6382ad974be288ee95dcfb4d4c551cdef16cca201c8b",
        "width" : 60
      } ],
      "name" : "80s / Classic Rock",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/burrjt"
        },
        "href" : "https://api.spotify.com/v1/users/burrjt",
        "id" : "burrjt",
        "type" : "user",
        "uri" : "spotify:user:burrjt"
      },
      "public" : null,
      "snapshot_id" : "vtdJ3Uo7GscU47Q+RAD49UOrkBj4JnAH9plElh694AI72egnlHoJs5psY6Cuoxxb",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/burrjt/playlists/29dTrOurPDrMcrnio2q6hZ/tracks",
        "total" : 241
      },
      "type" : "playlist",
      "uri" : "spotify:user:burrjt:playlist:29dTrOurPDrMcrnio2q6hZ"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/robertstewartspiritgrocer/playlist/7jO2RBMDkEys22WpOECXY5"
      },
      "href" : "https://api.spotify.com/v1/users/robertstewartspiritgrocer/playlists/7jO2RBMDkEys22WpOECXY5",
      "id" : "7jO2RBMDkEys22WpOECXY5",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/9ade30687387caa79604141b5e33ee380ee30cd4d6371515705b0f5cf9f457021ff7589efaa16005fb69a42bfa126727837d5da49eae82efead9eefd3daf5475fe6260a42459a7d9b4af528fe0251e88",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/9ade30687387caa79604141b5e33ee380ee30cd4d6371515705b0f5cf9f457021ff7589efaa16005fb69a42bfa126727837d5da49eae82efead9eefd3daf5475fe6260a42459a7d9b4af528fe0251e88",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/9ade30687387caa79604141b5e33ee380ee30cd4d6371515705b0f5cf9f457021ff7589efaa16005fb69a42bfa126727837d5da49eae82efead9eefd3daf5475fe6260a42459a7d9b4af528fe0251e88",
        "width" : 60
      } ],
      "name" : "80s-90s ",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/robertstewartspiritgrocer"
        },
        "href" : "https://api.spotify.com/v1/users/robertstewartspiritgrocer",
        "id" : "robertstewartspiritgrocer",
        "type" : "user",
        "uri" : "spotify:user:robertstewartspiritgrocer"
      },
      "public" : null,
      "snapshot_id" : "ftApc852+yEw8+4ou/NJAzpDDIjfyl59e+j2SBeShGhO+rPaV5G+xLlQXYOqqAHx",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/robertstewartspiritgrocer/playlists/7jO2RBMDkEys22WpOECXY5/tracks",
        "total" : 294
      },
      "type" : "playlist",
      "uri" : "spotify:user:robertstewartspiritgrocer:playlist:7jO2RBMDkEys22WpOECXY5"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/joesuggspotify/playlist/289DHVipFnpmuOWVDTJ50u"
      },
      "href" : "https://api.spotify.com/v1/users/joesuggspotify/playlists/289DHVipFnpmuOWVDTJ50u",
      "id" : "289DHVipFnpmuOWVDTJ50u",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/6c79c64d4e0c7bbbfbc77e2841a7590c46c2b1fba4ada225c340acef2b5b888c2687ff45140e5930360a866efba7b2cc2b98ac3e1ad1de52cfb6009c3b0c220f53ff2f10ef17a15ae251ec3c01a36007",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/6c79c64d4e0c7bbbfbc77e2841a7590c46c2b1fba4ada225c340acef2b5b888c2687ff45140e5930360a866efba7b2cc2b98ac3e1ad1de52cfb6009c3b0c220f53ff2f10ef17a15ae251ec3c01a36007",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/6c79c64d4e0c7bbbfbc77e2841a7590c46c2b1fba4ada225c340acef2b5b888c2687ff45140e5930360a866efba7b2cc2b98ac3e1ad1de52cfb6009c3b0c220f53ff2f10ef17a15ae251ec3c01a36007",
        "width" : 60
      } ],
      "name" : "80s Baby ",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/joesuggspotify"
        },
        "href" : "https://api.spotify.com/v1/users/joesuggspotify",
        "id" : "joesuggspotify",
        "type" : "user",
        "uri" : "spotify:user:joesuggspotify"
      },
      "public" : null,
      "snapshot_id" : "siPE/59/N21nnjUkoTDJl7C3eYcjTfY3utPktgz1YrBxv2oR17EMkTLSh7dSgHqP",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/joesuggspotify/playlists/289DHVipFnpmuOWVDTJ50u/tracks",
        "total" : 67
      },
      "type" : "playlist",
      "uri" : "spotify:user:joesuggspotify:playlist:289DHVipFnpmuOWVDTJ50u"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/80shitsreloaded/playlist/0T9BIZapmj6FfugY55qTqR"
      },
      "href" : "https://api.spotify.com/v1/users/80shitsreloaded/playlists/0T9BIZapmj6FfugY55qTqR",
      "id" : "0T9BIZapmj6FfugY55qTqR",
      "images" : [ {
        "height" : null,
        "url" : "https://u.scdn.co/images/pl/default/e1eac2296fe80ef17dfb9f15a6a22b5a210eb8f1",
        "width" : null
      } ],
      "name" : "80s Hits Reloaded",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/80shitsreloaded"
        },
        "href" : "https://api.spotify.com/v1/users/80shitsreloaded",
        "id" : "80shitsreloaded",
        "type" : "user",
        "uri" : "spotify:user:80shitsreloaded"
      },
      "public" : null,
      "snapshot_id" : "gopAvaJMHZ0W2kr9BR7p0OUD2uV1sr7ssZg6XyxFlp3yIfWt1FnUqFsS+xWAoOnz",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/80shitsreloaded/playlists/0T9BIZapmj6FfugY55qTqR/tracks",
        "total" : 90
      },
      "type" : "playlist",
      "uri" : "spotify:user:80shitsreloaded:playlist:0T9BIZapmj6FfugY55qTqR"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/sloshytuna/playlist/1iA6aGf4bwY5p98eP73ndN"
      },
      "href" : "https://api.spotify.com/v1/users/sloshytuna/playlists/1iA6aGf4bwY5p98eP73ndN",
      "id" : "1iA6aGf4bwY5p98eP73ndN",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/ba3b3919c95d0139964ec96a32f527d6f4370e9c22bea681227b089c37ea75997cc9d5227149396fa4ada225c340acef2b5b888c2687ff45140e593077ac70a2af6e8b2a977dc95f8472c616ed70dc8b",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/ba3b3919c95d0139964ec96a32f527d6f4370e9c22bea681227b089c37ea75997cc9d5227149396fa4ada225c340acef2b5b888c2687ff45140e593077ac70a2af6e8b2a977dc95f8472c616ed70dc8b",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/ba3b3919c95d0139964ec96a32f527d6f4370e9c22bea681227b089c37ea75997cc9d5227149396fa4ada225c340acef2b5b888c2687ff45140e593077ac70a2af6e8b2a977dc95f8472c616ed70dc8b",
        "width" : 60
      } ],
      "name" : "80s Music",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/sloshytuna"
        },
        "href" : "https://api.spotify.com/v1/users/sloshytuna",
        "id" : "sloshytuna",
        "type" : "user",
        "uri" : "spotify:user:sloshytuna"
      },
      "public" : null,
      "snapshot_id" : "qlrl+OKPY/4T3fPii0FVrj81qRbRW1rt1ro1fXX1q308KjUMCeIpKWuqxNmnfb/K",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/sloshytuna/playlists/1iA6aGf4bwY5p98eP73ndN/tracks",
        "total" : 279
      },
      "type" : "playlist",
      "uri" : "spotify:user:sloshytuna:playlist:1iA6aGf4bwY5p98eP73ndN"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/11101457460/playlist/1UgJJcWVHMEmTisNPaE8bP"
      },
      "href" : "https://api.spotify.com/v1/users/11101457460/playlists/1UgJJcWVHMEmTisNPaE8bP",
      "id" : "1UgJJcWVHMEmTisNPaE8bP",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/2c8cf891d246b0aadf95a2c483b5b243aeda8a41f63a57e509a224ea9e2e4fedaf24f8f57b85ab9a422d57ef1a37ccf0c93f2035080d0fc727662bfe728e70954e523243ac9f05672e393ec85db5279f",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/2c8cf891d246b0aadf95a2c483b5b243aeda8a41f63a57e509a224ea9e2e4fedaf24f8f57b85ab9a422d57ef1a37ccf0c93f2035080d0fc727662bfe728e70954e523243ac9f05672e393ec85db5279f",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/2c8cf891d246b0aadf95a2c483b5b243aeda8a41f63a57e509a224ea9e2e4fedaf24f8f57b85ab9a422d57ef1a37ccf0c93f2035080d0fc727662bfe728e70954e523243ac9f05672e393ec85db5279f",
        "width" : 60
      } ],
      "name" : "POP 80S",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/11101457460"
        },
        "href" : "https://api.spotify.com/v1/users/11101457460",
        "id" : "11101457460",
        "type" : "user",
        "uri" : "spotify:user:11101457460"
      },
      "public" : null,
      "snapshot_id" : "yvSMbmVT7lH8NsknfYOmjZIA9MGPW6ZiEzA1BPO+zcT9cPtMFkkPvdQ9BucVrJDt",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/11101457460/playlists/1UgJJcWVHMEmTisNPaE8bP/tracks",
        "total" : 312
      },
      "type" : "playlist",
      "uri" : "spotify:user:11101457460:playlist:1UgJJcWVHMEmTisNPaE8bP"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/eatpzza/playlist/6pAPG1LY81LMSQnmjGU4l4"
      },
      "href" : "https://api.spotify.com/v1/users/eatpzza/playlists/6pAPG1LY81LMSQnmjGU4l4",
      "id" : "6pAPG1LY81LMSQnmjGU4l4",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/4d12d8287a0d5e9cda568988713e066a4a448982b6c85982f15447256f06fde54023a15a5d84e71886479b5d53645ef1d0234186bffe0d097783d20c096be4f0519a15387627bb19ec12ae363743b48b",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/4d12d8287a0d5e9cda568988713e066a4a448982b6c85982f15447256f06fde54023a15a5d84e71886479b5d53645ef1d0234186bffe0d097783d20c096be4f0519a15387627bb19ec12ae363743b48b",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/4d12d8287a0d5e9cda568988713e066a4a448982b6c85982f15447256f06fde54023a15a5d84e71886479b5d53645ef1d0234186bffe0d097783d20c096be4f0519a15387627bb19ec12ae363743b48b",
        "width" : 60
      } ],
      "name" : " 80s hair bands",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/eatpzza"
        },
        "href" : "https://api.spotify.com/v1/users/eatpzza",
        "id" : "eatpzza",
        "type" : "user",
        "uri" : "spotify:user:eatpzza"
      },
      "public" : null,
      "snapshot_id" : "qJF9vKLIPfqJeoTuRqXbsUEOkv3S6nV3UY7CeUA6Cjs9U1sqmL38xxpN1dbqilo1",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/eatpzza/playlists/6pAPG1LY81LMSQnmjGU4l4/tracks",
        "total" : 128
      },
      "type" : "playlist",
      "uri" : "spotify:user:eatpzza:playlist:6pAPG1LY81LMSQnmjGU4l4"
    }, {
      "collaborative" : false,
      "external_urls" : {
        "spotify" : "http://open.spotify.com/user/deenabob/playlist/5XKwUjOvLU0ZPG9xOAJINv"
      },
      "href" : "https://api.spotify.com/v1/users/deenabob/playlists/5XKwUjOvLU0ZPG9xOAJINv",
      "id" : "5XKwUjOvLU0ZPG9xOAJINv",
      "images" : [ {
        "height" : 640,
        "url" : "https://mosaic.scdn.co/640/27c9e093bd5b9817deb910b41e9094388a3f2962a6bfdaece72a3a8bae75e9fa24c29319cc57e7c2f1d8b65faccb92c4451c223d7773a6b55fd1d20a5a98496c1b244d49baade63f984b98511f7bb9bf",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://mosaic.scdn.co/300/27c9e093bd5b9817deb910b41e9094388a3f2962a6bfdaece72a3a8bae75e9fa24c29319cc57e7c2f1d8b65faccb92c4451c223d7773a6b55fd1d20a5a98496c1b244d49baade63f984b98511f7bb9bf",
        "width" : 300
      }, {
        "height" : 60,
        "url" : "https://mosaic.scdn.co/60/27c9e093bd5b9817deb910b41e9094388a3f2962a6bfdaece72a3a8bae75e9fa24c29319cc57e7c2f1d8b65faccb92c4451c223d7773a6b55fd1d20a5a98496c1b244d49baade63f984b98511f7bb9bf",
        "width" : 60
      } ],
      "name" : "80s soft rock",
      "owner" : {
        "external_urls" : {
          "spotify" : "http://open.spotify.com/user/deenabob"
        },
        "href" : "https://api.spotify.com/v1/users/deenabob",
        "id" : "deenabob",
        "type" : "user",
        "uri" : "spotify:user:deenabob"
      },
      "public" : null,
      "snapshot_id" : "6zgeuIkyogs9CJ8l9uf6pzB/q6QX70aZFVhHx9nnrNpBOJQgcpMgpze9covoIYA8",
      "tracks" : {
        "href" : "https://api.spotify.com/v1/users/deenabob/playlists/5XKwUjOvLU0ZPG9xOAJINv/tracks",
        "total" : 329
      },
      "type" : "playlist",
      "uri" : "spotify:user:deenabob:playlist:5XKwUjOvLU0ZPG9xOAJINv"
    } ],
    "limit" : 20,
    "next" : "https://api.spotify.com/v1/search?query=80s&offset=20&limit=20&type=playlist",
    "offset" : 0,
    "previous" : null,
    "total" : 2416
  }
}

In [8]:
data = response.json()

In [10]:
type(data)


Out[10]:
dict

In [15]:
data.keys()


Out[15]:
dict_keys(['artists'])

In [16]:
response = requests.get('https://api.spotify.com/v1/search?query=biggie&type=artist')

In [17]:
data = response.json()

In [18]:
data.keys()


Out[18]:
dict_keys(['artists'])

In [20]:
playlist_response = requests.get('https://api.spotify.com/v1/search?query=80s&type=playlist')
playlist_data = playlist_response.json()
biggie_response = requests.get('https://api.spotify.com/v1/search?query=biggie&type=artist')
biggie_data = biggie_response.json()

In [21]:
biggie_data


Out[21]:
{'artists': {'href': 'https://api.spotify.com/v1/search?query=biggie&offset=0&limit=20&type=artist',
  'items': [{'external_urls': {'spotify': 'https://open.spotify.com/artist/5me0Irg2ANcsgc93uaYrpb'},
    'followers': {'href': None, 'total': 971124},
    'genres': ['gangster rap', 'hardcore hip hop', 'hip hop', 'rap'],
    'href': 'https://api.spotify.com/v1/artists/5me0Irg2ANcsgc93uaYrpb',
    'id': '5me0Irg2ANcsgc93uaYrpb',
    'images': [{'height': 1250,
      'url': 'https://i.scdn.co/image/3d44c609f22910dcd82cfd3311ed1e41bd37ca8f',
      'width': 1000},
     {'height': 800,
      'url': 'https://i.scdn.co/image/65d46631b7853a2c396558ff4569bb22b486bba3',
      'width': 640},
     {'height': 250,
      'url': 'https://i.scdn.co/image/c84fa657bfda54a366cc3284ac38f8e0e7bbcc2b',
      'width': 200},
     {'height': 80,
      'url': 'https://i.scdn.co/image/826db6d87e55e431df5cdf937a54fd224a65ff8f',
      'width': 64}],
    'name': 'The Notorious B.I.G.',
    'popularity': 76,
    'type': 'artist',
    'uri': 'spotify:artist:5me0Irg2ANcsgc93uaYrpb'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/2dGv0jCarI6vXDCNzAVHns'},
    'followers': {'href': None, 'total': 36},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/2dGv0jCarI6vXDCNzAVHns',
    'id': '2dGv0jCarI6vXDCNzAVHns',
    'images': [],
    'name': 'Biggie D',
    'popularity': 20,
    'type': 'artist',
    'uri': 'spotify:artist:2dGv0jCarI6vXDCNzAVHns'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/6FTvY2Rxnycti33aFW7l0K'},
    'followers': {'href': None, 'total': 3720},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/6FTvY2Rxnycti33aFW7l0K',
    'id': '6FTvY2Rxnycti33aFW7l0K',
    'images': [{'height': 640,
      'url': 'https://i.scdn.co/image/64132d58a98e6c68ea39d7c788a09c5ce5bf8315',
      'width': 640},
     {'height': 300,
      'url': 'https://i.scdn.co/image/da007fe35d942e6f1c47e010adb98d08f9e80794',
      'width': 300},
     {'height': 64,
      'url': 'https://i.scdn.co/image/913ee064ac2832f928e4d1a5e51926eed2055ad2',
      'width': 64}],
    'name': 'Biggie',
    'popularity': 23,
    'type': 'artist',
    'uri': 'spotify:artist:6FTvY2Rxnycti33aFW7l0K'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/6WxHgksj5K5dxZ4rv2yQsW'},
    'followers': {'href': None, 'total': 171},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/6WxHgksj5K5dxZ4rv2yQsW',
    'id': '6WxHgksj5K5dxZ4rv2yQsW',
    'images': [{'height': 673,
      'url': 'https://i.scdn.co/image/6a01fbc9ef5e5ed9edfa0961d3dbbe8d5833d8e5',
      'width': 1000},
     {'height': 431,
      'url': 'https://i.scdn.co/image/ebb6462d7529d353bd4cfb26065e4075e5509687',
      'width': 640},
     {'height': 135,
      'url': 'https://i.scdn.co/image/f917914321b3ffce8efd8adcfa6c5e1a29893758',
      'width': 200},
     {'height': 43,
      'url': 'https://i.scdn.co/image/943b0e748e280dda2a684fbf2c27da57a93b531f',
      'width': 64}],
    'name': 'Biggie Irie',
    'popularity': 15,
    'type': 'artist',
    'uri': 'spotify:artist:6WxHgksj5K5dxZ4rv2yQsW'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/3ukMCckYBLQS1ifA8AUsI3'},
    'followers': {'href': None, 'total': 65},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/3ukMCckYBLQS1ifA8AUsI3',
    'id': '3ukMCckYBLQS1ifA8AUsI3',
    'images': [],
    'name': 'Fabolous|Biggie|Busta|Nate Dogg',
    'popularity': 11,
    'type': 'artist',
    'uri': 'spotify:artist:3ukMCckYBLQS1ifA8AUsI3'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/1RpIWJHxLsDE8YfFcRaBKw'},
    'followers': {'href': None, 'total': 1668},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/1RpIWJHxLsDE8YfFcRaBKw',
    'id': '1RpIWJHxLsDE8YfFcRaBKw',
    'images': [],
    'name': 'Biggie Smalls',
    'popularity': 13,
    'type': 'artist',
    'uri': 'spotify:artist:1RpIWJHxLsDE8YfFcRaBKw'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/1OyAhAPFH8Z4bIJewzy3mE'},
    'followers': {'href': None, 'total': 46},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/1OyAhAPFH8Z4bIJewzy3mE',
    'id': '1OyAhAPFH8Z4bIJewzy3mE',
    'images': [{'height': 640,
      'url': 'https://i.scdn.co/image/29fd23e06454ef84da8d75abfcd66aaf249814ff',
      'width': 640},
     {'height': 300,
      'url': 'https://i.scdn.co/image/4c693b149664a13832cf7f5bed14990f5d071a80',
      'width': 300},
     {'height': 64,
      'url': 'https://i.scdn.co/image/7d4833313f939d4a16333b6e58e42410a8c2f0e1',
      'width': 64}],
    'name': 'Biggie Paul',
    'popularity': 18,
    'type': 'artist',
    'uri': 'spotify:artist:1OyAhAPFH8Z4bIJewzy3mE'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/35B4rRFHwIJrmeXLNN1hF1'},
    'followers': {'href': None, 'total': 9},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/35B4rRFHwIJrmeXLNN1hF1',
    'id': '35B4rRFHwIJrmeXLNN1hF1',
    'images': [{'height': 640,
      'url': 'https://i.scdn.co/image/ede998502eb6030d963826793ecae51826653a0c',
      'width': 640},
     {'height': 300,
      'url': 'https://i.scdn.co/image/88685cc6d9638b561ded05d3c0badf71a1f8ab27',
      'width': 300},
     {'height': 64,
      'url': 'https://i.scdn.co/image/7c245e05f25fbfdb82ae8541767ab26008886083',
      'width': 64}],
    'name': 'Biggie the Kid',
    'popularity': 3,
    'type': 'artist',
    'uri': 'spotify:artist:35B4rRFHwIJrmeXLNN1hF1'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/6jw8vKhvxItIadtspdF7K5'},
    'followers': {'href': None, 'total': 2},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/6jw8vKhvxItIadtspdF7K5',
    'id': '6jw8vKhvxItIadtspdF7K5',
    'images': [],
    'name': 'Alief Biggie',
    'popularity': 4,
    'type': 'artist',
    'uri': 'spotify:artist:6jw8vKhvxItIadtspdF7K5'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/5gNkiKzLO3p5mevQHw2b0q'},
    'followers': {'href': None, 'total': 4},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/5gNkiKzLO3p5mevQHw2b0q',
    'id': '5gNkiKzLO3p5mevQHw2b0q',
    'images': [],
    'name': 'Papa Biggie',
    'popularity': 0,
    'type': 'artist',
    'uri': 'spotify:artist:5gNkiKzLO3p5mevQHw2b0q'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/0wzeEbcsUKiP1mZLkeC3iB'},
    'followers': {'href': None, 'total': 8},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/0wzeEbcsUKiP1mZLkeC3iB',
    'id': '0wzeEbcsUKiP1mZLkeC3iB',
    'images': [],
    'name': 'Mister Biggie',
    'popularity': 0,
    'type': 'artist',
    'uri': 'spotify:artist:0wzeEbcsUKiP1mZLkeC3iB'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/0ylErua0QWjJm1xExk8NCa'},
    'followers': {'href': None, 'total': 2},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/0ylErua0QWjJm1xExk8NCa',
    'id': '0ylErua0QWjJm1xExk8NCa',
    'images': [{'height': 640,
      'url': 'https://i.scdn.co/image/4032748fe023f8340827f3e5536fe727660384d0',
      'width': 640},
     {'height': 300,
      'url': 'https://i.scdn.co/image/7d0abfb01458e34f233fdc1eab0903de562ef915',
      'width': 300},
     {'height': 64,
      'url': 'https://i.scdn.co/image/355b60f390db34a3b48b11c349d2bd7b7e9247c1',
      'width': 64}],
    'name': 'Biggie & Foldy',
    'popularity': 0,
    'type': 'artist',
    'uri': 'spotify:artist:0ylErua0QWjJm1xExk8NCa'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/52bcshIAYPMvoEnEmwus6N'},
    'followers': {'href': None, 'total': 21},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/52bcshIAYPMvoEnEmwus6N',
    'id': '52bcshIAYPMvoEnEmwus6N',
    'images': [],
    'name': 'Biggie Bash',
    'popularity': 6,
    'type': 'artist',
    'uri': 'spotify:artist:52bcshIAYPMvoEnEmwus6N'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/2FU57JKnCnLVaSXaCiTaY8'},
    'followers': {'href': None, 'total': 15},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/2FU57JKnCnLVaSXaCiTaY8',
    'id': '2FU57JKnCnLVaSXaCiTaY8',
    'images': [],
    'name': 'Dj Majah & Blaq Biggie Blaq',
    'popularity': 1,
    'type': 'artist',
    'uri': 'spotify:artist:2FU57JKnCnLVaSXaCiTaY8'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/3WbEnNpaSNPnYzHRXj73WS'},
    'followers': {'href': None, 'total': 12},
    'genres': ['zim'],
    'href': 'https://api.spotify.com/v1/artists/3WbEnNpaSNPnYzHRXj73WS',
    'id': '3WbEnNpaSNPnYzHRXj73WS',
    'images': [],
    'name': 'Biggie Tembo',
    'popularity': 0,
    'type': 'artist',
    'uri': 'spotify:artist:3WbEnNpaSNPnYzHRXj73WS'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/10WpL7wK50c2RMbaSjPAT5'},
    'followers': {'href': None, 'total': 1},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/10WpL7wK50c2RMbaSjPAT5',
    'id': '10WpL7wK50c2RMbaSjPAT5',
    'images': [{'height': 640,
      'url': 'https://i.scdn.co/image/a7830166f311fa73165d7f823dd1043e6d85db4d',
      'width': 640},
     {'height': 300,
      'url': 'https://i.scdn.co/image/19a4a546d23697789736fe8f0940771432b965c7',
      'width': 300},
     {'height': 64,
      'url': 'https://i.scdn.co/image/e79fe8573379b7d7f2eca351cd881830b1af665f',
      'width': 64}],
    'name': 'Louis Biggie',
    'popularity': 0,
    'type': 'artist',
    'uri': 'spotify:artist:10WpL7wK50c2RMbaSjPAT5'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/4KtKqs3wbli7oTsLjpuRKq'},
    'followers': {'href': None, 'total': 0},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/4KtKqs3wbli7oTsLjpuRKq',
    'id': '4KtKqs3wbli7oTsLjpuRKq',
    'images': [],
    'name': 'Biggie Da Roxter',
    'popularity': 0,
    'type': 'artist',
    'uri': 'spotify:artist:4KtKqs3wbli7oTsLjpuRKq'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/0cExlEbrUiYO6Wq1VDyC0D'},
    'followers': {'href': None, 'total': 6},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/0cExlEbrUiYO6Wq1VDyC0D',
    'id': '0cExlEbrUiYO6Wq1VDyC0D',
    'images': [{'height': 600,
      'url': 'https://i.scdn.co/image/6c72b8b513a523c11d2537b3e02c2b5f8db11ff4',
      'width': 600},
     {'height': 300,
      'url': 'https://i.scdn.co/image/e1bfe2b6b66b50b0a43224d91d1120b7d40641bf',
      'width': 300},
     {'height': 64,
      'url': 'https://i.scdn.co/image/7b9939dfc27081894c03c00fbdba3bef54c21fdf',
      'width': 64}],
    'name': 'Biggie Dutch',
    'popularity': 0,
    'type': 'artist',
    'uri': 'spotify:artist:0cExlEbrUiYO6Wq1VDyC0D'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/1BGFuzglzV871bnwTMVLzR'},
    'followers': {'href': None, 'total': 0},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/1BGFuzglzV871bnwTMVLzR',
    'id': '1BGFuzglzV871bnwTMVLzR',
    'images': [{'height': 600,
      'url': 'https://i.scdn.co/image/87e8136e9371dd78f0e289c358136786aa3c6059',
      'width': 600},
     {'height': 300,
      'url': 'https://i.scdn.co/image/5b3a6db14f1b7f5fc2381d2a84c23ca91813caa7',
      'width': 300},
     {'height': 64,
      'url': 'https://i.scdn.co/image/ccae34918f20d9f63d36c8c6608d426fb033e797',
      'width': 64}],
    'name': 'Biggie Dutch feat. Marina Wilde',
    'popularity': 0,
    'type': 'artist',
    'uri': 'spotify:artist:1BGFuzglzV871bnwTMVLzR'},
   {'external_urls': {'spotify': 'https://open.spotify.com/artist/0cbg8Q3ul7S0EOg53foHP1'},
    'followers': {'href': None, 'total': 0},
    'genres': [],
    'href': 'https://api.spotify.com/v1/artists/0cbg8Q3ul7S0EOg53foHP1',
    'id': '0cbg8Q3ul7S0EOg53foHP1',
    'images': [],
    'name': 'MC Biggie',
    'popularity': 0,
    'type': 'artist',
    'uri': 'spotify:artist:0cbg8Q3ul7S0EOg53foHP1'}],
  'limit': 20,
  'next': 'https://api.spotify.com/v1/search?query=biggie&offset=20&limit=20&type=artist',
  'offset': 0,
  'previous': None,
  'total': 49}}

In [22]:
type(data)


Out[22]:
dict

In [23]:
data.keys()


Out[23]:
dict_keys(['artists'])

In [25]:
type(data['artists'])


Out[25]:
dict

In [26]:
data['artists'].keys()


Out[26]:
dict_keys(['offset', 'previous', 'items', 'limit', 'next', 'href', 'total'])

In [28]:
biggie_artists = data['artists']['items']

In [30]:
for artist in biggie_artists:
    print(artist['name'], artist['popularity'])


The Notorious B.I.G. 76
Biggie D 20
Biggie 23
Biggie Irie 15
Fabolous|Biggie|Busta|Nate Dogg 11
Biggie Smalls 13
Biggie Paul 18
Biggie the Kid 3
Alief Biggie 4
Papa Biggie 0
Mister Biggie 0
Biggie & Foldy 0
Biggie Bash 6
Dj Majah & Blaq Biggie Blaq 1
Biggie Tembo 0
Louis Biggie 0
Biggie Da Roxter 0
Biggie Dutch 0
Biggie Dutch feat. Marina Wilde 0
MC Biggie 0

In [32]:
import requests
biggie_response = requests.get('https://api.spotify.com/v1/search?query=biggie&type=artist')
biggie_data = biggie_response.json()
for artist in biggie_artists:
    print(artist['name'], artist['popularity'], artist['id'])


The Notorious B.I.G. 76 5me0Irg2ANcsgc93uaYrpb
Biggie D 20 2dGv0jCarI6vXDCNzAVHns
Biggie 23 6FTvY2Rxnycti33aFW7l0K
Biggie Irie 15 6WxHgksj5K5dxZ4rv2yQsW
Fabolous|Biggie|Busta|Nate Dogg 11 3ukMCckYBLQS1ifA8AUsI3
Biggie Smalls 13 1RpIWJHxLsDE8YfFcRaBKw
Biggie Paul 18 1OyAhAPFH8Z4bIJewzy3mE
Biggie the Kid 3 35B4rRFHwIJrmeXLNN1hF1
Alief Biggie 4 6jw8vKhvxItIadtspdF7K5
Papa Biggie 0 5gNkiKzLO3p5mevQHw2b0q
Mister Biggie 0 0wzeEbcsUKiP1mZLkeC3iB
Biggie & Foldy 0 0ylErua0QWjJm1xExk8NCa
Biggie Bash 6 52bcshIAYPMvoEnEmwus6N
Dj Majah & Blaq Biggie Blaq 1 2FU57JKnCnLVaSXaCiTaY8
Biggie Tembo 0 3WbEnNpaSNPnYzHRXj73WS
Louis Biggie 0 10WpL7wK50c2RMbaSjPAT5
Biggie Da Roxter 0 4KtKqs3wbli7oTsLjpuRKq
Biggie Dutch 0 0cExlEbrUiYO6Wq1VDyC0D
Biggie Dutch feat. Marina Wilde 0 1BGFuzglzV871bnwTMVLzR
MC Biggie 0 0cbg8Q3ul7S0EOg53foHP1

In [55]:
# /v1/artists/{id}/albums
# From the docs at https://developer.spotify.com/web-api/artist-endpoints/

# Biggie the Kid
response = requests.get("https://api.spotify.com/v1/artists/35B4rRFHwIJrmeXLNN1hF1/top-tracks?country=US")
data = response.json()
tracks = data['tracks']
for track in tracks:
    print(track['name'])


Hunnits (feat. Philthy Rich)
Troubled Man
On My Block (feat. Big Oso Loc)
Lay It Down (feat. Loon the Goon)

In [71]:
# How explicit is Biggie the Kid?
response = requests.get("https://api.spotify.com/v1/artists/35B4rRFHwIJrmeXLNN1hF1/top-tracks?country=US")
data = response.json()
tracks = data['tracks']
# Counting problem!!!!!
# PART ONE: Initial condition (a.k.a. our start value)
track_count = 0 # I don't know of any tracks!!!!
clean_count = 0 # I don't know of any explicit tracks!!!
for track in tracks:
    # You can discover new things in here! It's like a treasure chest
    print(track['name'], track['explicit'])
    # Make track_count one bigger every time through the loop
    if True:
        track_count = track_count + 1
    # PART TWO: Test, and an increment
    if not track['explicit']:
        clean_count = clean_count + 1
    print("I have found", track_count, "tracks, and", clean_count, "are clean")
# PART THREE: Final use of our counting 
print("Overall, I discovered", track_count, "tracks")
print("And", clean_count, "were non-explicit")
print("Which means", 100 * clean_count / track_count, " percent were clean")


Hunnits (feat. Philthy Rich) True
I have found 1 tracks, and 0 are clean
Troubled Man True
I have found 2 tracks, and 0 are clean
On My Block (feat. Big Oso Loc) True
I have found 3 tracks, and 0 are clean
Lay It Down (feat. Loon the Goon) True
I have found 4 tracks, and 0 are clean
Overall, I discovered 4 tracks
And 0 were non-explicit
Which means 0.0  percent were clean

In [72]:
# How explicit is the Notorious B.I.G.?
response = requests.get("https://api.spotify.com/v1/artists/5me0Irg2ANcsgc93uaYrpb/top-tracks?country=US")
data = response.json()
tracks = data['tracks']
# Counting problem!!!!!
# PART ONE: Initial condition (a.k.a. our start value)
track_count = 0 # I don't know of any tracks!!!!
clean_count = 0 # I don't know of any explicit tracks!!!
for track in tracks:
    # You can discover new things in here! It's like a treasure chest
    print(track['name'], track['explicit'])
    # Make track_count one bigger every time through the loop
    if True:
        track_count = track_count + 1
    # PART TWO: Test, and an increment
    if not track['explicit']:
        clean_count = clean_count + 1
    print("I have found", track_count, "tracks, and", clean_count, "are clean")
# PART THREE: Final use of our counting 
print("Overall, I discovered", track_count, "tracks")
print("And", clean_count, "were non-explicit")
print("Which means", 100 * clean_count / track_count, " percent were clean")


Old Thing Back (feat. Ja Rule and Ralph Tresvant) True
I have found 1 tracks, and 0 are clean
Hypnotize True
I have found 2 tracks, and 0 are clean
Mo Money Mo Problems (feat. Mase & Puff Daddy) True
I have found 3 tracks, and 0 are clean
Juicy True
I have found 4 tracks, and 0 are clean
Big Poppa True
I have found 5 tracks, and 0 are clean
Notorious Thugs True
I have found 6 tracks, and 0 are clean
Suicidal Thoughts True
I have found 7 tracks, and 0 are clean
Gimme The Loot True
I have found 8 tracks, and 0 are clean
Get Money - Performed by Junior M.A.F.I.A. Explicit True
I have found 9 tracks, and 0 are clean
Sky's The Limit (feat. 112) True
I have found 10 tracks, and 0 are clean
Overall, I discovered 10 tracks
And 0 were non-explicit
Which means 0.0  percent were clean

In [77]:
# MC Biggie is 0cbg8Q3ul7S0EOg53foHP1
artist_id = "0cbg8Q3ul7S0EOg53foHP1"

# How explicit is the given artist?
response = requests.get("https://api.spotify.com/v1/artists/" + artist_id + "/top-tracks?country=US")
data = response.json()
tracks = data['tracks']
# Counting problem!!!!!
# PART ONE: Initial condition (a.k.a. our start value)
track_count = 0 # I don't know of any tracks!!!!
clean_count = 0 # I don't know of any explicit tracks!!!
for track in tracks:
    # You can discover new things in here! It's like a treasure chest
    print(track['name'], track['explicit'])
    # Make track_count one bigger every time through the loop
    if True:
        track_count = track_count + 1
    # PART TWO: Test, and an increment
    if not track['explicit']:
        clean_count = clean_count + 1
    print("I have found", track_count, "tracks, and", clean_count, "are clean")
# PART THREE: Final use of our counting 
if track_count > 0:
    print("Overall, I discovered", track_count, "tracks")
    print("And", clean_count, "were non-explicit")
    print("Which means", 100 * clean_count / track_count, " percent were clean")
else:
    print("No top tracks found")


No top tracks found

In [84]:
#
#
# Given artist_id, how explicit is the artist?
#
#
response = requests.get("https://api.spotify.com/v1/artists/" + artist_id + "/top-tracks?country=US")
data = response.json()
tracks = data['tracks']
# Counting problem!!!!!
# PART ONE: Initial condition (a.k.a. our start value)
track_count = 0 # I don't know of any tracks!!!!
clean_count = 0 # I don't know of any explicit tracks!!!
for track in tracks:
    # You can discover new things in here! It's like a treasure chest
    print(track['name'], track['explicit'])
    # Make track_count one bigger every time through the loop
    if True:
        track_count = track_count + 1
    # PART TWO: Test, and an increment
    if not track['explicit']:
        clean_count = clean_count + 1
    print("I have found", track_count, "tracks, and", clean_count, "are clean")
# PART THREE: Final use of our counting 
print("artist_id is", artist_id)
if track_count > 0:
    print("Overall, I discovered", track_count, "tracks")
    print("And", clean_count, "were non-explicit")
    print("Which means", 100 * clean_count / track_count, " percent were clean")
else:
    print("No top tracks found")


Lasciami Solo True
I have found 1 tracks, and 0 are clean
Numero Zero True
I have found 2 tracks, and 0 are clean
Real Madrid Freestyle - Intro True
I have found 3 tracks, and 0 are clean
Eroe True
I have found 4 tracks, and 0 are clean
Il Catastorie True
I have found 5 tracks, and 0 are clean
I Top Negri True
I have found 6 tracks, and 0 are clean
Leon True
I have found 7 tracks, and 0 are clean
Igno-Swing Pt.2 True
I have found 8 tracks, and 0 are clean
Al-Aqsa Freestyle False
I have found 9 tracks, and 1 are clean
Boccacicci False
I have found 10 tracks, and 2 are clean
artist_id is 1OyAhAPFH8Z4bIJewzy3mE
Overall, I discovered 10 tracks
And 2 were non-explicit
Which means 20.0  percent were clean

In [83]:
artist_id = "1OyAhAPFH8Z4bIJewzy3mE"

In [1]:
import requests 
response = requests.get("https://api.spotify.com/v1/search?q=lil&type=artist&limit=50&market=US")
data = response.json()
data


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-b9c6f6525038> in <module>()
----> 1 import requests
      2 response = requests.get("https://api.spotify.com/v1/search?q=lil&type=artist&limit=50")
      3 data = response.json()
      4 data

ImportError: No module named 'requests'

In [ ]:
type(data)
data.keys()
type(data['artists'])
data['artists'].keys()
artists = data['artists']['items']
artists

for artist in artists:
    print(artist['name'], artist['popularity']) 
    if len(artist['genres']) > 0:
        genres = ", ".join(artist['genres'])
        print("Genre list: ", genres)
    else:
        print("No genres listesd")

In [1]:
most_popular_name = ""
most_popular_score = 0
for artist in artists:
    print("Looking at", artist['name'], "who has a popularity score of", artist['popularity'])

    #THE CONDITIONAL - WHAT YOU'RE TESTING
    print("Comparing", aritst['popularity'], "to", most_popular_score, "of")
    if artist['popularity'] > most_popular_score and artist ['name'] != "Lil Wayne":
        #THE CHANGE - WHAT YOU'RE KEEPING TRACK OF
        most_popular_name = artist['name']
        most_popular_score = artist['popularity']
        
print(most_popular_name, most_popular_score)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-59d68f9249ea> in <module>()
      1 most_popular_name = ""
      2 most_popular_score = 0
----> 3 for artist in artists:
      4     print("Looking at", artist['name'], "who has a popularity score of", artist['popularity'])
      5 

NameError: name 'artists' is not defined

In [ ]:
target_score = 72 
#PART ONE: INITIAL CONDITON

second_best_artists = []
#AGGREGATION PROBLEM - when you're looping through a series of objects and you someitmes you want to add some 
#of those objects to a DIFFERENT list
for artists in artists:
    print("Looking at", artist['name'], "who has a popularity of", artist['popularity'])
    #PART TWO: CONDITONAL - when we want to add someone to our list
    if artist['popularity'] == 72:
        #PART THREE: THE CHANGE - add artist to our list 
        second_best_artists.append(artist['name'])
        
print("OUR SECOND BEST ARTISTS ARE:")
for artist in second_best_artists:
    print(artist)

In [ ]:


In [ ]:
for artist in artists:
    #print("Looking at", artist['name'])
    if artist['name'] == "Lil' Kim":
        print("Found Lil' Kim")
        print(artist['popularity'])
    else: 
        pass
        #print("Not Lil' Kim")

Problem Four?

lil_kim_popularity = 62

AGGREGATON PROBLEM

more_popular_than_lil_kim = []

THE LOOP

for artist in artist:

#THE CONDITONAL is the artist more popular than lil kim?
if artist['popularity'] > lil_kim_popularity:
    print(artist['name'], "has a score of", artist['popularity'])
    more_popular_than_lil_kim.append(artist['name'])
else:
    print(artist['name'], "is less popular with a score of", artist['popularity'])

print("##### More popular than lil kim"): print(artist_name)

How to count the genres

AGGREGATION PROBLEM

all_genres = []

THE LOPO

for artist in artists: print("ALL GENRES WE'VE HEARD OF:", all_genres)

#THE CONDITIONAL: none
print("Current artist has:", artist['genres'])
all_genres = all_genres + artist['genres']

you can add a list using .append but ^ this is okay because its two different things..?

print("##### ALL THE GENRES WE'VE HEARD OF AT THE END:") print(all_genres)

your_list = ['a', 'b', 'c', 'd']

your_list.count[c]

unique_genres = set(all_genres) for genre in unique_genres: genre_count = all_genres.count(genre) print(genre, "shows up", genre_count, "times")

PYTHON LIBRARY CALLED COLLECTIONS!! INSIDE OF IT IS A MAGIC THING CALLED Counter.

import collections

counts = collections.Counter(all_genres) print('crunk shows up', counts['crunk'], "times")

counts.most_common(# you want to see)

another way to do this:

from collections import Counter


In [ ]:
#list(range(91)) gives us a list of 0-90

In [ ]:
# How to automate getting all of the results

response = requests.get("https://api.spotify.com/v1/search?q=lil&type=artist&limit=50&market=US")
small_data = resonse.json()

data['artists']
print(len(data['artists']['items'])) #we only get 10 artists
print(data['artists']['total'])

#FIRST PAGE: artists 1-50, offeset of 0 
#https://api.spotify.com/v1/search?q=lil&type=artist&limit=50&offset=50
#SECOND PAGE: artists 51-100, offset of 50 
#https://api.spotify.com/v1/search?q=lil&type=artist&limit=50&offset=

all artists = []
for page in range(91):
    #Get a page 
    offset = page * 50 
    print("We are on page", page, "with an offset of", offset)
    
print("Successfully retrieved", len(all_artists), "artists")

In [ ]:
states = []
for earthquake in data['features']:
    place = earthquake['properties']['place']
    results = place.split(",")
    #print(results)
    #make sure it has to segments
    if len(results) > 1:
        states_name = results[1]
        if state_name == "CA":
            states.append("California")
        #print(results[1])
        #states.append(place)
        #print(earthquake)['properties]['place]
states
from collections import Counter 
counts = Counter(states)
counts.most_common