A simple native Javascript solution for your use case would be
fetch('url1').then(res1 => {
const {urlParam} = res.url; // if url is an object
const url2= `construct_your_url_here_${urlParam}`;
return url2
}).then(newUrl => {
fetch(newUrl).then()
})
In more concise ES6 way
fetch('/article/promise-chaining/user.json')
.then(response => response.json())
.then(user => fetch(`https://api.github.com/users/${user.name}`))
.then(response => response.json())
.then(githubUser => {
let img = document.createElement('img');
img.src = githubUser.avatar_url;
img.className = "promise-avatar-example";
document.body.append(img);
setTimeout(() => img.remove(), 3000);
});
More reading - javascript.info/promise-chaining