Smartproxy>FAQ>General>Using domain:port format in cURL

Using domain:port format in cURL

cURL is a command line tool that lets you transfer data from or to servers with URL syntax commands. You can get cURL example in the dashboard. To find out how, check here.


cURL examples in domain:port format

For a rotating session, random location.

The gate.smartproxy.com:7000 will rotate your IP to an IP address from a random location with every new request.

cURL (with user:pass authorization) will look like:

curl -U user:pass -x gate.smartproxy.com:7000 http://ip.smartproxy.com/json

cURL (with whitelist authorization) will look like:

curl -x gate.smartproxy.io:7000 http://ip.smartproxy.com/json

For a rotating session, specific location.

As in the example below, you can use a single city/country specific proxy address (endpoint) to get a random proxy in that city/country with every query. For example, use us.smartproxy.com:10000 for IP addresses in the US.

cURL (with user:pass authorization) will look like:

curl -U user:pass -x us.smartproxy.com:10000 http://ip.smartproxy.com/json

cURL (with whitelist authorization) will look like:

curl -x us.smartproxy.io:10000 http://ip.smartproxy.com/json

For a sticky session, random location.

Your new IP address will not change with each new request but will stay the same for a longer period (RESI up to 24hrs, DC 30min). When you need to establish sticky sessions with IP addresses from random locations, use a single backconnect entry node with the sticky session parameter.

cURL (with user:pass authorization) will look like:

curl -U user:pass -x gate.smartproxy.com:10000 http://ip.smartproxy.com/json
curl -U user:pass -x gate.smartproxy.com:10001 http://ip.smartproxy.com/json
curl -U user:pass -x gate.smartproxy.com:10002 http://ip.smartproxy.com/json
...
curl -U user:pass -x gate.smartproxy.com:49999 http://ip.smartproxy.com/json

cURL (with whitelist authorization) will look like:

curl -x gate.smartproxy.io:48509 http://ip.smartproxy.com/json
...

For a sticky session, specific location.

You need to choose sticky ports to keep an IP address from a specific location for longer period. The most popular countries have up to 10,000 ports for sticky IPs. For example, it.smartproxy.com: 25762 will give the same Italian IP address for up to 10 minutes. Please note that this endpoint (it.smartproxy.com) has 10,000 sticky ports, from 20001 to 29999. If needed you can download them all by clicking ‘Download this list’.

cURL (with user:pass authorization) will look like:

curl -U user:pass -x it.smartproxy.com:20001 http://ip.smartproxy.com/json
curl -U user:pass -x it.smartproxy.com:20001 http://ip.smartproxy.com/json
curl -U user:pass -x it.smartproxy.com:20002 http://ip.smartproxy.com/json
...
curl -U user:pass -x it.smartproxy.com:29999 http://ip.smartproxy.com/json

cURL (with whitelist authorization) will look like:

curl -x it.smartproxy.io:21639 http://ip.smartproxy.com/json
...

If you need any help, reach out to us via LiveChat.

© 2018-2024 smartproxy.com, All Rights Reserved