Introduction
Digi Remote Manager (DRM) API responses are returned as JSON by default. For many workflows — including loading data into spreadsheets, importing into databases, generating reports, or feeding external analytics tools — a CSV format is more practical.
DRM provides two mechanisms for exporting data to CSV:
- The /bulk endpoint variant, available for device inventory and network interface endpoints, returns results directly as a CSV file in a single request. This is the simplest approach for inventory data.
- For time-series metric data returned by the streams/history endpoint, CSV export requires paginating through the JSON responses and writing each page of results to a file. This article provides ready-to-use scripts for this pattern.
This article covers both approaches in full, including how to combine the two inventory CSV files into a single joined dataset, how to export multiple metric streams into one file, and how to scope exports to a specific subaccount.
Prerequisites
- An active Digi Remote Manager account with enrolled devices.
- Valid DRM credentials — username and password, or a DRM API key — for HTTPS Basic Authentication.
- For inventory CSV export: any tool capable of making HTTP GET requests, such as curl, Postman, Python requests, or a browser with an API client extension.
- For metric history CSV export: Python 3 with the requests library installed (pip install requests), or an equivalent HTTP client in your preferred language.
- Device Health metrics must be enabled on devices for cellular metric streams to be available, and devices must be running a current DAL OS firmware version. Availability of the cell_id stream (ECI/NCI) additionally depends on cellular modem firmware capability. See the companion article: How to Retrieve Cellular Performance Metrics Using the Digi Remote Manager API.
Procedure 1: Export Device Inventory to CSV
The v1/devices and v1/network_interfaces endpoints each offer a /bulk path that returns CSV output directly, without requiring any client-side processing. These are the recommended endpoints for one-time or scheduled inventory exports.
Step 1 — Export Core Device Records
Replace /inventory with /bulk in the standard devices endpoint URL. Use the fields parameter to specify exactly which columns to include in the output. The response body is a plain-text CSV file.
GET https://remotemanager.digi.com/ws/v1/devices/bulk?fields=id,name,mac,ip,public_ip,serial_number,type,firmware_version,firmware_status,connection_status,carrier,network,signal_strength,health_status,group,last_connect,last_update
Save directly to a file using curl:
curl -u 'username:api_key' \ 'https://remotemanager.digi.com/ws/v1/devices/bulk?fields=id,name,mac,ip,public_ip,serial_number,type,firmware_version,firmware_status,connection_status,carrier,network,signal_strength,health_status,group,last_connect,last_update' \ -o devices.csv
Note: If no fields parameter is provided, the /bulk endpoint returns all available fields. Specifying fields reduces response size and makes the output easier to work with downstream.
Step 2 — Export IMSI and SIM Records
Use the /bulk variant of the network_interfaces endpoint to export IMSI and SIM metadata:
GET https://remotemanager.digi.com/ws/v1/network_interfaces/bulk?fields=device_id,imsi,sim_id,interface_type,phone_number,active
curl -u 'username:api_key' \ 'https://remotemanager.digi.com/ws/v1/network_interfaces/bulk?fields=device_id,imsi,sim_id,interface_type,phone_number,active' \ -o network_interfaces.csv
Important: Not all devices have a network interface record. Devices without one will not appear in the network_interfaces.csv output and will therefore have no IMSI in the joined result. This is typically resolved by enabling Device Health metrics and ensuring the device is running a current DAL OS firmware version. Note that DAL OS firmware and cellular modem firmware are separate components — for IMSI availability, DAL OS version is the relevant dependency.
Step 3 — Join the Two CSV Files into a Single Inventory
The two CSV files share a common identifier: the id column in devices.csv corresponds to the device_id column in network_interfaces.csv. Joining on this field produces a complete per-device inventory record that includes both the core device metadata and the IMSI.
The following Python script performs a left join — every device record is included, with IMSI fields added where a matching network interface record exists:

Note: For dual-SIM devices, the script above selects the active SIM. If you need both SIM records per device, remove the active-SIM preference logic and instead write one output row per interface record, repeating the device fields for each.
Procedure 2: Export Cellular Metric History to CSV
The streams/history endpoint returns JSON and does not have a /bulk CSV variant. Exporting metric history to CSV therefore requires paginating through the JSON responses and writing each page of results to a file. The pattern is the same regardless of which metric stream you are exporting.
Step 1 — Export a Single Metric Stream
The following Python script exports all datapoints for one metric stream over a given date range to a CSV file. It handles pagination automatically, following cursor values until all pages have been retrieved:

