# Session ID + TTL

## Basic usage <a href="#basic-usage" id="basic-usage"></a>

{% hint style="warning" %}
Credentials:

* Proxy host:&#x20;
  * **`res.proxy-seller.com`**`(NL)`
  * **`us.res.proxy-seller.com`**`(US)`
  * **`asia.res.proxy-seller.com`**`(JP-Tokyo)`
  * **`asia2.res.proxy-seller.com`**`(JP-Tokyo)`
* Proxy port: `10000`
* Proxy type: `HTTPS/SOCKS5 (`(auto-detected)`)`
* Proxy user: `xxx`
* Proxy password: `yyy`
  {% endhint %}

{% hint style="danger" %}
**Attention:**

For simultaneous requests, use different ports in the range **10000-10999**.

**Important note:** Each IP address port corresponds to a unique IP address (e.g. 1.23.45.6:10005 and 1.23.45.6:10006 are different IPs).
{% endhint %}

### User & password (Main package)

{% hint style="warning" %}
Only via API

To obtain a username and password, you must create a special list

<mark style="color:orange;">PUT</mark> [/resident/list/tools](https://docs.proxy-seller.com/proxy-seller/residential-proxy/api-tool/create-a-special-list)
{% endhint %}

### User & password (Resident Subuser)

{% hint style="warning" %}
Only via API

To obtain a username and password, you must create a special list in your subaccoun

<mark style="color:orange;">PUT</mark> [/residentsubuser/list/tools](https://docs.proxy-seller.com/proxy-seller/residential-proxy/subaccounts-subusers/create-a-special-list-for-api-tool)
{% endhint %}

***

## **Curl command line sample**

```
curl -v -x xxx:yyy@res.proxy-seller.com:10000 https://www.google.com
```

{% hint style="info" %}
For each request, a new exit IP address is allocated from the global IP pool.
{% endhint %}

### Restrict exit IPs to a specific country <a href="#restrict-exit-ips-to-a-specific-country" id="restrict-exit-ips-to-a-specific-country"></a>

{% hint style="info" %}
You can add country data to the login info as follows: `xxx_c_US`

Here, **US** is a two-letter country code as per ISO 3166-1

Country code is **case-sensitive**!

The list with country code you can find [here](https://docs.proxy-seller.com/proxy-seller/residential-proxy/get-all-locations).
{% endhint %}

**Curl command line sample:**

```
curl -v -x xxx_c_US:yyy@res.proxy-seller.com:10000 https://www.google.com
```

### Restrict exit IPs to a specific subdivision

{% hint style="info" %}
You can add subdivision data to the login info as follows : `xxx_sd_ID`

The list with ID of subdivisions you can find [here](https://docs.proxy-seller.com/proxy-seller/residential-proxy/get-all-locations).
{% endhint %}

**Curl command line sample:**

`curl -v -x xxx_sd_1906:yyy@res.proxy-seller.com:10000 https://www.google.com`

### Restrict exit IPs to a specific city <a href="#restrict-exit-ips-to-a-specific-city" id="restrict-exit-ips-to-a-specific-city"></a>

{% hint style="info" %}
You can add city data to the login info as follows: `xxx_city_Paris`

You can specify both country and city at the same time like: `xxx_c_US_city_New-York`.
{% endhint %}

**Curl command line sample:**

```
curl -v -x xxx_city_Paris:yyy@res.proxy-seller.com:10000 https://www.google.com
```

{% hint style="danger" %}
City names:

Spaces in city names (e.g. New York) must be replaced with the minus sign (-). For example:

```
curl -v -x xxx_city_New-York:yyy@res.proxy-seller.com:10000 https://www.google.com
```

{% endhint %}

### Restrict exit IPs to a specific ISP <a href="#restrict-exit-ips-to-a-specific-isp" id="restrict-exit-ips-to-a-specific-isp"></a>

{% hint style="info" %}
You can add ISP data to the login info as follows : `xxx_isp_ID`

The list with ID of ISPs you can find [here](https://docs.proxy-seller.com/proxy-seller/residential-proxy/api-tool/get-all-isp-codes).
{% endhint %}

**Curl command line sample:**

```
curl -v -x xxx_isp_51811:yyy@res.proxy-seller.com:10000 https://www.google.com
```

### Restrict exit IPs to a specific ASN <a href="#restrict-exit-ips-to-a-specific-asn" id="restrict-exit-ips-to-a-specific-asn"></a>

{% hint style="info" %}
You can add ASN data to the login info as follows : `xxx_asn_12389`
{% endhint %}

**Curl command line sample:**

```
curl -v -x xxx_asn_12389:yyy@res.proxy-seller.com:10000 https://www.google.com
```

### Restrict exit IPs to a specific ZIP code <a href="#restrict-exit-ips-to-a-specific-zip-code" id="restrict-exit-ips-to-a-specific-zip-code"></a>

{% hint style="info" %}
You can add ZIP code to the login info as follows : `xxx_c_US_zip_10001`
{% endhint %}

{% hint style="warning" %}
The ZIP code works only in combination with the country code.
{% endhint %}

**Curl command line sample:**

```
curl -v -x xxx_c_US_zip_10001:xxx@res.proxy-seller.com:10000 https://www.google.com
```

## Session control <a href="#session-control" id="session-control"></a>

### Session ID <a href="#session-id" id="session-id"></a>

{% hint style="info" %}
If you need to initiate requests from the same IP more than once (reuse the same IP), you can add a session ID to the login as follows: `xxx_s_100`

In this case, 100 is your session ID. You can use any alpha-numeric string as a session ID.

If you repeat the session ID in the subsequent requests, you’ll get the same exit IP as long as it stays online.

Time limit for inactive sessions - 60 minutes.
{% endhint %}

**Curl command line sample:**

```
curl -v -x xxx_c_US_s_100:yyy@res.proxy-seller.com:10000 https://www.google.com
```

### Session time <a href="#session-time" id="session-time"></a>

If you need to set up the session time (*rotation*), you can add a session time to the login with session ID as follows: `xxx_s_100_ttl_30s`

The `ttl` parameter goes along with the session ID and allows you to set the session time. The suffixes `s` (*seconds*), `m` (*minutes*), `h` (*hours*) can be used in this parameter. After the specified time has elapsed, a request within that session will cause it to be re-created, resulting in the assignment of a new IP address (*it's an alternative method to set a custom rotation time for each session*).

**Example with a TTL of 10 seconds:**

```
curl -v -x xxx_c_US_s_100_ttl_10s:yyy@res.proxy-seller.com:10000 https://www.google.com
```

**Example with a TTL of 15 minutes:**

```
curl -v -x xxx_c_US_s_100_ttl_15m:yyy@res.proxy-seller.com:10000 https://www.google.com
```

**Example with a TTL of with 1 hour:**

```
curl -v -x xxx_c_US_s_100_ttl_1h:yyy@res.proxy-seller.com:10000 https://www.google.com
```

### Different geotargeting combinations <a href="#different-geotargeting-combinations" id="different-geotargeting-combinations"></a>

{% hint style="info" %}
You can also specify different targeting combinations - country, city, ISP, ASN, session - at the same time.
{% endhint %}

**Example with country, city, ASN, session.**

```
curl -v -x xxx_c_US_city_New-York_asn_12271_s_100:yyy@res.proxy-seller.com:10000 https://www.google.com
```

**Example with country, city, session.**

```
curl -v -x xxx_c_US_city_New-York_s_100:yyy@res.proxy-seller.com:10000 https://www.google.com
```

**Example with country, ASN.**

```
curl -v -x xxx_c_US_asn_12271:yyy@res.proxy-seller.com:10000 https://www.google.com
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.proxy-seller.com/proxy-seller/residential-proxy/api-tool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
