Readings
The Reading API lets you get readings data from the network. You can read data from any Asset object in the network using its readings
property.
Return value
These values of type AssetReadings are automatically refreshed every few minutes and contain the readings for the current network time sampled with a 15 minute resolution.
Examples
Query methods
forPeriod()
Returns the cached readings in the current 24 hour period.
Method signature
Parameters
None.
Returns
Return type is AssetReadingsCollection. An array with the readings cached in the 24 hour period, sampled with a 15 minute resolution.
latest()
Retrieves the latest reading for an asset.
Method signature
Parameters
None.
Returns
A promise that will resolve when the latest available readings are available in an AssetReadings object.
Examples
forRange()
Retrieves readings for an asset between two dates.
Method signature
Parameters
- start: Start date
- end: End date
Returns
A promise that will resolve when the readings are available in an AssetReadings object.
Examples
Get readings for 24 hours for an asset.