I was trying to get RSS info from a website the other day, but when I tried to load it using PHP it returned a 403 error.
This was my PHP code:
$rss = file_get_contents('https://hypixel.net/forums/-/index.rss');
failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
Some people don't like servers accessing their stuff. They provide a service intended for human consumers, and not bots. Therefore they may include code that checks whether you are in fact a human using a web browser, which your naïve PHP script is failing to provide. Therefore, the third-party is returning a 403 Forbidden error, indicating that it is forbidden for your program to access it.
There are ways around this, of course, depending on how it's implemented. The most obvious thing to do is send a
User-Agent header pretending to be a browser. But servers may do more clever checks than this, and it's questionably moral.