Thordata Docs
English
English
  • Overview
  • PROXIES
    • Integration Tutorial
      • Residential Proxies Integration
        • AdsPower
        • BitBrowser
        • ClonBrowser
        • Playwright
        • Puppeteer
        • Selenium
        • Ghost Browser
        • SwitchyOmega
        • FoxyProxy
        • Chrome
        • Edge
        • MuLogin
      • ISP Proxies Integration
        • AdsPower
        • BitBrowser
        • ClonBrowser
        • Ghost Browser
        • SwitchyOmega
        • FoxyProxy
        • Chrome
        • Edge
      • Datacenter Proxies Integration
        • AdsPower
        • BitBrowser
        • ClonBrowser
        • Ghost Browser
        • SwitchyOmega
        • FoxyProxy
        • Chrome
        • Edge
      • Unlimited Proxies Integration
        • AdsPower
        • BitBrowser
        • ClonBrowser
        • Ghost Browser
        • SwitchyOmega
        • FoxyProxy
        • Chrome
        • Edge
    • Residential Proxies
      • Getting Started Guide
      • Endpoint Generator
        • User & Pass auth
        • Whitelisted IPs
          • Country Entry
            • Country/Region Entry Node
          • API Link
      • Users
      • Basic Query
      • location Settings
        • Country / Region
        • City
        • State
      • Session Control
      • Protocols
      • Country/Region list
      • CDKEY Generation and Redemption
    • ISP Proxies
      • Getting Started Guide
    • Datacenter Proxies
      • Getting Started Guide
    • Unlimited Proxy Servers
      • Endpoint Generator
        • User & Pass auth
        • Whitelisted IPs
          • Country Entry
          • API Link
      • Users
      • Country/Region list
  • Scraping
    • SERP API
      • Quick Start Guide
      • Configuration
      • API Playground
      • SSL Certificate
      • Send Your First Request
      • Parsed JSON Result
      • SERP API Google Query Parameters
      • SERP API Bing Query Parameters
    • WEB Scraper API
      • Getting Started Guide
      • API request builder
  • FREE TOOLS
    • Chrome Extension
      • Tutorial
  • USEFUL LINKS
    • Dashboard Center
  • FAQ
    • Product Problem
      • How do I choose the right proxy package?
      • How to target specific countries/regions?
      • How to target a specific city?
      • What is Unlimited Proxies?
      • The IP test result does not match the region where the extraction was purchased?
    • Payment Problem
      • What payment methods are supported?
      • What should I do if I buy the wrong package?
      • Do you provide refunds for paid services?
      • After payment, how long does it take to receive my agency balance or activate my account?
  • SUPPORT
    • Contact Us
Powered by GitBook
On this page

Was this helpful?

  1. PROXIES
  2. Residential Proxies
  3. location Settings

Country / Region

Previouslocation SettingsNextCity

Last updated 3 months ago

Was this helpful?

By adding the country flag, you can specify that a certain country's IP be used to handle requests. The value of this parameter is a case-insensitive country code in two-letter format. For example: US American proxy, GB British proxy, VN Vietnam proxy. See the example below for more information.

for a list of supported countries/regions

Here are a few examples of country parameters:

Country / Region
Country / Region Parameter

Germany

country-DE

India

country-IN

Thailand

country-TH

Korea

country-KR

Japan

country-JP

Code example:

Execute a query to ipinfo.thordata.com using a random IP address from the United States.

curl -x t.pr.thordata.net:9999 -U "td-customer-USERNAME-country-US:PASSWORD" ipinfo.thordata.com
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class csharp_http_region
{
    static void Main(string[] args)
    {
        Task t = new Task(DownloadPageAsync);
        t.Start();
        Console.ReadLine();
    }

    static async void DownloadPageAsync()
    {
        string page = "https://ipinfo.thordata.com";

        String username = "username";
        String password = "password";
        String country = "us";
        String proxyUserName = $"td-customer-{username}-country-{country}";


        var proxy = new WebProxy("http://t.pr.thordata.net:9999")
        {
            UseDefaultCredentials = false,

            Credentials = new NetworkCredential(
                userName: proxyUserName,
                password: password)
        };

        var httpClientHandler = new HttpClientHandler()
        {
            Proxy = proxy,
        };

        var client = new HttpClient(handler: httpClientHandler, disposeHandler: true);
        var response = await client.GetAsync(page);
        using (HttpContent content = response.Content)
        {
            string result = await content.ReadAsStringAsync();
            Console.WriteLine(result);
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();

        }
    }
}
package main

