WebScrapingAPI Docs
HomeLoginRegister
  • Introduction
    • Registration
    • Pricing
    • Free APIs
    • API Errors
    • Custom Response Headers
  • Browser API
    • Getting Started
      • Access the API
      • Authentication
      • API Parameters
    • Basic API Requests
      • GET Request
      • POST, PUT & PATCH Requests
      • Proxy Mode
    • Advanced API Features
      • Awaiting
      • Geolocation
      • Sessions
      • Forcing Timeouts
      • Custom Headers
      • Custom Cookies
      • Device Type
      • Viewport Sizing
      • Screenshot
      • Screenshot Options
      • Extraction Rules
      • JavaScript Instructions
      • Full JSON Response
      • JSON DOM Response
      • Block Resources
      • Captcha Solving
  • WebScrapingAPI
    • Getting Started
      • Access the API
      • API Parameters
    • Basic API Requests
      • GET Request
      • POST, PUT & PATCH Requests
    • Advanced API Features
      • Geolocation
      • Extraction Rules
      • Full JSON Response
      • JSON DOM Response
      • Rendering JavaScript
  • WebStealthProxy
    • Getting Started
      • Access the Proxy
      • Usage and Statistics
    • Basic Proxy Requests
    • Advanced Proxy Requests
      • Sessions
      • Geolocation
      • Custom Headers
      • Custom Cookies
      • Screenshots
  • Google Search API
    • Getting Started
      • Access the API
      • API Parameters
    • Google Search Engines
      • Google Search API
      • Google Maps API
      • Google Maps Reviews API
      • Google Reverse Image API
      • Google Trends API
        • Geo Parameter Options List
        • Google Trends Categories List
  • WB CUSTOM SEARCH API
    • Getting Started
      • Access the API
      • API Parameters
    • WB Custom Search Engines
      • Wayfair Product API
      • Best Buy Product API
      • Nordstrom Product API
  • Amazon Search API
    • Getting Started
      • API Parameters
      • Access the API
      • Supported Domains
    • Amazon Search Types
      • Amazon Search
      • Amazon Seller
        • Amazon Seller Products
        • Amazon Seller Profile
        • Amazon Seller Feedback
      • Amazon Product
      • Amazon Category
      • Amazon Bestsellers
      • Amazon New Releases
      • Amazon Deals
  • Bing Search API
    • Getting Started
      • Access the API
      • API Parameters
    • Basic API Requests
Powered by GitBook
On this page
  1. WebStealthProxy
  2. Advanced Proxy Requests

Screenshots

Looking for images rather than HTML code? Use the X-WSA-Render custom header.

PreviousCustom CookiesNextGetting Started

Last updated 10 months ago

By setting the X-WSA-Render: screenshot the result will return a JSON object containing the base64 encrypted image.

Web Stealth Proxy Screenshot Examples

curl -k -x "http://stealthproxy.webscrapingapi.com:80" -U "<YOUR-PROXY-USERNAME>:<YOUR-PROXY-PASSWORD>" -X GET "https://httpbin.org/get" --header "X-WSA-Render: screenshot"
const axios = require('axios');
const https = require('https');

const instance = axios.create({
  httpsAgent: new https.Agent({  
    rejectUnauthorized: false
  })
});

instance.get('https://httpbin.org/get', {
      proxy: {
          host: 'stealthproxy.webscrapingapi.com',
          port: 8000,
          auth: {
            username: '<YOUR-PROXY-USERNAME>',
            password: '<YOUR-PROXY-PASSWORD>'
          },
          headers: {
            "X-WSA-Render": "screenshot"
          }    
      }
    }).then(function (response) {
        console.log(response.data);
    }, (err) => {
      console.log(err)
})
import requests

USERNAME = '<YOUR-PROXY-USERNAME>'
PASSWORD = '<YOUR-PROXY-PASSWORD>'

TARGET_URL = 'https://httpbin.org/get'

PROXY = {
   "http": f"https://{ USERNAME }:{ PASSWORD }@stealthproxy.webscrapingapi.com:80"
}
headers = {'X-WSA-Render': "screenshot"}

response = requests.get(
   url=TARGET_URL,
   proxies=PROXY,
   headers=headers,
   verify=False
)

print(response.text)
<?php
$ch = curl_init();

$headers = [
    'X-WSA-Render: screenshot',
];

curl_setopt($ch, CURLOPT_URL, 'https://httpbin.org/get');

curl_setopt($ch, CURLOPT_PROXY, 'http://<YOUR-PROXY-USERNAME>:<YOUR-PROXY-PASSWORD>@stealthproxy.webscrapingapi.com:80');

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$response = curl_exec($ch);

if (!$response) {
  die('Error: "'.curl_error($ch).'" - Code: '.curl_errno($ch));
}

echo 'HTTP Status Code: '.curl_getinfo($ch, CURLINFO_HTTP_CODE) . PHP_EOL;
echo 'Response Body: '.$response . PHP_EOL;

curl_close($ch);
?>
package main

import (
    "crypto/tls"
    "fmt"
    "io/ioutil"
    "net/http"
    "net/url"
)

func send_proxy() {
    proxyStr := "https://<YOUR-PROXY-USERNAME>:<YOUR-PROXY-PASSWORD>@stealthproxy.webscrapingapi.com:8000"
    proxyURL, err := url.Parse(proxyStr)

    if err != nil {
        fmt.Println(err)
    }

    transport := &http.Transport{
        Proxy:           http.ProxyURL(proxyURL),
        TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
    }

    client := &http.Client{
        Transport: transport,
    }

    req, err := http.NewRequest("GET", "https://httpbin.org/get", nil)
    req.Header.Add("X-WSA-Render", "screenshot")

    parseFormErr := req.ParseForm()
    if parseFormErr != nil {
        fmt.Println(parseFormErr)
    }

    res, err := client.Do(req)

    if err != nil {
        fmt.Println("Failure : ", err)
    }

    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))
}

func main() {
    send_proxy()
}
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main() {

        var proxy = new WebProxy("http://stealthproxy.webscrapingapi.com:80")
        {
            Credentials = new NetworkCredential("<YOUR-PROXY-USERNAME>", "<YOUR-PROXY-PASSWORD>"),
        };

        var clientHandler = new HttpClientHandler
        {
            Proxy = proxy,
        };

        var client = new HttpClient(clientHandler);
    
        client.DefaultRequestHeaders.Add("X-WSA-Render", "screenshot");

        var response = await client.GetAsync("http://httpbin.org/get");
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}
require 'uri'
require 'net/http'
require 'openssl'

proxy_host = "stealthproxy.webscrapingapi.com"
proxy_port = 80
proxy_user = "<YOUR-PROXY-USERNAME>"
proxy_pass = "<YOUR-PROXY-PASSWORD>"

url = URI("http://httpbin.org/get")

proxy = Net::HTTP::Proxy(proxy_host,
                         proxy_port,
                         proxy_user,
                         proxy_pass)

req = Net::HTTP::Get.new(url.path)

req.add_field("X-WSA-Render", "screenshot")

response = proxy.start(url.host,url.port) do |http|
  http.request(req)
end
    
puts response.body
custom header