The FrostSmart API gives you programmatic access to your cloud-stored data. This article covers what you need to know to get oriented and make your first successful query. For the full endpoint reference, see the attached PDF.
Data Model
Before querying data it helps to understand how FrostSmart structures it. The physical hardware layer consists of three elements:
- Units are the gateways that communicate data into the cloud
- Radios are transceivers attached to units, connected to one or more sensors
- Sensors collect the data, reporting one or more streams depending on their type
This hardware sits within an organisational structure of Sites (farms, orchards, vineyards etc.), divided into Areas, which can be further broken down into Sections such as irrigation zones or frost fan coverage areas.
Authentication
Access to the API requires authentication via a two-step process, though these can be combined into a single call for convenience.
You POST your credentials to /user/login with includeCredentials: true, which returns both a user token (valid for 24 hours) and session credentials in one step. All subsequent API requests must then be signed using those credentials, following the AWS Signature Version 4 process.
Code examples showing the full authentication flow are available in the getting started examples below.
Querying Metrics
Metrics are the core of what you'll be querying. Each query specifies a time range and one or more metrics, where each metric can include:
- A name (retrieve available metric names via /metrics/list)
- A filter to target specific sites, areas, units, or sensors
- A grouping to organise results by a specific object type
- An aggregator to summarise the data — supported options are avg, min, max, first, last, sum, and count. If you omit the aggregator, raw data is returned.
Time ranges can be specified either as relative values (e.g. "the last 2 weeks") or as absolute epoch timestamps.
Getting Started
The quickest way to get up and running is via the example projects, which walk through authentication, discovering available sensors and units, and making your first metric query:
Node.js: https://bitbucket.org/loncel/api-js-example
Python: https://bitbucket.org/loncel/api-python-example
For endpoint details, parameters, and response formats, refer to the attached API reference.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article