Skip to content

Commit f415ff0

Browse files
committed
Clarify configuration parameters
1 parent 98c8527 commit f415ff0

File tree

6 files changed

+41
-164
lines changed

6 files changed

+41
-164
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ node_modules/
55
venv
66
__pycache__/**
77
test.py
8+
./kernel/**

proxies/custom.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ Custom proxies allow you to use your own proxy servers with Kernel browsers. Thi
1111
Currently, only HTTPS proxies are supported for custom proxy configurations.
1212
</Note>
1313

14-
Custom proxies require host, port, and optional authentication:
14+
| Parameter | Required | Description |
15+
|-----------|----------|-------------|
16+
| `host` | Yes | Proxy server hostname or IP address (max 253 characters) |
17+
| `port` | Yes | Proxy server port (1-65535) |
18+
| `username` | No | Username for proxy authentication (max 128 characters, alphanumeric plus `_`, `-`, `@`, `.`) |
19+
| `password` | No | Password for proxy authentication (5-128 characters, no whitespace or escape characters) |
20+
1521

1622
<CodeGroup>
1723

@@ -57,13 +63,7 @@ browser = client.browsers.create(
5763

5864
</CodeGroup>
5965

60-
## Configuration Parameters
6166

62-
| Parameter | Required | Description |
63-
|-----------|----------|-------------|
64-
| `host` | Yes | Proxy server hostname or IP address |
65-
| `port` | Yes | Proxy server port |
66-
| `username` | No | Username for proxy authentication |
67-
| `password` | No* | Password for proxy authentication |
68-
69-
*Note: When creating a proxy with authentication, provide the password. The API response will only indicate if a password exists (`has_password: true`) but won't return the actual password for security reasons.
67+
<Note>
68+
When creating a proxy with authentication, provide the password. The API response will only indicate if a password exists (`has_password: true`) but won't return the actual password for security reasons.
69+
</Note>

proxies/datacenter.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Datacenter proxies route traffic through commercial data center servers. While t
66

77
## Configuration
88

9-
Datacenter proxies require only a country specification:
10-
119
<CodeGroup>
1210

1311
```typescript Typescript/Javascript
@@ -46,6 +44,12 @@ browser = client.browsers.create(
4644

4745
</CodeGroup>
4846

47+
## Configuration Parameters
48+
49+
| Parameter | Required | Description |
50+
|-----------|----------|-------------|
51+
| `country` | Yes | ISO 3166 country code |
52+
4953
## Supported Countries
5054

5155
Use ISO 3166 country codes (e.g., `US`, `GB`, `FR`) or `EU` for European Union exit nodes.

proxies/isp.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ ISP (Internet Service Provider) proxies combine the speed of datacenter proxies
66

77
## Configuration
88

9-
ISP proxies require a country specification:
10-
119
<CodeGroup>
1210

1311
```typescript Typescript/Javascript
@@ -46,6 +44,12 @@ browser = client.browsers.create(
4644

4745
</CodeGroup>
4846

47+
## Configuration Parameters
48+
49+
| Parameter | Required | Description |
50+
|-----------|----------|-------------|
51+
| `country` | Yes | ISO 3166 country code |
52+
4953
## Supported Countries
5054

51-
Use ISO 3166 country codes (e.g., `US`, `GB`, `DE`) or `EU` for European Union exit nodes.
55+
Use ISO 3166 country codes (e.g., `US`, `GB`, `FR`) or `EU` for European Union exit nodes.

proxies/mobile.mdx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ const proxy = await kernel.proxies.create({
2020
config: {
2121
country: 'US',
2222
carrier: 'verizon',
23-
state: 'CA',
2423
city: 'losangeles',
25-
zip: '90001',
26-
asn: '6167'
24+
zip: '90001'
2725
}
2826
});
2927

@@ -42,10 +40,8 @@ proxy = client.proxies.create(
4240
config={
4341
'country': 'US',
4442
'carrier': 'verizon',
45-
'state': 'CA',
4643
'city': 'losangeles',
47-
'zip': '90001',
48-
'asn': '6167'
44+
'zip': '90001'
4945
}
5046
)
5147

@@ -60,12 +56,12 @@ browser = client.browsers.create(
6056

6157
| Parameter | Required | Description |
6258
|-----------|----------|-------------|
63-
| `country` | No* | ISO 3166 country code (required if `city` is provided) |
64-
| `carrier` | No | Mobile carrier name (see supported carriers below) |
65-
| `state` | No | Two-letter US state code |
66-
| `city` | No | City name without spaces |
67-
| `zip` | No | US ZIP code |
68-
| `asn` | No | Autonomous System Number |
59+
| `country` | No | ISO 3166 country code (e.g., `US`, `GB`) |
60+
| `carrier` | No | Mobile carrier name (e.g., `verizon`, `att`) |
61+
| `state` | No | Two-letter state code (e.g., `NY`, `CA`). Only supported for US and Australia. **Cannot be used with `city`**. |
62+
| `city` | No | City name (lowercase letters only, no spaces, e.g., `newyork`, `losangeles`). Required if `zip` is provided. |
63+
| `zip` | No | US ZIP code (5 digits only, e.g., `10001`). **Requires `city` to be provided**. |
64+
| `asn` | No | Autonomous System Number (e.g., `AS15169`, `15169`). **Mutually exclusive with geo-location targeting** (`country`, `city`, `state`, `zip`). |
6965

7066
## Supported Carriers
7167

proxies/residential.mdx

Lines changed: 9 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ const proxy = await kernel.proxies.create({
1919
name: 'California Residential',
2020
config: {
2121
country: 'US',
22-
state: 'CA',
23-
city: 'sanfrancisco', // No spaces in city names
22+
city: 'sanfrancisco',
2423
zip: '94102',
25-
os: 'windows',
26-
asn: '7922' // Comcast
24+
os: 'windows'
2725
}
2826
});
2927

@@ -41,11 +39,9 @@ proxy = client.proxies.create(
4139
name='California Residential',
4240
config={
4341
'country': 'US',
44-
'state': 'CA',
45-
'city': 'sanfrancisco', # No spaces in city names
42+
'city': 'sanfrancisco',
4643
'zip': '94102',
47-
'os': 'windows',
48-
'asn': '7922' # Comcast
44+
'os': 'windows'
4945
}
5046
)
5147

@@ -60,133 +56,9 @@ browser = client.browsers.create(
6056

6157
| Parameter | Required | Description |
6258
|-----------|----------|-------------|
63-
| `country` | No* | ISO 3166 country code (required if `city` is provided) |
64-
| `state` | No | Two-letter US state code |
65-
| `city` | No | City name without spaces (e.g., `sanfrancisco`) |
66-
| `zip` | No | US ZIP code |
59+
| `country` | No | ISO 3166 country code (e.g., `US`, `GB`) |
60+
| `state` | No | Two-letter state code (e.g., `NY`, `CA`). Only supported for US and Australia. **Cannot be used with `city`**. |
61+
| `city` | No | City name (lowercase letters only, no spaces, e.g., `sanfrancisco`, `newyork`). Required if `zip` is provided. |
62+
| `zip` | No | US ZIP code (5 digits only, e.g., `94102`). **Requires `city` to be provided**. |
6763
| `os` | No | Operating system: `windows`, `macos`, or `android` |
68-
| `asn` | No | Autonomous System Number (see [ASN list](https://bgp.potaroo.net/cidr/autnums.html)) |
69-
70-
## Example: Location-specific scraping
71-
72-
Target specific geographic locations for localized content:
73-
74-
<CodeGroup>
75-
76-
```typescript Typescript/Javascript
77-
// Create proxies for different cities
78-
const cities = [
79-
{ city: 'newyork', state: 'NY' },
80-
{ city: 'losangeles', state: 'CA' },
81-
{ city: 'chicago', state: 'IL' }
82-
];
83-
84-
for (const location of cities) {
85-
const proxy = await kernel.proxies.create({
86-
type: 'residential',
87-
name: `${location.city} Residential`,
88-
config: {
89-
country: 'US',
90-
state: location.state,
91-
city: location.city
92-
}
93-
});
94-
95-
const browser = await kernel.browsers.create({
96-
proxy_id: proxy.id
97-
});
98-
99-
// Access location-specific content
100-
const playwright = await chromium.connectOverCDP(browser.cdp_ws_url);
101-
const context = playwright.contexts()[0];
102-
const page = context.pages()[0];
103-
104-
await page.goto('https://example.com/local-deals');
105-
// Scrape location-specific data
106-
107-
await browser.close();
108-
}
109-
```
110-
111-
```Python Python
112-
# Create proxies for different cities
113-
cities = [
114-
{'city': 'newyork', 'state': 'NY'},
115-
{'city': 'losangeles', 'state': 'CA'},
116-
{'city': 'chicago', 'state': 'IL'}
117-
]
118-
119-
for location in cities:
120-
proxy = client.proxies.create(
121-
type='residential',
122-
name=f"{location['city']} Residential",
123-
config={
124-
'country': 'US',
125-
'state': location['state'],
126-
'city': location['city']
127-
}
128-
)
129-
130-
browser = client.browsers.create(
131-
proxy_id=proxy.id
132-
)
133-
134-
# Access location-specific content
135-
playwright_browser = playwright.chromium.connect_over_cdp(browser.cdp_ws_url)
136-
context = playwright_browser.contexts[0]
137-
page = context.pages[0]
138-
139-
await page.goto('https://example.com/local-deals')
140-
# Scrape location-specific data
141-
142-
browser.close()
143-
```
144-
145-
</CodeGroup>
146-
147-
## Example: OS-specific targeting
148-
149-
Target specific operating systems for platform-specific content:
150-
151-
<CodeGroup>
152-
153-
```typescript Typescript/Javascript
154-
const proxy = await kernel.proxies.create({
155-
type: 'residential',
156-
name: 'Windows Residential',
157-
config: {
158-
country: 'US',
159-
os: 'windows'
160-
}
161-
});
162-
163-
// Use for Windows-specific sites or apps
164-
```
165-
166-
```Python Python
167-
proxy = client.proxies.create(
168-
type='residential',
169-
name='Windows Residential',
170-
config={
171-
'country': 'US',
172-
'os': 'windows'
173-
}
174-
)
175-
176-
# Use for Windows-specific sites or apps
177-
```
178-
179-
</CodeGroup>
180-
181-
## Benefits
182-
183-
- Excellent bot detection avoidance
184-
- Real residential IP addresses
185-
- Fine-grained geographic targeting
186-
- Operating system targeting
187-
188-
## Limitations
189-
190-
- Slower than datacenter and ISP proxies
191-
- IP addresses may rotate
192-
- Higher cost than other proxy types
64+
| `asn` | No | Autonomous System Number (e.g., `AS7922`, `7922`). **Mutually exclusive with geo-location targeting** (`country`, `city`, `state`, `zip`). |

0 commit comments

Comments
 (0)