Code examples

On this page you will find examples of how to use the Proxy Port source of proxy.

Some examples contain the $APIKEY placeholder. You need to replace it with your API key before running the code.

We assume that you have already received your API key, if not, visit the How to Start Guide.

Please see our SDK.

In the first approach, we will try to get a list of proxies from the API.
Get list of proxies
Shell
Python
Node.js
$ curl 'https://api.proxy-port.com/scraping-proxy' \
    -H 'X-API-KEY: $APIKEY'
                
            
from urllib.request import urlopen, Request
import json

url = 'https://api.proxy-port.com/scraping-proxy'
headers = {
    'X-API-KEY': '$APIKEY'
}

response = urlopen(Request(url, headers=headers))
data = json.load(response)

print(data)

                
            
var options = {
    host: 'api.proxy-port.com',
    path: '/scraping-proxy',
    headers: {
        'X-API-KEY': '$APIKEY'
    },
};

var req = https.request(options, function(res) {
    res.on('data', function(d) {
        console.log(JSON.parse(d.toString()));
    });
});

req.end();