I need a little help on pulling events data from the Bandsintown API. I tested the HTTP GET request in the Postman App and it returns data correctly.
Now I am trying to pull this data into a JavaScript to then render it on a website that I design, but it seems that something does not work. Here's my code:
var eventRequest = new XMLHttpRequest();
eventRequest.open('GET', 'https://rest.bandsintown.com/artists/${artistname}/events?date=upcoming&app_id=${app_id}');
eventRequest.onload = function() {
var eventsData = eventRequest.responseText;
};
eventRequest.send();
To render the data further down in the JS I am using:
document.getElementById("app").innerHTML = `
${eventsData.map(eventTemplate).join("")}
`;