I am trying to access an API URL using curl, which has worked perfectly on my computer. But once I moved over my website to a VPS it suddenly stopped working, due to that the API-Host is using cloudflare, and since my VPS-IP eventually looks "suspect", it forces me to pass this 5 second firewall before I visit the site.
I don't know how I can bypass this, or somehow get trough this layer using curl.
This is my code.
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_ENCODING, '');
curl_setopt ($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt ($ch, CURLOPT_TIMEOUT, 180);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt ($ch, CURLOPT_FAILONERROR, true);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
$result = curl_exec($ch);
curl_close ($ch);
I have tried to set a specific browser for the curl request, and see if that works, but no, the API won't give me anything back except nullpointers.
Any help appreciated.