# Proxy Types

Source: https://docs.evomi.com/scraping-products-instructions/scraper-api/proxy-types/

The Scraper API integrates seamlessly with Evomi's global proxy network, giving you access to residential and datacenter proxies across 150+ countries. Choose the right proxy type for your use case to optimize success rates and costs.

## Proxy Types

### Premium/Residential Proxies (Default)

Residential IP addresses from ISPs worldwide, selected for broad site compatibility and high request success rates.

**Cost:**
- Request mode: 2 credits
- Browser mode: 5 credits (flat rate)
- Auto mode: 2-6 credits

| Feature | Description |
|---------|-------------|
| **IP Type** | Real residential IPs from ISPs |
| **Success Rate** | Highest across complex and region-sensitive sites |
| **Speed** | Fast |
| **Rotating** | Yes (session support available) |
| **Countries** | 150+ countries |
| **Mode Support** | All modes (request, browser, auto) |

**Best For:**
- Browser and auto modes (required)
- Regional content testing (streaming, e-commerce)
- Sites with stricter access requirements
- Social media platforms
- Sneaker sites and ticket vendors
- High-value scraping targets

**Example:**
```bash
curl -X POST "https://scrape.evomi.com/api/v1/scraper/realtime" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "proxy_type": "residential",
    "proxy_country": "US"
  }'
```

### Datacenter Proxies

High-speed datacenter IPs optimized for performance and cost.

**Cost:** 1 credit (request mode only)

| Feature | Description |
|---------|-------------|
| **IP Type** | Datacenter IPs |
| **Success Rate** | High for most sites |
| **Speed** | Fastest |
| **Rotating** | Yes (session support available) |
| **Countries** | 50+ countries |
| **Mode Support** | Request mode only |

**Mode Restriction:** Datacenter proxies can only be used with `mode="request"`. Browser and auto modes require premium (residential) proxies.
{{< /callout >}}

**Best For:**
- Request mode static scraping
- Public APIs and JSON endpoints
- News sites and blogs
- Documentation and knowledge bases
- High-volume scraping
- Development and testing
- Cost-sensitive projects

**Example:**
```bash
curl -X POST "https://scrape.evomi.com/api/v1/scraper/realtime" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://api.example.com/data",
    "proxy_type": "datacenter",
    "proxy_country": "DE"
  }'
```

## Cost Comparison

| Configuration | Credits | Notes |
|--------------|---------|-------|
| Request + Datacenter | 1 | Lowest cost option |
| Request + Residential | 2 | 2× premium proxy cost |
| Browser + Residential | 5 | Flat rate, residential required |
| Browser + Datacenter | ❌ | Not supported |
| Auto + Residential (request succeeds) | 2 | Same as request mode |
| Auto + Residential (upgraded to browser) | 6 | 50% of request + browser |
| Auto + Datacenter | ❌ | Not supported |
| Screenshot | +1 | Additive cost |
| AI Enhancement | +10 | Additive cost |

## Country Selection

Target any country using two-letter ISO 3166-1 alpha-2 codes:

### Popular Countries

| Code | Country | Code | Country |
|------|---------|------|---------|
| `US` | United States | `GB` | United Kingdom |
| `DE` | Germany | `FR` | France |
| `JP` | Japan | `AU` | Australia |
| `CA` | Canada | `BR` | Brazil |
| `IN` | India | `IT` | Italy |
| `ES` | Spain | `NL` | Netherlands |
| `SG` | Singapore | `KR` | South Korea |
| `MX` | Mexico | `SE` | Sweden |

**Example:**
```json
{
  "url": "https://example.com",
  "proxy_type": "residential",
  "proxy_country": "JP"
}
```

## Session Management

Maintain the same IP address across multiple requests using session IDs—perfect for multi-step workflows like login flows, shopping carts, or paginated scraping.

### Session ID Requirements

- **Length:** 6-8 characters
- **Format:** Alphanumeric (a-z, A-Z, 0-9)
- **Case-sensitive:** `session1` ≠ `SESSION1`
- **Persistence:** Same ID = same IP across requests