import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
)

const (
	resourceUrl = "https://ipinfo.thordata.com"
	proxyHost   = "t.pr.thordata.net:9999"
	username    = "username"
	password    = "password"
	country     = "us"
)

func main() {
	proxyUserName := fmt.Sprintf("td-customer-%s-country-%s", username, country)
	proxyUrl := &url.URL{
		Scheme: "http",
		User:   url.UserPassword(proxyUserName, password),
		Host:   proxyHost,
	}

	client := http.Client{
		Transport: &http.Transport{
			Proxy: http.ProxyURL(proxyUrl),
		},
	}

	resp, err := client.Get(resourceUrl)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}

	bodyString := string(body)
	fmt.Println(bodyString)
}
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
import org.apache.http.util.EntityUtils;

import java.io.IOException;

public class JavaHttpRegion {
    public static final String username = "username";
    public static final String password = "password";
    public static final int port = 9999;

    public static final String region = "us";
    public static final String proxyHost = "t.pr.thordata.net";

    public static final String proxyname = String.format("td-customer-%s-country-%s", username, region);
    public CloseableHttpClient client;


    public JavaHttpRegion() {
        HttpHost proxy = new HttpHost(proxyHost, port);
        CredentialsProvider cred_provider = new BasicCredentialsProvider();
        cred_provider.setCredentials(new AuthScope(proxy),
                new UsernamePasswordCredentials(proxyname, password));
        client = HttpClients.custom()
                .setConnectionManager(new BasicHttpClientConnectionManager())
                .setProxy(proxy)
                .setDefaultCredentialsProvider(cred_provider)
                .build();
    }

    public String request(String url) throws IOException {
        HttpGet request = new HttpGet(url);
        CloseableHttpResponse response = client.execute(request);
        try {
            return EntityUtils.toString(response.getEntity());
        } finally { response.close(); }
    }

    public void close() throws IOException { client.close(); }

    public static void main(String[] args) throws IOException {
        JavaHttpRegion client = new JavaHttpRegion();
        try {
            System.out.println(client.request("https://ipinfo.thordata.com"));
        } finally { client.close(); }
    }
}
<?php
  $url = 'ipinfo.thordata.com';
  $proxy = 't.pr.thordata.net';
  $port = 9999;
  $user = 'username';
  $psw = 'password';
  $country = 'us';
  $proxyuser = sprintf("td-customer-%s-country-%s", $user, $country);


  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  
  curl_setopt($ch, CURLOPT_PROXY, "$proxy:$port");
  curl_setopt($ch, CURLOPT_PROXYUSERPWD, "$proxyuser:$psw");
  $result = curl_exec($ch);
  curl_close($ch);
  
  if ($result)
  {
      echo $result . PHP_EOL;
  }
?>
import requests

username = "username"
password = "password"
proxy_server = "t.pr.thordata.net:9999"
country = "us"

proxies = {"http": f"http://td-customer-{username}-country-{country}:{password}@{proxy_server}"}
response = requests.get("http://ipinfo.thordata.com", proxies=proxies)
print(response.text)
const rp = require('request-promise');

const username = "username";
const password = "password";
const proxyServer = "t.pr.thordata.net:9999";
const country = "us";

rp({
    url: 'http://ipinfo.thordata.com',  
    proxy: `http://td-customer-${username}-country-${country}:${password}@${proxyServer}`,  
})
.then(function(data) {
    console.log(data);  
})
.catch(function(err) {
    console.error(err); 
});
require "uri" 
require 'net/http' 

proxy_host = 't.pr.thordata.net' 
proxy_port = 9999 
proxy_username = 'username'
proxy_pass = 'password'
proxy_country = 'us'
proxy_user = "td-customer-#{proxy_username}-country-#{proxy_country}"

uri = URI.parse('https://ipinfo.thordata.com') 
proxy = Net::HTTP::Proxy(proxy_host, proxy_port, proxy_user, proxy_pass) 

req = Net::HTTP::Get.new(uri)

result = proxy.start(uri.host, uri.port, use_ssl: true) do |http| 
  http.request(req) 
end 

puts result.body
3166-1 alpha-2
Click here