Does anyone know why I’m getting this when making requests to the lemmy api?

<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>

The request in quesiton is a GET request to https://lemmy.ml/api/v3/post/list?community_name=asklemmy. It only happens when making the request to lemmy.ml, not to other instances. When I paste the url into my browser address bar it works.

  • tal
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    11 days ago

    Well, you’ve got a good and a bad case. So you probably have all the parts you need to solve the puzzle.

    So the next step is probably to narrow down what precisely it is that breaks it.

    I’d probably see what headers are being sent for each of your requests, since that’s a source of difference, and then add them in one by one to the non-working case until it starts working.

    I mean, could be anything. Could be that they restricted the User-Agent of the client you’re using for the request due to someone spamming them or something.