cURL is the most widely used command-line tool for HTTP requests. It's perfect for testing proxy configurations, quick data retrieval, and shell scripting. DataSea proxies work seamlessly with cURL's built-in proxy support.
Sign in to your DataSea dashboard and copy your proxy credentials.
# DataSea Proxy Configuration
Proxy Host: pr.datasea.io
HTTP Port: 7011 (for http:// and https:// websites)
HTTPS-to-proxy Port: 7010 (TLS between your client and the proxy)
# Your credentials
Username: your_proxy_username
Password: your_16_char_password
# Proxy URL format
http://username:password@pr.datasea.io:7011Make your first request through DataSea proxy.
# Basic proxy request
curl -x "http://username:password@pr.datasea.io:7011" \
https://api.ipify.org?format=json
# Output: {"ip":"xxx.xxx.xxx.xxx"}Check that your requests are going through the proxy.
# Check your proxy IP
curl -x "http://username:password@pr.datasea.io:7011" \
https://httpbin.org/ip
# Verbose output to debug connection
curl -v -x "http://username:password@pr.datasea.io:7011" \
https://httpbin.org/ipTarget specific countries by adding parameters to your username.
# Target US proxies
curl -x "http://username_country-UnitedStates:password@pr.datasea.io:7011" \
https://httpbin.org/ip
# Target UK proxies
curl -x "http://username_country-GB:password@pr.datasea.io:7011" \
https://httpbin.org/ip
# Target Germany
curl -x "http://username_country-DE:password@pr.datasea.io:7011" \
https://httpbin.org/ipAccess 195+ countries with residential, datacenter, ISP, and mobile proxies.
Each request gets a new IP, or use sessions for consistent IPs.
Works immediately with cURL's built-in proxy support.
Username:password format works out of the box.
Easy to integrate into bash scripts and automation.
Perfect for testing and debugging proxy configurations.
Make a simple GET request through the proxy.
# Simple GET request
curl -x "http://username:password@pr.datasea.io:7011" \
https://example.com
# With custom headers
curl -x "http://username:password@pr.datasea.io:7011" \
-H "User-Agent: Mozilla/5.0" \
-H "Accept: application/json" \
https://api.example.com/data
# Follow redirects
curl -L -x "http://username:password@pr.datasea.io:7011" \
https://example.com/redirectSend POST requests through the proxy.
# POST with form data
curl -x "http://username:password@pr.datasea.io:7011" \
-X POST \
-d "name=John&email=john@example.com" \
https://httpbin.org/post
# POST with JSON
curl -x "http://username:password@pr.datasea.io:7011" \
-X POST \
-H "Content-Type: application/json" \
-d '{"name":"John","email":"john@example.com"}' \
https://httpbin.org/postAccess content from different countries.
# Create a function for geo-targeted requests
geo_curl() {
local country=$1
local url=$2
curl -s -x "http://username_country-${country}:password@pr.datasea.io:7011" "$url"
}
# Test from different countries
geo_curl US "https://httpbin.org/ip"
geo_curl GB "https://httpbin.org/ip"
geo_curl DE "https://httpbin.org/ip"
geo_curl JP "https://httpbin.org/ip"
# Loop through countries
for country in US GB DE FR JP AU; do
echo "=== $country ==="
curl -s -x "http://username_country-${country}:password@pr.datasea.io:7011" \
https://httpbin.org/ip
doneMaintain the same IP across multiple requests.
# Create a session ID (1-32 letters or digits)
SESSION_ID="s$(date +%s)"
# All requests with this session use the same IP
curl -x "http://username_session-${SESSION_ID}:password@pr.datasea.io:7011" \
https://httpbin.org/ip
curl -x "http://username_session-${SESSION_ID}:password@pr.datasea.io:7011" \
https://httpbin.org/ip
# Combine country + session
curl -x "http://username_country-UnitedStates_session-${SESSION_ID}:password@pr.datasea.io:7011" \
https://httpbin.org/ipAutomate multiple requests with a shell script.
#!/bin/bash
# proxy_scrape.sh - Bulk scraping with DataSea proxies
PROXY_USER="username"
PROXY_PASS="password"
# URLs to scrape (one per line in a file)
cat > urls.txt << EOF
https://example.com/page1
https://example.com/page2
https://example.com/page3
EOF
# Output directory
mkdir -p output
# Loop through URLs
count=0
while read -r url; do
output_file="output/page_${count}.html"
echo "Fetching: $url"
curl -s -x "http://${PROXY_USER}:${PROXY_PASS}@pr.datasea.io:7011" \
-o "$output_file" \
"$url"
echo "Saved to: $output_file"
count=$((count + 1))
# Add delay between requests
sleep 1
done < urls.txt
echo "Done! Scraped $count pages"Store credentials securely in environment variables.
# Set environment variables (add to ~/.bashrc or ~/.zshrc)
export DATASEA_USER="your_username"
export DATASEA_PASS="your_password"
# Use in curl commands
curl -x "http://${DATASEA_USER}:${DATASEA_PASS}@pr.datasea.io:7011" \
https://httpbin.org/ip
# Or create an alias
alias pcurl='curl -x "http://${DATASEA_USER}:${DATASEA_PASS}@pr.datasea.io:7011"'
# Then simply use:
pcurl https://httpbin.org/ip
# With country targeting
alias pcurl_us='curl -x "http://${DATASEA_USER}_country-UnitedStates:${DATASEA_PASS}@pr.datasea.io:7011"'
pcurl_us https://httpbin.org/ipSolution: Verify you're using the correct port (7011) and proxy hostname.
# Correct format
curl -x "http://username:password@pr.datasea.io:7011" https://example.com
# Common mistakes:
# WRONG: pr.datasea.io:80
# WRONG: pr.datasea.io:443
# WRONG: proxy.datasea.io:7011
# CORRECT: pr.datasea.io:7011Solution: Check your username and password are correct.
# Verify credentials format
# Username: your_username (from dashboard)
# Password: 16-character alphanumeric (from dashboard)
# Test with verbose output
curl -v -x "http://username:password@pr.datasea.io:7011" \
https://httpbin.org/ip
# URL-encode special characters in password if needed
# @ becomes %40
# : becomes %3ASolution: The proxy handles SSL. If issues persist, try the -k flag for testing.
# Skip SSL verification (for testing only)
curl -k -x "http://username:password@pr.datasea.io:7011" \
https://example.com
# Better: Update CA certificates
# On Ubuntu/Debian:
sudo apt-get update && sudo apt-get install ca-certificates
# On macOS:
brew install ca-certificatesSolution: Increase timeout values for slow responses.
# Set connection timeout (seconds)
curl --connect-timeout 30 \
-x "http://username:password@pr.datasea.io:7011" \
https://example.com
# Set maximum time for entire operation
curl --max-time 60 \
-x "http://username:password@pr.datasea.io:7011" \
https://example.com
# Both timeouts
curl --connect-timeout 30 --max-time 120 \
-x "http://username:password@pr.datasea.io:7011" \
https://slow-website.comConnect to 150M+ real IPs in seconds. Built for scale, privacy, and performance. Free trial available.