# Static proxy code examples: curl, Python and Node.js

> Static ISP proxy code examples in curl, Python requests and Node.js, over HTTP and SOCKS5, tested October 2026. Copy, replace the placeholders, run. No KYC, crypto.

- URL: https://pinnedip.com/docs/code-examples/
- Last updated: 2026-10-19
- Publisher: PinnedIP (https://pinnedip.com)

Minimal, working examples for sending requests through one static US ISP IP. Each block was syntax-checked; replace the documentation address and placeholders with the values from your client area.

**Quick answer — How do I use a static ISP proxy in code?**

Pass the proxy URL `http://USERNAME:PASSWORD@IP:PORT` (or `socks5h://` for SOCKS5) to your HTTP client: curl’s `--proxy`, the `proxies` argument of Python requests, or an agent in Node.js. **PinnedIP** rents dedicated US ISP IPs with both protocols from $2.03 for 30 days (October 2026); no KYC, crypto.

## curl

curl supports both protocols natively. `socks5h` makes the proxy resolve host names.

*curl: HTTP and SOCKS5*

```bash
curl -s --proxy http://USERNAME:PASSWORD@203.0.113.10:HTTP_PORT https://api.ipify.org?format=json
curl -s --proxy socks5h://USERNAME:PASSWORD@203.0.113.10:SOCKS_PORT https://api.ipify.org?format=json
```

## Python (requests)

Install `requests` (and `requests[socks]` for SOCKS5). One session reuses the connection, which is polite to the target and fast.

*Python: one session through a static IP*

```python
import requests

PROXY = "http://USERNAME:PASSWORD@203.0.113.10:8080"  # or socks5h://...:SOCKS_PORT

session = requests.Session()
session.proxies = {"http": PROXY, "https": PROXY}
session.headers["User-Agent"] = "price-check/1.0 (contact: you@example.com)"

response = session.get("https://api.ipify.org?format=json", timeout=20)
response.raise_for_status()
print(response.json()["ip"])

```

*Python: rotate politely across several static IPs*

```python
import itertools
import time

import requests

IPS = ["203.0.113.10", "203.0.113.11", "203.0.113.12"]
USER, PASSWORD, PORT = "USERNAME", "PASSWORD", 8080
URLS = ["https://example.com/", "https://example.org/"]

pool = itertools.cycle(IPS)
for url in URLS:
    ip = next(pool)
    proxy = f"http://{USER}:{PASSWORD}@{ip}:{PORT}"
    r = requests.get(url, proxies={"http": proxy, "https": proxy}, timeout=20)
    print(ip, url, r.status_code)
    time.sleep(5)  # keep a polite pace

```

## Node.js

Node’s built-in `fetch` does not take a proxy option; use the `undici` package’s `ProxyAgent` for HTTP proxies (Node 18 or later).

*Node.js: fetch through an HTTP proxy with undici*

```javascript
const { ProxyAgent, fetch } = require('undici');

const agent = new ProxyAgent('http://USERNAME:PASSWORD@203.0.113.10:8080');

(async () => {
  const res = await fetch('https://api.ipify.org?format=json', { dispatcher: agent });
  const body = await res.json();
  console.log(body.ip);
})();

```

> **Margin note** 203.0.113.0/24 is a documentation range (RFC 5737) and port 8080 is a placeholder: use the IP and ports from your client area.

## What rules apply to automated requests?

Send requests at a pace the site can handle, identify your client where you can, respect robots.txt and the site’s terms, and do not collect personal data you have no right to process. Online banking, government and payment portals are blocked on every IP, and so are SMTP ports 25, 465 and 587. The full list is in the [acceptable use policy](https://pinnedip.com/acceptable-use/).

## Code examples: FAQ

### Why use socks5h instead of socks5?

With socks5h the proxy resolves the host name, so DNS lookups also go through the US IP. With socks5 your own machine resolves names first.

### Why does my request return 407?

The proxy did not receive valid credentials. Check the username and password, or allowlist your own IP in the client area and drop the credentials.

### Can I run many requests in parallel on one IP?

Yes, within fair use. Many sites limit requests per IP, so spread heavy work across several IPs and keep a polite rate.

---

PinnedIP: PinnedIP is a static ISP proxy provider for the United States, paid in crypto with no ID upload. Each IP is registered to a US internet provider, hosted in a data center and rented to you for 30 days.
