[comment]: # ({9936c391-51323acb})
# proxygroup.get

[comment]: # ({/9936c391-51323acb})

[comment]: # ({05aa6b77-0b47b101})
### Description

`integer/array proxygroup.get(object parameters)`

The method allows to retrieve proxy groups according to the given parameters.

::: noteclassic
This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See
[User roles](/manual/web_interface/frontend_sections/users/user_roles) for more information.
:::

[comment]: # ({/05aa6b77-0b47b101})

[comment]: # ({4298141a-e8ed9d1c})
### Parameters

`(object)` Parameters defining the desired output.

The method supports the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data-types)|Description|
|--|--|------|
|proxy_groupids|ID/array|Return only proxy groups with the given IDs.|
|proxyids|ID/array|Return only proxy groups that contain the given proxies.|
|selectProxies|query|Return a [`proxies`](/manual/api/reference/proxy/object) property with the proxies that belong to the proxy group.<br><br>Supports `count`.|
|sortfield|string/array|Sort the result by the given properties.<br><br>Possible values: `proxy_groupid`, `name`.|
|countOutput|boolean|These parameters are described in the [reference commentary](/manual/api/reference_commentary#common-get-method-parameters).|
|editable|boolean|^|
|excludeSearch|boolean|^|
|filter|object|^|
|limit|integer|^|
|output|query|^|
|preservekeys|boolean|^|
|search|object|^|
|searchByAny|boolean|^|
|searchWildcardsEnabled|boolean|^|
|sortorder|string/array|^|
|startSearch|boolean|^|

[comment]: # ({/4298141a-e8ed9d1c})

[comment]: # ({07ca11ca-5d7f971e})
### Return values

`(integer/array)` Returns either:

-   an array of objects;
-   the count of retrieved objects, if the `countOutput` parameter has been used.

[comment]: # ({/07ca11ca-5d7f971e})

[comment]: # ({b41637d2-c32e5272})
### Examples

[comment]: # ({/b41637d2-c32e5272})

[comment]: # ({8e2ed653-78dbbfff})
#### Retrieve all proxy groups

Retrieve all configured proxy groups with proxies.

[Request](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "proxygroup.get",
    "params": {
        "output": "extend",
        "selectProxies": ["proxyid", "name"]
    },
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "proxy_groupid": "1",
            "name": "Proxy group 1",
            "failover_delay": "1m",
            "min_online": "3",
            "description": "",
            "state": "1",
            "proxies": [
                {
                    "proxyid": "1",
                    "name": "proxy 1"
                },
                {
                    "proxyid": "2",
                    "name": "proxy 2"
                }
            ]
        },
        {
            "proxy_groupid": "2",
            "name": "Proxy group 2",
            "failover_delay": "10m",
            "min_online": "3",
            "description": "",
            "state": "3",
            "proxies": [
                {
                    "proxyid": "3",
                    "name": "proxy 3"
                },
                {
                    "proxyid": "4",
                    "name": "proxy 4"
                },
                {
                    "proxyid": "5",
                    "name": "proxy 5"
                }
            ]
        }
    ],
    "id": 1
}
```

[comment]: # ({/8e2ed653-78dbbfff})

[comment]: # ({606fe203-df1d5f90})
### See also

-   [Proxy](/manual/api/reference/proxy/object#proxy)

[comment]: # ({/606fe203-df1d5f90})

[comment]: # ({e04ef422-01660b7a})
### Source

CProxyGroup::get() in *ui/include/classes/api/services/CProxyGroup.php*.

[comment]: # ({/e04ef422-01660b7a})
