Get uplink packets from the database
Returns device uplink packets stored in the server database for the given period. Use this command to get data for a past period — for example, if realtime_data messages were lost when the connection dropped or were received by another subscribed connection.
The response arrives as two get_data_resp messages with the same operation_id: first status: 1 — the request is accepted, then status: 3 — the data.
Request and response: get_data_req → get_data_resp (two messages).
Access: a low access level token sees the devices of its application and of applications that granted it access; a high access level token sees all devices of the owner.
Request
Fields not marked as required may be omitted.
| Field | Type | Description |
|---|---|---|
cmd | string | get_data_req |
operation_id | string | Any string; the server returns it in the response to match the request and the response |
date_from | string | Required. Period start, inclusive. Format YYYY-MM-DD HH:MM:SS+HHMM |
date_to | string | Required. Period end, exclusive. Same format |
devEui | string | Device DevEUI, 16 hex characters. Without it — all accessible devices |
appId | string | Application identifier (APP_ID); returns data only for the devices of this application |
limit | uint32 | How many packets to return. Default 10; the server reduces a value above 500 to 500 |
descending | bool | true — newest first. Default false: oldest first |
{
"cmd": "get_data_req",
"operation_id": "abc",
"devEui": "7950D20CBBB77561",
"date_from": "2026-10-07 00:00:00+0500",
"date_to": "2026-10-08 00:00:00+0500",
"limit": 100
}
Response
The first message acknowledges the request:
{
"cmd": "get_data_resp",
"operation_id": "abc",
"status": 1
}
The second one carries the data:
| Field | Type | Description |
|---|---|---|
cmd | string | get_data_resp |
operation_id | string | Value from the request |
status | uint8 | 1 — request accepted, 3 — data, 2 — error |
dataCount | uint32 | Number of packets in the list |
dataList | array | Packets; their fields are in the table below |
error_code, error_text | uint8, string | Only on error, see below |
Packet fields in dataList:
| Field | Type | Description |
|---|---|---|
id | uint64 | Database record number |
devEui, devAddr | string | The device |
appId | string | Identifier of the device's application (APP_ID) |
time | string | Reception time, UTC |
fport | uint8 | Application port |
data | string | Payload in hex |
size | uint16 | Packet size, bytes |
fcnt | uint32 | Device uplink counter |
mtype | uint8 | LoRaWAN message type: 2 — unconfirmed, 4 — confirmed |
adr | bool | The device has ADR enabled |
ack | bool | The server does not fill this field |
fopts | string | MAC commands in the packet header, hex |
datr | uint8 | Data rate index (DR) |
freq | float | Frequency, MHz |
rssi | int16 | Signal strength, dBm |
lsnr | float | Signal-to-noise ratio, dB |
gatewayEui | string | The gateway the packet was recorded from |
gateway_available | object | All gateways that received the packet: gateway EUI → string [SNR, RSSI] |
packet_loss_rate | float | Device packet loss estimated by the server, % |
output_ack, output_ack_time | bool, string | Obsolete fields; the server does not populate them |
{
"cmd": "get_data_resp",
"operation_id": "abc",
"status": 3,
"dataCount": 1,
"dataList": [
{
"id": 4671384,
"devEui": "7950D20CBBB77561",
"devAddr": "7950D20C",
"appId": "77179F01",
"time": "2026-10-07 13:06:22+0000",
"fport": 2,
"data": "7713F800020F010AA78D0014360100150B0000",
"size": 32,
"fcnt": 7525,
"mtype": 2,
"adr": true,
"ack": false,
"fopts": "",
"datr": 4,
"freq": 865.1,
"rssi": -100,
"lsnr": 6.2,
"gatewayEui": "0000B827EB76A75F",
"gateway_available": {
"0000B827EB76A75F": "[6.2, -100]"
},
"packet_loss_rate": 0,
"output_ack": false,
"output_ack_time": null
}
]
}
Errors
error_code | error_text | What happened |
|---|---|---|
| 3 | Invalid date range | date_from or date_to is missing |
| 1 | Date parse error | A date could not be parsed |
On error a single message with status: 2 arrives, without the acknowledgement.
Good to know
- Specify the time zone in dates (
+0500,+0000). Times in the response are UTC. - No more than 500 packets per request. For a long period, request the data in parts: start the next request from the time of the last received packet — it arrives again, so drop it by
id. - The server does not use the
devAddrrequest field for filtering — filter bydevEui. - The result contains only uplinks. Frames sent to devices are returned by
get_downlink_data_req.
See also
consume_req— receive data in real time.get_downlink_data_req— history of sent frames.