This is an example of using promises in Javascript. We are going to connect two APIs using data from the first one on the second by promises.
Get Top Artists API: http://ws.audioscrobbler.com/2.0/?method=chart.gettopartists&api_key=API_KEY&format=json
Get Top Tracks per Artist API: http://ws.audioscrobbler.com/2.0/?method=chart.gettopartists&artist=ARTIST_NAME&api_key=API_KEY&format=json
To generate API_KEY go to: https://www.last.fm/api/account/create
- Clone the repository.
- Open index.html on any navegator.
- Go to inspector.