title: Extract Preview_Url through spotify API
body: <p>Well, I intend through the Spotify API to extract the function <code>preview_url</code> but I am not able to get to this function behind the code so I come to ask for your help.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>"preview_url" : "https://p.scdn.co/mp3-preview/5dcd99cf811094408dcfc1befe014495d786dab5",</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    "artists" : {
      "href" : "https://api.spotify.com/v1/search?query=MAROON+5+ANIMALS&amp;offset=0&amp;limit=1&amp;type=artist",
      "items" : [ ],
      "limit" : 1,
      "next" : null,
      "offset" : 0,
      "previous" : null,
      "total" : 0
    },
    "tracks" : {
      "href" : "https://api.spotify.com/v1/search?query=MAROON+5+-+ANIMALS&amp;offset=0&amp;limit=1&amp;type=track",
      "items" : [ {
        "album" : {
          "album_type" : "album",
          "artists" : [ {
            "external_urls" : {
              "spotify" : "https://open.spotify.com/artist/04gDigrS5kc9YWfZHwBETP"
            },
            "href" : "https://api.spotify.com/v1/artists/04gDigrS5kc9YWfZHwBETP",
            "id" : "04gDigrS5kc9YWfZHwBETP",
            "name" : "Maroon 5",
            "type" : "artist",
            "uri" : "spotify:artist:04gDigrS5kc9YWfZHwBETP"
          } ],
          "available_markets" : [ "CA", "MX", "US" ],
          "external_urls" : {
            "spotify" : "https://open.spotify.com/album/2Auw0pTT6EcQdvHNimhLQI"
          },
          "href" : "https://api.spotify.com/v1/albums/2Auw0pTT6EcQdvHNimhLQI",
          "id" : "2Auw0pTT6EcQdvHNimhLQI",
          "images" : [ {
            "height" : 640,
            "url" : "https://i.scdn.co/image/4c23a82f33b034795a0fbc67af559420c8cb4928",
            "width" : 640
          }, {
            "height" : 300,
            "url" : "https://i.scdn.co/image/44b0e6423240ed25f36f351ae043f68bb2ca3446",
            "width" : 300
          }, {
            "height" : 64,
            "url" : "https://i.scdn.co/image/2e8ff05c6f96006130bbc64ef0b42b402252ace8",
            "width" : 64
          } ],
          "name" : "V",
          "type" : "album",
          "uri" : "spotify:album:2Auw0pTT6EcQdvHNimhLQI"
        },
        "artists" : [ {
          "external_urls" : {
            "spotify" : "https://open.spotify.com/artist/04gDigrS5kc9YWfZHwBETP"
          },
          "href" : "https://api.spotify.com/v1/artists/04gDigrS5kc9YWfZHwBETP",
          "id" : "04gDigrS5kc9YWfZHwBETP",
          "name" : "Maroon 5",
          "type" : "artist",
          "uri" : "spotify:artist:04gDigrS5kc9YWfZHwBETP"
        } ],
        "available_markets" : [ "CA", "MX", "US" ],
        "disc_number" : 1,
        "duration_ms" : 231012,
        "explicit" : false,
        "external_ids" : {
          "isrc" : "USUM71409576"
        },
        "external_urls" : {
          "spotify" : "https://open.spotify.com/track/2bL2gyO6kBdLkNSkxXNh6x"
        },
        "href" : "https://api.spotify.com/v1/tracks/2bL2gyO6kBdLkNSkxXNh6x",
        "id" : "2bL2gyO6kBdLkNSkxXNh6x",
        "name" : "Animals",
        "popularity" : 69,
        "preview_url" : "https://p.scdn.co/mp3-preview/5dcd99cf811094408dcfc1befe014495d786dab5",
        "track_number" : 2,
        "type" : "track",
        "uri" : "spotify:track:2bL2gyO6kBdLkNSkxXNh6x"
      } ],
      "limit" : 1,
      "next" : "https://api.spotify.com/v1/search?query=MAROON+5+-+ANIMALS&amp;offset=1&amp;limit=1&amp;type=track",
      "offset" : 0,
      "previous" : null,
      "total" : 99
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Code that allows me to reach the desired function</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$get_json-&gt;tracks-&gt;items[0]-&gt;artists[1]-&gt;external_urls-&gt;preview_url;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Can you help me? Thank you!</p>