2

My problem is

I have made curl request on paxfull api earlier it was returning result but now its returning 503 .

Here is my code

 $handle = curl_init();

curl_setopt($handle, CURLOPT_URL, 'https://paxful.com/buy-bitcoin?format=json');
curl_setopt($handle, CURLOPT_POST, false);
curl_setopt($handle, CURLOPT_BINARYTRANSFER, false);
curl_setopt($handle, CURLOPT_HEADER, true);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 10);

$response = curl_exec($handle);
$hlength  = curl_getinfo($handle, CURLINFO_HEADER_SIZE);
$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
$body     = substr($response, $hlength);

// If HTTP response is not 200, throw exception
if ($httpCode != 200) {
    throw new Exception($httpCode);
}

I get this error:

Error Fatal error: Uncaught exception 'Exception' with message '503'

I googled and found it might be ip address blocked but when made get request at browser its giving results to me.

now i came with conclusion they are not allowing any GET Request .

if you run url https://paxful.com/buy-bitcoin?format=json it first check browser the return the result.

how can we get results of paxfull api. please suggest

here is snapshot enter image description here

then there api redirects 404

url http://localhost/cdn-cgi/l/chk_jschl?jschl_vc=c5b74eae14eb1b1e5862f913b9f0f178&pass=1499953121.017-h%2FljgkjMr%2B&jschl_answer=18913

  • Its not possible through javascript also

fiddle http://jsfiddle.net/00cvyyuo/350/

i found link How to bypass cloudflare bot/ddos protection in Scrapy?

but this link helps in python so can someone help in php or javascript.

afeef
  • 4,396
  • 11
  • 35
  • 65

1 Answers1

0

try to use Chrome's network tab in Developer Tools(f12) to see the actual request being sent. If it works then try to repeat the request from a REST client, where you can edit the headers to check what works and what not.

If you got it working then set all the headers in cURL. If it fails then set verbose and check what was sent.

katona.abel
  • 771
  • 4
  • 12
  • Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Accept-Encoding:gzip, deflate, br Accept-Language:en-US,en;q=0.8,hi;q=0.6 Cache-Control:no-cache Connection:keep-alive Cookie:PHPSESSID=7bb9t8jf3beuus4ulgfkj9nfr4 Host:localhost Pragma:no-cache Upgrade-Insecure-Requests:1 User-Agent:Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36 – afeef Jul 13 '17 at 10:54
  • I do not need the request. You have to figure out what you have to send. Use the REST client to see what you need to send! Try to remove all the unnecessary ones – katona.abel Jul 13 '17 at 10:56
  • i have checked this api is not giving response from any ip – afeef Jul 13 '17 at 13:31