> ## Documentation Index
> Fetch the complete documentation index at: https://docs.roundproxies.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scraping Examples

> Drop-in scraping snippets for the most common languages and HTTP clients.

Use these copy-paste examples to send your first authenticated request through Roundproxies. Replace `USERNAME`, `PASSWORD`, and the gateway host with the values from your dashboard.

<Warning>
  Credentials are tied to your account. Grab them from the [dashboard](https://app.roundproxies.com) before running any of the snippets below.
</Warning>

## Proxy Endpoint

All examples on this page point at the same gateway. Adjust the host and port to match the network you're using (residential, datacenter, or ISP).

```
http://USERNAME:PASSWORD@gate.roundproxies.com:8000
```

### Components Breakdown

| Component    | Description                | Example                  |
| ------------ | -------------------------- | ------------------------ |
| **Host**     | Proxy gateway hostname     | `gate.roundproxies.com`  |
| **Port**     | Connection port            | `8000`                   |
| **Username** | Your account username      | `USERNAME`               |
| **Password** | Authentication password    | `PASSWORD`               |
| **Target**   | The URL you want to scrape | `https://httpbin.org/ip` |

## Python

The `requests` library is the most popular choice for synchronous scraping in Python.

```python theme={null}
import requests

proxies = {
    "http":  "http://USERNAME:PASSWORD@gate.roundproxies.com:8000",
    "https": "http://USERNAME:PASSWORD@gate.roundproxies.com:8000",
}

r = requests.get("https://httpbin.org/ip", proxies=proxies, timeout=30)
print(r.json())
```

## Node.js

Use `axios` together with `https-proxy-agent` to route both HTTP and HTTPS traffic through the gateway.

```javascript theme={null}
import axios from "axios";
import { HttpsProxyAgent } from "https-proxy-agent";

const agent = new HttpsProxyAgent(
  "http://USERNAME:PASSWORD@gate.roundproxies.com:8000"
);

const { data } = await axios.get("https://httpbin.org/ip", {
  httpAgent: agent,
  httpsAgent: agent,
});

console.log(data);
```

## Go

The standard `net/http` package supports proxies out of the box via `http.ProxyURL`.

```go theme={null}
package main

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

func main() {
	proxyURL, _ := url.Parse("http://USERNAME:PASSWORD@gate.roundproxies.com:8000")
	client := &http.Client{
		Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
	}

	resp, _ := client.Get("https://httpbin.org/ip")
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
```

## PHP

PHP's bundled cURL bindings make routing requests through Roundproxies a one-liner.

```php theme={null}
<?php
$ch = curl_init("https://httpbin.org/ip");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PROXY, "gate.roundproxies.com:8000");
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "USERNAME:PASSWORD");

echo curl_exec($ch);
curl_close($ch);
```

## Ruby

The standard library's `Net::HTTP::Proxy` factory wraps `Net::HTTP` with proxy auth.

```ruby theme={null}
require "net/http"
require "uri"

uri   = URI("https://httpbin.org/ip")
proxy = Net::HTTP::Proxy(
  "gate.roundproxies.com", 8000, "USERNAME", "PASSWORD"
)

puts proxy.get_response(uri).body
```

## cURL

The fastest way to verify your credentials from a shell.

```bash theme={null}
curl -x "http://USERNAME:PASSWORD@gate.roundproxies.com:8000" \
     https://httpbin.org/ip
```
