# Web Cloud › OverTheBox › Device › Statistics API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Web Cloud product's sections: https://developers.eu.ovhcloud.com/reference/web-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 1 operation of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/statistics/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/overthebox/device/statistics.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/overthebox/device/statistics.json?format=openapi3

## Operations

- `GET /overTheBox/{serviceName}/statistics` — Get the statistics of an OverTheBox device

## Get the statistics of an OverTheBox device

`GET /1.0/overTheBox/{serviceName}/statistics`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/statistics/#get-overthebox-servicename-statistics

**Status:** Beta version  
**IAM actions:** `overTheBox:apiovh:statistics/get`

Returns the load, free memory or traffic series of the device for an hourly, daily, weekly or monthly period, each series with its unit, tags and timestamped points.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `metricsType` | query | otb.DeviceStatisticsTypeEnum | yes | Type of metrics you want to retrieve — one of `load`, `memory_free`, `traffic` |
| `period` | query | otb.DeviceStatisticsPeriodEnum |  | Period (default is daily) — one of `daily`, `hourly`, `monthly`, `weekly` |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | otb.device.statistics[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | read-only | Name of the serie |
| `points` | otb.device.statistics.point[] | read-only | List of point |
| `points[].timestamp` | integer | read-only | Timestamp |
| `points[].value` | number | read-only | Datapoint value |
| `tags` | otb.device.statistics.tag[] | read-only | List of tags |
| `tags[].name` | string | read-only | Name of tag |
| `tags[].value` | string | read-only | Value of tag |
| `unit` | otb.DeviceStatisticsUnitEnum | read-only | Unit of the serie — one of `bps`, `byte`, `n/a` |

```json
[
  {
    "name": "string",
    "points": [
      {
        "timestamp": 0,
        "value": 0
      }
    ],
    "tags": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "unit": "bps"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/statistics" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/overTheBox/{serviceName}/statistics")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/overTheBox/{serviceName}/statistics");

print_r($result);
?>
```
