I'm trying to use the G2A search api (got it from web sniffing). This is the url: https://www.g2a.com/new/api/v2/products/filter/?query=PSN&sort=preorder&wholesale=false
. When I go there in my browser it just normally shows me a ton of results. While when I use PHP, I get "Access Denied". Here is the code that I'm using right now:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://www.g2a.com/new/api/v2/products/filter/?query=PSN&sort=preorder&wholesale=false");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = [
'Upgrade-Insecure-Requests: 1',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36',
'Sec-Fetch-User: ?1',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Sec-Fetch-Site: none',
'Sec-Fetch-Mode: navigate',
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$res = curl_exec($ch);
curl_close($ch);
When I do echo $res
. It returns the "access denied" saying I have no access. Any way around this? Thanks for your time,
EDIT: When I use Edge (total clean browser, never use it), it just normally shows the results. The PHP and the browsers are both on the same machine, so it's not an IP range block.