Note: When following pagination cursors, remove start_time and end_time from subsequent requests. The cursor already encodes the position in the result set; including the time parameters on paginated requests can cause unexpected behavior.
Step 2 — Export Multiple Metric Streams into One File
To export several metric streams for the same device into a single CSV — for example, signal_strength, signal_quality, rsrp, rsrq, cell_id, and sinr together — iterate over a list of stream names and append all results to one file. Including the stream name as a column allows you to distinguish rows from different streams:

Note: The output CSV uses a long (tidy) format: one row per datapoint, with the stream name as a column. This format is well-suited to analysis tools such as pandas, Excel Power Query, or Tableau, where you can pivot or filter by stream name. If a wide format is required (one column per stream, aligned by timestamp), a pivot operation will be needed after export, since different streams may not share identical timestamps.
Step 3 — Export Metric History for Multiple Devices
To export the same metric streams across an entire fleet, retrieve the device list first and then iterate over each device ID. The following script combines fleet discovery with metric history export:

Important: For large fleets or long date ranges, this export may take a significant amount of time and generate a large output file. Consider breaking exports into shorter date ranges, filtering to a specific device group using the group query parameter on v1/devices/inventory, or running the script during off-peak hours to avoid API rate limits.
Procedure 3: Scoping CSV Exports to a Subaccount
If your DRM account uses subaccounts, all of the API calls described in this article support the actor and account-filter HTTP headers to control which account's data is returned. These headers work identically for /bulk and /inventory endpoints.
Export inventory for a specific subaccount
Add the actor header with the target subaccount's customer_id:
curl -u 'username:api_key' \ -H 'actor: 74214' \ 'https://remotemanager.digi.com/ws/v1/devices/bulk?fields=id,name,mac,ip,imsi,firmware_version,carrier,network' \ -o subaccount_74214_devices.csv
Export inventory across all subaccounts
Add the account-filter: all header to include devices from the parent account and all subaccounts in one export:
curl -u 'username:api_key' \ -H 'account-filter: all' \ 'https://remotemanager.digi.com/ws/v1/devices/bulk?fields=id,name,mac,ip,firmware_version,carrier,network,group' \ -o all_accounts_devices.csv
Note: The group field in the device record reflects the DRM group path, which can help identify which subaccount a device belongs to when exporting across all accounts. To find the customer_id values for your subaccounts, call GET https://remotemanager.digi.com/ws/v1/subaccounts/inventory. For full details on working with subaccounts via the API, see: https://doc-remotemanager.digi.com/pages/working-with-subaccounts
In Python scripts, pass the header in the requests call:
# Scope to a single subaccount
headers = {'actor': '74214'}
r = requests.get(url, params=params, auth=AUTH, headers=headers)
# Or retrieve across all subaccounts
headers = {'account-filter': 'all'}
r = requests.get(url, params=params, auth=AUTH, headers=headers)
Common Issues
|
Symptom
|
Likely Cause
|
Resolution
|
|
The /bulk endpoint returns JSON instead of CSV
|
The endpoint URL may be pointing to /inventory instead of /bulk
|
Ensure the URL path ends in /bulk, not /inventory. Example: /ws/v1/devices/bulk
|
|
The CSV export is missing some devices
|
The /bulk endpoint paginates large result sets. Devices beyond the default page size may be omitted if pagination is not handled.
|
Add size=10000 to the /bulk request to increase the page limit, or check whether the response includes a cursor value indicating additional pages.
|
|
The network_interfaces CSV has fewer rows than the devices CSV
|
Not all devices report network interface records to DRM
|
Devices without a network interface record have no IMSI available. Enable Device Health metrics on those devices and ensure they are running a current DAL OS firmware version. See: How to Retrieve Device Inventory Data Including IMSI Using the Digi Remote Manager API.
|
|
The metric history export script stops before retrieving all data
|
The cursor is not being carried forward correctly between pages
|
Ensure the cursor value from the response is passed as a query parameter on the next request. Also remove start_time and end_time from paginated requests — only the cursor is needed after the first page.
|
|
The exported CSV contains duplicate rows for dual-SIM devices
|
Each SIM slot produces a separate row in the network_interfaces response
|
Use the active field to filter to the active SIM per device, or intentionally retain both rows if both SIM identities are required.
|
|
API requests return a 429 Too Many Requests error during fleet export
|
The export script is calling the API faster than the account's rate limit allows
|
Add a short delay (e.g., time.sleep(0.5)) between requests in the script, or break the export into smaller date ranges or device batches. DRM rate limits are documented at: https://doc-remotemanager.digi.com/pages/throttles/
|
Further Information
Last updated:
Jun 02, 2026