const questionFilter = '!*7PmBPEzvIHchpOMByA174F6_hcW' ; const thisSite = window . location . hostname . replace ( /\.\w+$/ , '' ) . replace ( /\.stackexchange$/ , '' ) ; const paramsArr = [ [ 'key' , 'I6*G8zzGnUzYq*dbUXppjg((' ] , [ 'site' , thisSite ] , [ 'filter' , questionFilter ] , ] ; const searchParams = new URLSearchParams ( paramsArr ) ; const paramsString = `?${ searchParams . toString ( ) }` ; export const getApi = async ( questionIds ) => { if ( ! questionIds . length ) { return { items : [ ] } ; } const url = `https://api.stackexchange.com/2.2/questions/${ questionIds . join ( ';' ) }${ paramsString }` ; const response = await fetch ( url ) ; const responseObj = await response . json ( ) ; return responseObj as ApiQuestions ; } ;