Proxy exits in 64 countries and 172 cities, sold per GB, IP, day or request.

Code and command line

cURL proxy setup

Before a proxy goes into a scraper, a cron job or a browser profile, it is worth one command in a terminal. cURL is already installed on macOS, most Linux distributions and current Windows releases, and a single call tells you three things at once: the login is accepted, the exit country is right, and the gateway answers quickly from where you are.

This page starts with that first call, then moves on to SOCKS5, keeping the login out of your shell history with a config file, and reading the verbose output when something refuses to connect.

What do you need before adding a proxy in cURL?

Tick these off before the first step. Your login and password appear in your account once the first top-up of $40 or more has been credited.

Requirements for cURL
RequirementDetail
cURL 7.68 or newerCheck with curl -V. Older builds work for HTTP but lack some SOCKS options.
A TopProxy loginShown in your account after the first top-up, in the form tp7k2m9_country-us.
Your proxy passwordPaste it where the examples show YOUR_PASSWORD.
Outbound ports 8080 and 1080Some office networks block them. A phone hotspot is a quick way to rule that out.

Where do the proxy host, port and login go in cURL?

Work through the steps in order. Swap YOUR_PASSWORD for your proxy password and tp7k2m9 for your account name.

  1. Find out which cURL you are running

    Print the version and the list of supported protocols. On Windows PowerShell 5.1 the word curl points to a built-in cmdlet with different options, so call the real binary as curl.exe there. PowerShell 7 and the Command Prompt do not have this problem.

    curl -V
  2. Make one request through port 8080

    Give the gateway to --proxy and the login pair to --proxy-user. Keeping the password in its own option means you never have to URL-encode it, even if it contains symbols. HTTPS pages travel inside a CONNECT tunnel, so the proxy sees the hostname but not the page.

    curl --proxy http://proxy.topproxy.shop:8080 \
      --proxy-user 'tp7k2m9_country-us:YOUR_PASSWORD' \
      https://ipinfo.io/json
  3. Move to SOCKS5 and resolve names at the exit

    Write the proxy with the socks5h:// scheme and point it at port 1080. The trailing h tells cURL to hand the hostname to the proxy, so the lookup happens in the exit country instead of on your own resolver. With plain socks5:// your machine resolves the name first, which can return a server close to you rather than close to the exit.

    curl --proxy socks5h://proxy.topproxy.shop:1080 \
      --proxy-user 'tp7k2m9_country-gb:YOUR_PASSWORD' \
      https://ipinfo.io/json
  4. Keep the login in a config file

    Typing the password on the command line leaves it in your shell history. cURL reads options from a file passed with -K, one option per line, so you can keep the gateway and login in a file that only your user can read and call it from any script.

    proxy = "http://proxy.topproxy.shop:8080"
    proxy-user = "tp7k2m9_country-us:YOUR_PASSWORD"
    max-time = 30
  5. Read the handshake when a call fails

    Add -v and look at the lines that start with < right after the CONNECT request. A reply of 200 Connection established means the gateway let you in and any later problem is between the exit and the website. A 407 at that point means the login or password was refused.

    curl -v --proxy http://proxy.topproxy.shop:8080 \
      --proxy-user 'tp7k2m9_country-us:YOUR_PASSWORD' \
      https://ipinfo.io/ip 2>&1 | grep -E '^(<|\*) '

How can you confirm the proxy is active in cURL?

Call ipinfo.io once without the proxy and once with it. The first result is your own connection, the second should show a different address in the country you asked for. If both lines match, cURL is not using the proxy at all.

curl -s https://ipinfo.io/ip; echo
curl -s -x proxy.topproxy.shop:8080 -U 'tp7k2m9_country-us:YOUR_PASSWORD' https://ipinfo.io/json

The response shown here is shortened to the fields that matter. The region and time zone follow the exit, in this case United States.

GET https://ipinfo.io/json
{
  "ip": "198.51.100.47",
  "city": "New York City",
  "region": "New York",
  "country": "US",
  "timezone": "America/New_York"
}

198.51.100.47 is an address reserved for documentation. A live check prints a real exit.

How do you switch between rotating and held IPs in cURL?

With only a country in the login, each new connection leaves from a different address. Add a session name and a life in minutes to hold one address: every call that uses the same session name gets the same exit until the life runs out. Pick a new name whenever you want a new address.

