Hocam kod snippet ınızı paylaşırsanız daha kolay yardımcı olabilirim ancak temel mantık şu şekilde olacak herhalde. fetch yapısını kullanmanız gerekiyor.
let data = [];
fetch("JSON_URL")
.then((res) => res.json())
.then((res) => {
let button = document.getElementById("BUTTON_ID");
button.onclick = () => {
data.push(res);
};
});