0

Screenshot: https://i.imgur.com/qrfrnfj.jpg

Host documentation:

Rate Limiting

Requests are throttled by the server by source IP to 60 per minute for authenticated requests, and 25 per minute for unauthenticated requests, with some exceptions.

Your application should identify itself to our servers via a unique user agent string in order to achieve the maximum number of requests per minute.

I am seeing 'Too many Requests' there so I clearly need to throttle my app. But the ratelimit is 25, and when I look at the user agent I see:

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0

In my code I have...

function getRelease(idFiltered) {
  return fetch(`https://api.discogs.com/releases/${idFiltered}`, {
    'User-Agent': 'Dispodger/0.1',
  })

...but it looks like that is not being sent correctly.

I tried with Chrome as well, and I appear to be suffering with the same problem -

user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36

I read this, which reports a similar problem. Maybe I need to add...

Accept: 'application/json',
'Content-Type': 'application/json',

...but I'm not sure about that.

Any ideas how to fix this problem please? TIA.

0 Answers0