# net device usage samples — NCM API

Periodic counts of the bytes passed in and out of each network interface. Read-only, a single list call, filtered by device and time range. This is the data behind usage reporting on metered links; sample volume is high, so filter tightly.

Base URL: https://www.cradlepointecm.com/api/v2

### GET /net_device_usage_samples/

Get information about net_device_usage_samples

<p>Use the GET method on this endpoint to retrieve net_device_usage_samples records. Use the available filtering fields to narrow or broaden your search.</p><p><strong>Note: </strong>There is a 100 device limit for API queries. If you attempt to retrieve records for more than 100 devices in a single query you will receive an error message. If you do not explicitly specify devices, it is assumed that you are trying to pull records for all devices in your account. If you have more than 100 devices in your account then you may query in batches. See the example titled 'Net Device Usage and Signal Samples' on the Sample Code page for details on querying net_device_signal_samples in batches.</p>

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| X-ECM-API-ID | header | string | yes | <strong>ECM API app Id</strong> |
| X-ECM-API-KEY | header | string | yes | <strong>ECM API app key</strong> |
| X-CP-API-ID | header | string | yes | <strong>Cradlepoint API app Id</strong> |
| X-CP-API-KEY | header | string | yes | <strong>Cradlepoint API access key</strong> |
| net_device | query | in: int<br />out: url | no | ID of a net device |
| net_device__in | query | in: int<br />out: url | no | Filter for net_device contains - a comma-separated list of net_device IDs |
| created_at | query | timestamp | no | Timestamp for when the net_device_usage_samples record was created |
| created_at__lt | query | timestamp | no | Filter for created_at is less than |
| created_at__gt | query | timestamp | no | Filter for created_at is greater than |
| created_at_timeuuid | query | timeuuid | no | A unique ID (timeuuid) associated with the created_at timestamp |
| created_at_timeuuid__in | query | timeuuid | no | Filter for created_at_timeuuid in - a comma-separated list of timeuuids for net_device_usage_samples records |
| created_at_timeuuid__gt | query | timeuuid | no | Filter for created_at_timeuuid is greater than |
| created_at_timeuuid__gte | query | timeuuid | no | Filter for created_at_timeuuid is greater than or equal to |
| created_at_timeuuid__lt | query | timeuuid | no | Filter for created_at_timeuuid is less than |
| created_at_timeuuid__lte | query | timeuuid | no | Filter for created_at_timeuuid is less than or equal |
| order_by | query | string | no | Specifies the sort order for response data |
| limit | query | integer | no | Restricts the number of records returned in a recordset to this value. Max value is 500. |
| offset | query | integer | no | Specifies where (an index) in a recordset to begin returning records. |

**Example request**

```bash
curl "https://www.cradlepointecm.com/api/v2/net_device_usage_samples/" \
  -H "X-CP-API-ID: <cp-api-id>" \
  -H "X-CP-API-KEY: <cp-api-key>" \
  -H "X-ECM-API-ID: <ecm-api-id>" \
  -H "X-ECM-API-KEY: <ecm-api-key>"
```

**Response 200** — Example response.

```json
{
  "data": [
    {
      "bytes_in": 115192663,
      "bytes_out": 192047700,
      "created_at": "2021-02-09T20:25:36.942593+00:00",
      "created_at_timeuuid": "f803740a-6b14-11eb-a773-12bfd7fde28d",
      "net_device": "https://www.cradlepointecm.com/api/v2/net_devices/74404917/",
      "period": 2074.1544243349927,
      "uptime": 185504.796904274
    }
  ],
  "meta": {
    "limit": 20,
    "next": null
  }
}
```
