The guardian api

Hi i am trying out the guardian api i have managed to retrieve some data but how do i dynamically change the query parameter? how do i manipulate the url
fetch(‘******-*******’).then(response => response.json())
.then(data => {
let container = document.querySelector(‘.card-container’)
let results = data.response.results;
results.forEach(result =>{
let title = document.createElement(‘p’)
title.innerHTML = result.webTitle;

    let weburl = document.createElement('a')
    weburl.setAttribute('href', result.webUrl)
    weburl.innerHTML = result.webUrl

    let card = document.createElement('div')



so in my url i have the base url + middle east as my query and then my api wich i have starred out, how do i add these in dynamically ? not sure if my question is clear

i tried this but does not work
let params = new URLSearchParams({
‘q’: ‘middle east’,
‘section’: ‘technology’,
‘page-size’ : 5,
‘orderBy’: ‘newest’,
‘api-key’: apiKey,

const apiUrl =${params};

says no api found
so i tried this bbut it just so messy and im not sure how to play around with all the parameters

const baseUrl = ’’;

let pageSize = 8;
let pageUrlparam = &page-size=${pageSize}

let parameter = ‘burger’

let encodedParam = encodeURIComponent(parameter)
let queryParams = ?q=${encodedParam}&api-key=${apiKey}

let url = ${baseUrl}${queryParams}${pageUrlparam}
how can i improve on this ? im just relatively new to learning js but not happy with what i have so far

const apiKey = ‘**********************’
let params = new URLSearchParams({
‘q’: ‘gaza’,
‘section’: ‘technology’,
‘page-size’ : 20,
‘orderBy’: ‘newest’,
‘api-key’: apiKey,
‘show-fields’: ‘thumbnail’

const apiUrl =${params};

figured it out, after 24 hours almost pffft!