### Use Cases

**Login and Browse:**
```bash
# Step 1: Login page
curl -X POST "https://scrape.evomi.com/api/v1/scraper/realtime" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/login",
    "proxy_session_id": "user001",
    "proxy_country": "US"
  }'

# Step 2: Dashboard (same IP)
curl -X POST "https://scrape.evomi.com/api/v1/scraper/realtime" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/dashboard",
    "proxy_session_id": "user001",
    "proxy_country": "US"
  }'
```

**Shopping Cart Flow:**
```json
{
  "proxy_session_id": "cart789",
  "proxy_country": "US"
}
```
Use the same session ID for:
1. Browse products
2. Add to cart
3. View cart
4. Checkout

**Paginated Scraping:**
```json
{
  "proxy_session_id": "scrape1",
  "proxy_country": "GB"
}
```
Maintain the same IP when collecting multiple pages of results to preserve session consistency.

## Custom Proxy Override

Bring your own proxy by providing a complete proxy URL:

<!--email_off-->
```json
{
  "url": "https://example.com",
  "proxy_overwrite": "http://username:password@proxy.example.com:8080"
}
```
<!--email_on-->

**Supported Protocols:**
- `http://username:password@host:port`
- `https://username:password@host:port`
- `socks5://username:password@host:port`

When using `proxy_overwrite`, the `proxy_country` parameter is ignored. However, pricing still uses the `proxy_type` multiplier for cost calculation.
{{< /callout >}}

## Proxy Behavior by Mode

The proxy configuration applies differently based on the scraping mode:

| Mode | Proxy Usage |
|------|-------------|
| `request` | Proxy used for HTTP request |
| `browser` | Proxy used for browser connection |
| `auto` | Proxy used for initial request, then browser if upgraded |

## Best Practices

### Choose the Right Proxy Type

**Use Datacenter When:**
- Using request mode only (datacenter is not supported with browser/auto modes)
- Scraping public content
- Cost optimization is priority
- Target site has straightforward access requirements
- High-volume scraping of simple sites

**Use Residential When:**
- Using browser or auto mode (residential is required)
- Testing region-specific content
- Target has stricter access requirements
- Social media or e-commerce scraping
- Success rate is more important than cost

### Optimize Session Usage

**Do:**
- Use sessions for related requests (login → browse → action)
- Keep session IDs unique per workflow
- Reuse sessions within a reasonable timeframe

**Don't:**
- Use the same session ID across unrelated workflows
- Share session IDs between different users/accounts
- Keep sessions active indefinitely

### Monitor Success Rates

Track which proxy type works best for your targets:

```python
# Python example
results = {
    'datacenter_success': 0,
    'residential_success': 0
}

# Try datacenter first
response = scrape(url, proxy_type='datacenter')
if response.status_code == 200:
    results['datacenter_success'] += 1
else:
    # Fall back to residential
    response = scrape(url, proxy_type='residential')
    results['residential_success'] += 1
```

### Country Selection Strategy

**For Regional Content Testing:**
```json
{
  "proxy_country": "GB"  // Match the target country
}
```

**For General Scraping:**
```json
{
  "proxy_country": "US"  // Largest IP pool, best performance
}
```

**For Regional E-commerce:**
```json
{
  "proxy_country": "DE"  // Match customer location
}
```

## Proxy Errors

### Connection Refused

```json
{
  "success": false,
  "error": "Proxy connection failed"
}
```

**Solutions:**
- Try a different proxy_country
- Switch to residential proxies for better success rate
- Check if the target site is blocking your proxy type

### Timeout

```json
{
  "success": false,
  "error": "Request timeout"
}
```

**Solutions:**
- Increase `wait_seconds` for slow-loading sites
- Try datacenter proxies for faster connections
- Use `async=true` for long-running requests

Some websites block all datacenter IPs. If you consistently get blocked with datacenter proxies, switch to residential for a higher success rate.
{{< /callout >}}
