---
title: List resource providers
method: GET
weight: 1
section: 'Basics'
---

import {
  EndpointHeader,
  ParamField,
  ParamFields,
  CodeGroup,
  RequestExample,
  ResponseExample,
} from '@/components/api';

<EndpointHeader method="GET" path="/api/v1/energies" />

Returns the hierarchy of resource-providing companies.

<ParamFields title="Query parameters">
  <ParamField name="page" type="integer">
    Page number.
  </ParamField>
</ParamFields>

## Response fields

| Attribute      | Description                                                                     |
| -------------- | ------------------------------------------------------------------------------- |
| `id`           | Identifier (unique key) of the resource provider in the system                  |
| `name`         | Resource provider name                                                          |
| `children`     | Array of branches and/or subdivisions                                           |
| `data`         | Array of returned data                                                          |
| `total_pages`  | Total number of pages in the returned set                                       |
| `current_page` | Current page                                                                    |
| `next_page`    | Next page available for downloading, `null` if the current page is the last one |

<RequestExample>
  <CodeGroup labels={["curl", "Node", "Python", "Go", "PHP"]}>
    <Fragment slot="panel-0">

```bash
curl -i \
  --header "access-token: *********************" \
  --header "token-type: Bearer" \
  --header "client: **********************" \
  --header "uid: user@local.net" \
  --header "Content-Type: application/json" \
  --request GET \
  "https://uztgs.uz/api/v1/energies?page=1"
```

    </Fragment>
    <Fragment slot="panel-1">

```js
const res = await fetch('https://uztgs.uz/api/v1/energies?page=1', {
  headers: {
    'access-token': '*********************',
    'token-type': 'Bearer',
    client: '**********************',
    uid: 'user@local.net',
    'Content-Type': 'application/json',
  },
});
const data = await res.json();
```

    </Fragment>
    <Fragment slot="panel-2">

```python
import requests

res = requests.get(
    "https://uztgs.uz/api/v1/energies",
    params={"page": 1},
    headers={
        "access-token": "*********************",
        "token-type": "Bearer",
        "client": "**********************",
        "uid": "user@local.net",
        "Content-Type": "application/json",
    },
)
data = res.json()
```

    </Fragment>
    <Fragment slot="panel-3">

```go
req, _ := http.NewRequest("GET", "https://uztgs.uz/api/v1/energies?page=1", nil)
req.Header.Set("access-token", "*********************")
req.Header.Set("token-type", "Bearer")
req.Header.Set("client", "**********************")
req.Header.Set("uid", "user@local.net")
req.Header.Set("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)
```

    </Fragment>
    <Fragment slot="panel-4">

```php
$ch = curl_init("https://uztgs.uz/api/v1/energies?page=1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "access-token: *********************",
    "token-type: Bearer",
    "client: **********************",
    "uid: user@local.net",
    "Content-Type: application/json",
]);
$data = json_decode(curl_exec($ch), true);
```

    </Fragment>

  </CodeGroup>
</RequestExample>

<ResponseExample>

```json
{"data":[
  {
    "id": 1,
    "name": "Hududgaz",
    "children": [
      { "id": 2, "name": "Hududgaz Andijon", "children": [] },
      { "id": 3, "name": "Hududgaz Buxoro", "children": [] }
    ]
  },
  ...
  ],
  "total_pages": 8,
  "current_page": 1,
  "next_page": 2
}
```

</ResponseExample>
