I feel like every time I post, the answer is simple, but the documentation is terrible. The task: Call Magento API from a JavaScript program in Node.js.
- Login to your Magento Admin account at https://%5Byour-domain%5D/admin
- Create an integration: System >> Integrations >> Add New Intgration
- Copy the Access Token for use later in the header of your get request


Here is the code in a format you can cut and paste.
const axios = require('axios').default;
axios({
method: 'get',
url: 'https://[My URL Here]/rest/default/V1/products' +
'?searchCriteria[currentPage]=1&searchCriteria[pageSize]=5',
responseType: 'text/json',
timeout: 1000,
headers: {'authorization': 'Bearer [My Access Token Here]'}
})
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function(err) {
console.log(err.message);
})
.finally(
function() {
console.log('finally');
}
)