JSON Response - Autoparse

For selected domains we offer a parameter that parses the data and returns structured JSON format. You enable the parsing simply by adding autoparse=true to your request.

Available domains:

GoogleAmazonWalmartEbay

Search Result

Product Pages

Product Pages

Products Pages

News Results

Search Results

Category Pages

Search Results (coming soon)

Job Results

Offers

Search Results

Shopping Results

Product Reviews

Product Reviews

Google Maps (coming soon)

We recommend using our Structured Data Endpoints instead of the autoparse parameter.

You can find all available endpoints here,

API REQUEST

try {
String apiKey = "APIKEY";
String url = "https://api.scraperapi.com?api_key=" + apiKey + "&autoparse=true&url=http://httpbin.org/ip";
URL urlForGetRequest = new URL(url);
String readLine = null;
HttpURLConnection conection = (HttpURLConnection) urlForGetRequest.openConnection();
conection.setRequestMethod("GET");
int responseCode = conection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(conection.getInputStream()));
StringBuffer response = new StringBuffer();
while ((readLine = in.readLine()) != null) {
response.append(readLine);
}
in.close();
System.out.println(response.toString());
} else {
throw new Exception("Error in API Call");
}
} catch (Exception ex) {
ex.printStackTrace();
}

PROXY MODE

try {
  String apiKey = "APIKEY";
  String proxy = "http://scraperapi.autoparse=true:" + apiKey + "@proxy-server.scraperapi.com";
  URL server = new URL("http://httpbin.org/ip");
  Properties systemProperties = System.getProperties();
  systemProperties.setProperty("http.proxyHost", proxy);
  systemProperties.setProperty("http.proxyPort", "8001");
  HttpURLConnection httpURLConnection = (HttpURLConnection) server.openConnection();
  httpURLConnection.connect();
  String readLine = null;
  int responseCode = httpURLConnection.getResponseCode();
  if (responseCode == HttpURLConnection.HTTP_OK) {
      BufferedReader in = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
      StringBuffer response = new StringBuffer();
      while ((readLine = in.readLine()) != null) {
          response.append(readLine);
      }
      in.close();
      System.out.println(response.toString());
  } else {
      throw new Exception("Error in API Call");
  }
} catch (Exception ex) {
  ex.printStackTrace();
}

SDK METHOD

// remember to install the library: https://search.maven.org/artifact/com.scraperapi/sdk/1.0
ScraperApiClient client = new ScraperApiClient("APIKEY");
  client.get("http://httpbin.org/ip")
  .autoparse(true)
  .result();

Last updated