Skip to main content
Nexalis Cloud exposes a powerful real-time API which allows users to query and fetch high-frequency sensor data using WarpScript, a stack-based language designed for time-series analysis.

Quick Start Examples

  • Nexalis Macros - Learn how to use Nexalis custom macros for simplified queries
  • Python Examples - Integrate the API into your Python data pipelines
  • PowerBI Connector (beta) - Browse and load time series in Power BI, no WarpScript required
  • Grafana Plugin (beta) - Query Nexalis from Grafana dashboards, no WarpScript required

API Endpoint

The Nexalis real-time API is accessible via your dedicated endpoint:
Replace yourcompany with your organization’s name. All requests must be sent via HTTP POST with WarpScript code in the request body.

Authentication

All API requests require authentication using a READ token.
Contact contact@nexalis.io to obtain your READ token.

Data Structure

A tag is stored as a Geo Time Series (GTS). Each GTS is uniquely identified across all your data with its labels, namely:
  • siteName - site where the device is located
  • deviceModel - manufacturer and model
  • deviceID - unique identifier of the device
  • dataPoint - device‑specific identifier (e.g., Modbus register, OPC UA tag)
Each GTS also has attributes which add context and describe a tag, such as:
  • description - manufacturer‑provided description
  • protocol - communication protocol used

Standardized Tags

Nexalis standardizes some tags by contextualizing and translating them to the Nexalis data model, which is based on IEC 61850. Standardized tags will have additional attribute columns:
  • assetType - standardized device type (e.g., Solar inverter, Storage inverter, Meteo station, Meter, Wind turbine, etc.)
  • subDeviceID - distinguishes devices when connected via proxy/gateway
  • logicalNode - standardized function type (e.g., MMDC: DC Measurements)
  • dataObject - standardized tag (e.g., PhV: phase voltage)
  • subDataObject - finer breakdown (e.g., phsA: phase A)
  • engUnits - standardized engineering units
  • multiplier - scaling multiplier for unit conversion (from scada unit to Nexalis engUnits)
  • adder - scaling offset for unit conversion (from scada unit to Nexalis engUnits)
  • measurementType - Analog or Discrete
Values are stored raw, exactly as sent by the data source. multiplier and adder are what convert them into engUnits, and that conversion is not applied automatically - see FETCH below.
Field Availability: Nexalis API only returns non-empty labels and attributes. While labels are always present for identification, standardized attributes (such as assetType, logicalNode, dataObject) are only included for tags that have been mapped to the Nexalis data model. Additionally, unit-related attributes (engUnits, adder, multiplier) are typically omitted for discrete measurement types, as these data points generally do not have a unit.

Core Query Functions

The API uses WarpScript, a stack-based language for time-series operations. Two main functions are available:

FIND - Discover Available Metrics

Search for time-series matching specific criteria without fetching values. Useful for exploring what data is available. Example query:
Output:
FIND returns class ("c":{...}), labels ("l":{...}), attributes ("a":{...}), and an empty value field ("v":[]). How to do it in python

FETCH - Retrieve Time-Series Data

Fetch actual values for specific time ranges and metrics. Example query:
Output:
Here, each sub-list in the “v” (value) field is a measurement, where the first element is the microseconds unix timestamp, and the last element is the actual value.
FETCH returns raw, unscaled values. Values are stored exactly as the data source sent them. The multiplier and adder attributes convert them into the units named in engUnits, and FETCH does not apply that conversion. In the output above the dataPoint carries "multiplier":"0.1" and "engUnits":"kW", so the raw value 348 is 34.8 kW, not 348 kW. Reading a FETCH result as though it were already in engUnits overstates it by the multiplier.
Apply the conversion with @nexalis/scale:
The @nexalis/fetch_trapezoidal_averages and @nexalis/fetch_bucketized macros already scale their output - they call @nexalis/scale internally unless you pass 'scaling' false. A plain FETCH is the only query path that returns unscaled values, so mixing raw FETCH results with macro results in the same report gives readings that differ by the multiplier. And because @nexalis/scale is not idempotent, never apply it on top of a macro result.
How to do it in python
Both FIND and FETCH functions support:
  • Regular expressions for pattern matching (prefix with ~)
  • Multiple filters on labels and attributes (both passed in the “labels” field)
Additionally, FETCH supports:
  • Flexible time ranges with ISO8601 strings or microseconds unix time

Best Practices

FIND first, then FETCH per tag

When querying multiple tags, always discover before you fetch:
  1. Use FIND with label filters to get the list of matching tags and their exact identifiers
  2. FETCH each tag individually using deviceID + dataPoint from the FIND results
This pattern keeps each request small and predictable. If a single tag fails, the others are unaffected. For concurrent fetching, wrap the loop in a ThreadPoolExecutor.

Go deep, not wide

Timeseries databases are optimized for long reads on a single tag. One tag over a long period is always faster than many tags at once.

Filter as specifically as possible

Every label you add reduces the number of series the API needs to scan. Always include siteName when targeting a specific site, and add deviceID or dataPoint when you know them.

Nexalis Custom Macros

Nexalis provides ready-to-use macros that simplify common time-series operations:
  • @nexalis/scale - Apply unit conversions and calibrations
  • @nexalis/fetch_trapezoidal_averages - Fetch and compute trapezoidal averages for irregularly-sampled data
For detailed examples of using these macros, see the Nexalis Macros guide.

Custom Macros

You can also build your own WarpScript macros to encapsulate complex logic and reuse common query patterns across your organization.

Filtering Data

The labels parameter in both FIND and FETCH queries accepts filters on both labels and attributes, allowing you to precisely target the data you need.

Basic Filtering

Filter by exact matches on any label or attribute field:

Regular Expression Filtering

Prefix filter values with ~ to use regular expressions for pattern matching:

Common Regex Patterns

Remember to escape special regex characters when needed. The tilde (~) prefix indicates that the value should be interpreted as a regular expression rather than an exact string match.

API Integration

The Nexalis real-time API can be queried from any tool or programming language that supports HTTP requests. Simply send a POST request with:
  • URL: Your endpoint (https://yourcompany.app.nexalis.io/api/v0/exec)
  • Headers: X-Warp10-Token: YOUR_READ_TOKEN
  • Body: WarpScript code (plain text)
This works seamlessly with cURL, Python, PowerBI, and any other HTTP-capable tool. Nexalis also provides ready-made integrations that wrap these calls for you: the Grafana plugin and the Excel add-in.

Learn More

For API access and support, contact contact@nexalis.io