Using the portal

Data API

Reference for GET /v1/data — query parameters, authentication, and examples.

Programmatic access to PermaSense time series uses the backend data endpoint. The Download page builds the same request interactively; use this page as the full reference.

Endpoint

GET /v1/data

By default the response format is chosen automatically (see forceType below). Forced csv returns streaming CSV (text/csv) with a header row; forced json returns JSON. Validation and not-found errors respond as JSON {"error":"..."} with status 400 or 404.

Replace {backend_base_url} with your backend base URL (no trailing slash).

Critical: binary and image fields (auto mode)

When forceType is omitted: if fields selects exactly one binary column (e.g. gps_raw_data), the response is the raw concatenated binary payload; if fields selects exactly one image-path column, the response is a ZIP of the files; otherwise the response is CSV. In CSV, binary columns are encoded as Base64. Set forceType=csv or forceType=json to override and keep a tabular response.

Query parameters

ParameterRequiredNotes
deploymentyesDeployment name (not ID).
vsensoryesShort virtual-sensor name, or fully prefixed table name.
fromnoLower bound, inclusive. UTC as yyyy-MM-dd or yyyy-MM-dd'T'HH:mm:ss.
tonoUpper bound, exclusive. Same format as from. Must be after from when both are set.
positionschema-dependent¹Filter by position id, or * for all positions. Mutually exclusive with positionLabel. When *, the CSV includes position (and device_id when present).
positionLabelschema-dependent¹Filter by position label (resolved via label mapping). Mutually exclusive with position.
deviceschema-dependent¹Filter by device id, or * for all devices (device-only sensors). Optional extra filter when a position column also exists. When *, the CSV includes device_id.
resolutionno60m (default, derived hourly view) or raw.
forceTypenoOverride response format: csv, json, binary, or zip. Omit for the smart default (ZIP for a single image-path column, binary for a single binary column, otherwise CSV).
fieldsnoRepeatable query param to select a subset of columns.
limitnoMaximum number of rows to return.

¹ Schema-dependent: required based on the virtual sensor table. Sensors with a position column need position, position=*, or positionLabel. Sensors without a position column need device or device=*. Use the Download form to see which filter applies and which values are available.

Terminal clients like curl are sessionless by default — they do not use your browser login. The virtual sensor must be enabled for public download, otherwise the request is denied. For private sensors, add -H 'Authorization: Bearer <token>'.

Authentication

Public virtual sensors (download enabled by an admin) can be requested anonymously — no credentials required. This is required for sessionless clients such as curl. For any other sensor, send a JWT as Authorization: Bearer <token>. Obtain a token from the backend login endpoint.

Examples

curl

curl '{backend_base_url}/v1/data
  ?deployment=mydep
  &vsensor=humidity
  &from=2026-01-01T00:00:00
  &to=2026-02-01T00:00:00
  &position=91
'

Python notebook

Load the CSV into a pandas DataFrame with requests:

import io
import pandas as pd
import requests

base = "{backend_base_url}"
params = {
    "deployment": "mydep",
    "vsensor": "humidity",
    "from": "2026-01-01T00:00:00",
    "to": "2026-02-01T00:00:00",
    "position": "91",
}
r = requests.get(f"{base}/v1/data", params=params, timeout=120)
r.raise_for_status()
df = pd.read_csv(io.StringIO(r.text))

For non-public sensors, pass headers={"Authorization": "Bearer <token>"} to requests.get.

  • Download data — UI for building the same request and opening the interactive API drawer
UIBK