JSON Response - Autoparse

For select websites the API will parse all the valuable data in the HTML response and return it in JSON format. To enable this feature, simply add autoparse=true to your request and the API will parse the data for you. Currently, this feature works with Amazon, Google Search, Google Shopping and Walmart.

  • API REQUEST

<?php $url =
"https://api.scraperapi.com?api_key=APIKEY&autoparse=true&url=http://httpbin.org/ip"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,
TRUE); curl_setopt($ch, CURLOPT_HEADER,
FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,
0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,
0); $response = curl_exec($ch); curl_close($ch); print_r($response);
  • PROXY MODE

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://httpbin.org/ip");
curl_setopt($ch, CURLOPT_PROXY, "http://scraperapi.autoparse=true:APIKEY@proxy-server.scraperapi.com:8001");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
  • SDK METHOD

# remember to install the library: composer require scraperapi/sdk
<?php
$client = new ScraperAPIClient("APIKEY");
$result = $client->get("http://httpbin.org/ip", ["autoparse" => true])->raw_body;
print($result);

Last updated