Closed alptonguc closed 1 year ago
Even npm.runkit is getting 403. I think there is a general problem.
Same issue here, hopefully gonna be resolved soon?
I couldnt wait tho, you can use this for searches (node.js fetch)
fetch('https://howlongtobeat.com/api/search', {
headers: {
accept: '*/*',
'accept-language': 'en-US,en;q=0.9',
'content-type': 'application/json',
Referer: 'https://howlongtobeat.com/',
'Referrer-Policy': 'no-referrer',
},
body: `{"searchType":"games","searchTerms":["${gameTitle}"],"searchPage":1,"size":20,"searchOptions":{"games":{"userId":0,"platform":"","sortCategory":"popular","rangeCategory":"main","rangeTime":{"min":null,"max":null},"gameplay":{"perspective":"","flow":"","genre":""},"rangeYear":{"min":"","max":""},"modifier":""},"users":{"sortCategory":"postcount"},"lists":{"sortCategory":"follows"},"filter":"","sort":0,"randomizer":0}}`,
method: 'POST',
});
I ran into this issue as well and it appears to be happening because axios sets the user-agent header to 'axios', so if it is set to something else the call goes through. Opened PR to fix here: https://github.com/ckatzorke/howlongtobeat/pull/54
Fetch also did work but PR is working fine now.
While trying to get a response i am getting Error: Request failed with status code 403 the code was working fine 4 months ago but not anymore. Is it just me or this is normal?