Complete examples for using Thordata's proxy network across multiple languages.
Copy-paste ready examples showing how to use Thordata's proxy network (Residential, Mobile, Datacenter, ISP) from multiple programming languages.
| Language | Examples | Description |
|---|---|---|
| Python | 7 examples | Using official SDK with ProxyConfig, async, error handling |
| Node.js | 3 examples | Using axios with proxy configuration |
| Go | 2 examples | Using net/http with proxy |
| curl | 3 examples | Quick command-line testing |
Thordata supports two authentication modes:
Credentials are embedded in the proxy URL:
http://td-customer-{USERNAME}-country-{COUNTRY}:{PASSWORD}@{HOST}:{PORT}
Example:
curl -x "http://td-customer-myuser-country-us:mypassword@pr.thordata.net:9999" "https://httpbin.org/ip"Add your server's IP to the Dashboard whitelist, then use proxy without credentials:
curl -x "http://pr.thordata.net:9999" "https://httpbin.org/ip"| Product | Port | Use Case |
|---|---|---|
| Residential | 9999 | General scraping, geo-targeting |
| Mobile | 5555 | Mobile-specific content |
| Datacenter | 7777 | High-speed, cost-effective |
| ISP (Static) | 6666 | Long-term sessions |
git clone https://github.com/Thordata/thordata-proxy-examples.git
cd thordata-proxy-examplescp .env.example .env
# Edit .env with your credentials from Thordata DashboardChoose your language:
# Python
cd examples/python
pip install -r requirements.txt
python 01_simple_ip_check.py
# Node.js
cd examples/nodejs
npm install
node 01_simple_ip_check.js
# Go
cd examples/go
go run simple_ip_check.go
# curl
cd examples/curl
export THORDATA_USERNAME=your_username
export THORDATA_PASSWORD=your_password
bash 01_basic_proxy.sh| File | Description |
|---|---|
01_simple_ip_check.py |
Basic IP verification through proxy |
02_geo_targeting.py |
Request from specific country/state/city |
03_sticky_session.py |
Maintain same IP across requests |
04_concurrent_requests.py |
High-concurrency async requests |
05_different_products.py |
Residential vs Mobile vs Datacenter |
06_ip_whitelist_mode.py |
Using IP whitelist authentication |
07_error_handling.py |
Proper error handling patterns |
| File | Description |
|---|---|
01_simple_ip_check.js |
Basic proxy request with axios |
02_geo_targeting.js |
Geo-targeted requests |
03_concurrent_requests.js |
Parallel requests with Promise.all |
| File | Description |
|---|---|
simple_ip_check.go |
Basic proxy request |
geo_targeting.go |
Geo-targeted requests |
| File | Description |
|---|---|
01_basic_proxy.sh |
Simple proxy test |
02_geo_targeting.sh |
Country/city targeting |
03_sticky_session.sh |
Session persistence |
Embed targeting in the username:
td-customer-{USERNAME}[-continent-{CODE}][-country-{CODE}][-state-{NAME}][-city-{NAME}][-asn-{CODE}]
Examples:
# United States
td-customer-myuser-country-us
# California, USA
td-customer-myuser-country-us-state-california
# Los Angeles, California, USA
td-customer-myuser-country-us-state-california-city-los_angeles
# Specific ISP (ASN)
td-customer-myuser-country-us-asn-AS7922Keep the same IP for multiple requests:
td-customer-{USERNAME}-sessid-{SESSION_ID}-sesstime-{MINUTES}
Example:
# Same IP for 10 minutes
td-customer-myuser-country-us-sessid-abc123-sesstime-10- Don't commit credentials - Keep
.envin.gitignore - Respect rate limits - Check your plan's concurrency limits
- Use appropriate product - Residential for sensitive sites, Datacenter for speed
- Handle errors - Implement retry logic for transient failures
- Thordata Python SDK - Full-featured Python client
- Thordata Cookbook - AI/LLM integration examples
- Documentation - Complete API reference
MIT License - see LICENSE for details.