for n in 1 2 3; do
  curl -s -x proxy.topproxy.shop:8080 -U 'tp7k2m9_country-us:YOUR_PASSWORD' https://ipinfo.io/ip; echo
done

How the login is put together

Every setting lives in the login, joined with underscores. Nothing else in cURL changes when you switch location or session.

Parts of a TopProxy login
PartMeaningRule
tp7k2m9Your account nameAlways first. Yours is shown in your account and replaces tp7k2m9 in every example here.
_country-usExit countryTwo-letter code in lowercase. 64 countries to choose from.
_city-new-yorkExit city, optionalLowercase, spaces become hyphens. 172 cities in total.
_session-a1b2c3Session name, optionalLetters and digits you pick. Same name, same exit. New name, new exit.
_life-30Session life in minutesOnly with a session. Residential 1 to 120 minutes, mobile 1 to 60 minutes, long session ISP up to 12 hours (life 720).

All parts togethertp7k2m9_country-us_city-new-york_session-a1b2c3_life-30

How do you choose an exit country or city in cURL?

Country and city are parts of the login, so changing location never needs a different command. Use the two-letter country code and the city written in lowercase with hyphens in place of spaces.

curl -x proxy.topproxy.shop:8080 -U 'tp7k2m9_country-jp:YOUR_PASSWORD' https://ipinfo.io/json

Codes and city values for all 64 countries are listed on the proxy locations pages.

How do you fix a 407 or connection error in cURL?

Find the line that matches what you see. Most problems come down to the login, the port or the network you are on.

cURL symptoms, causes and fixes
SymptomLikely causeFix
407 Proxy Authentication RequiredA typo in the login or password, or the shell changed a character such as ! or $.Wrap the pair in single quotes (double quotes in PowerShell) and copy it again from your account.
curl: (5) Could not resolve proxyThe gateway name is misspelled or your DNS resolver cannot reach it.Check the spelling of proxy.topproxy.shop and run nslookup proxy.topproxy.shop.
Hangs, then Connection timed outThe network you are on blocks port 8080 or 1080.Try the other port, or run the same command from another network to confirm.
Proxy CONNECT aborted on port 1080An http:// proxy URL was pointed at the SOCKS5 port.Use socks5h:// with port 1080, or http:// with port 8080.
PowerShell says a parameter cannot be foundcurl is an alias for Invoke-WebRequest in Windows PowerShell 5.1.Type curl.exe instead of curl.

Still stuck? Run the same login through the cURL check. If cURL connects, the issue is in the cURL settings. If it does not, write to support with the error text.

What kind of proxy pairs well with cURL?

All products sit behind the same gateway and share one prepaid balance, so moving from one to another means buying the other product and changing the login, nothing more.

Calling pages from code at scale? The TopProxy API docs cover the Scraping API, which renders pages and retries on its own.

What else do cURL users ask about proxies?

Should I write socks5 or socks5h in cURL?

Use socks5h. It passes the hostname to the proxy so the name is resolved in the exit country. Plain socks5 resolves the name on your own machine first, which can give you a server near you and leaks the lookup to your local resolver.

Can I set the proxy once with an environment variable?

Yes. Export https_proxy and http_proxy with the full URL, for example http://login:password@proxy.topproxy.shop:8080. cURL picks them up automatically. Note that cURL reads http_proxy only in lowercase, while https_proxy works in either case. Any symbol in the password must be percent-encoded in this form.

How do I skip the proxy for internal hosts?

Pass --noproxy with a comma separated list, for example --noproxy localhost,127.0.0.1,.internal.example. The same list can go into the no_proxy environment variable.

Why do two URLs in one command show the same IP?

When you give cURL several URLs in one run it reuses the open connection, and a rotating login changes the exit per new connection. Run separate commands, or pass --no-keepalive, when you want each request to leave from a fresh address.

Is the password sent in clear text?

On the HTTP port the login travels in a Proxy-Authorization header, which is encoded but not encrypted, on the hop between you and the gateway. The page you load over HTTPS stays encrypted end to end inside the tunnel. Keep the password private and change it in your account if it was shared.

Ready to connect cURL?

Open an account, add $40 or more in crypto, and your login and password are waiting in the account area.