API

Ursel has an authenticated REST API. Your own systems send metered data to it; the registry records each submission with a hash, a timestamp and a stated source. This page describes what exists today and what does not.

What exists today

  • An authenticated REST API at https://ursel-api.onrender.com.
  • Machine credentials: your organisation is issued a client id and secret by the registry operator, which you exchange for a token.
  • Tokens last one hour.
  • Readings are pushed by you. The registry does not read your hardware yet — see “Two ways data gets in” below.

Getting a token

Send your client id and secret as JSON to the auth server. The response carries access_token, which you put in an Authorization: Bearer header on every API call.

{
  "POST": "https://ursel-oauth-jwt-server.onrender.com/token",
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {
    "client_id": "<YOUR_CLIENT_ID>",
    "client_secret": "<YOUR_CLIENT_SECRET>"
  }
}

The token endpoint allows five requests per thirty minutes. That limit is on the auth server, not on the API, so cache the token for its full hour and reuse it. A sender that requests a token per call will be rate-limited within minutes.

Two ways data gets in

Push, available now. Your system sends readings to the API — automatically, round the clock, with nobody logging in. This is the normal route for hourly or continuous data.

Pull, not available yet. Ursel reads your registered hardware itself, by serial number, over protocols such as MQTT and Modbus. expected operational end December 2026.

The dashboard also has a form for typing a reading by hand. It is for setup, demonstrations and small sites. Nobody is expected to type in hourly or round-the-clock data.

Setting up your side

Both tracks — electricity and gas — follow the same workflow. What differs is the hardware and the record you send, which the table below sets out side by side.

The same for both tracks, in order

  1. Your organisation exists in the registry and its KYC is approved.
  2. Register the site, the asset, and each device by serial number. Registration comes first in every case; direct reading, when it arrives, will bind to the device record rather than replace it.
  3. The registry operator provisions a machine credential for your organisation and gives you the client id and secret. This is not self-service.
  4. Your system obtains a token and sends data. Every timestamp must state its time zone or offset — a timestamp with no zone is rejected rather than assumed.
  5. Set source truthfully on every record. It says how the row reached the registry. It is not a statement that the value is correct, and the registry does not treat it as one.

Ursel does not supply a client-side agent or installer. You or your integrator write a small sender — a scheduled script or service that reads from your system and calls the API. There is no download for this today.

Electrons and Molecules, side by side

 Electrons (RE)Molecules
Typical hardwareSmart meters, inverters, data loggers, SCADA or historian systems.Gas flow meters and flow computers, gas analysers or chromatographs, SCADA or historian systems.
Record you sendA meter reading: energy for one interval on one meter.A gas injection record: volume and composition for a period on one asset.
RoutePOST /v1/meter_readingsPOST /v1/molecules/gas-injections
Required fieldsmeter_id, interval start and end, and one of energy_wh (preferred, whole Wh) or energy_mwh. Zero is a valid reading; negative is rejected.asset_id, volume_nm3, period start and end, and one of lhv_mj_per_nm3 (gas) or mass_kg (hydrogen).
What Ursel derivesenergy_mwh from energy_wh, and a content hash of the measurement.energy_kwh_lhv and energy_mwh_lhv from volume and heating value. Do not send them; they are computed.
BulkYes — POST /v1/meter_readings/bulk, 1 to 8,760 readings per request (a year of hourly values).Yes — POST /v1/molecules/gas-injections/bulk, 1 to 8,760 records per request. The same limit as the electricity track, so there is one number to remember rather than two.
Sending the same record twiceReturned to you, not stored again. You get 200 with outcome: "duplicate" and the reading already stored, including its original reading_id. Not 201, because nothing was created. On the bulk route the row reports duplicate with that same original id. Retrying the same record unchanged is safe, and safe in the same way on both routes. Re-sending the same interval with different values is refused as an overlap, because a stored reading cannot be corrected by sending it again.Returned to you, not stored again — identical to the electricity track: 200 with outcome: "duplicate" and the original record_id. Two records count as the same one when the asset, the period, the volume and the heating value or mass match; composition is deliberately not part of that, so re-sending with a corrected ch4_pct is the same quantity and will not create a second record. The stored record keeps its original composition: the correction is not applied, because a stored record cannot be corrected by sending it again.
Overlapping periodsNever stored. Two readings for one meter whose intervals overlap cannot both exist: the single route answers 409 OVERLAPPING_INTERVAL, and a bulk row reports rejected with that same reason. Intervals are half-open, so one ending exactly where the next begins does not overlap.Never stored, as on the electricity track — same 409, same OVERLAPPING_INTERVAL, same half-open periods. Scoped per asset: an asset is treated as one metering point for injections, so a site with two injection points needs two assets.
source valuesmanual, scada, iot, api, synthetic. Optional; if you omit it, nothing is recorded.manual, scada, iot, api — no synthetic. Required, and defaults to scada, so always set it explicitly or the record will say SCADA.
Correcting a recordNot possible. Records are immutable, and a corrected value for an interval already stored overlaps it and is rejected.Not possible. Records are immutable, and re-sending does not replace what is stored: an identical record returns the original unchanged, and one carrying different values for the same period is refused as an overlap.

One limit to design around

A record cannot be corrected after it is accepted. Records are immutable, and a corrected value for a period already stored overlaps that period and is rejected. In particular, a stored record cannot be corrected by sending it again: re-sending the same period with different values is refused as an overlap, not treated as a replacement. There is no correction or supersede procedure on either track. Send correct values the first time: validate at your end before sending, and do not send an estimate labelled actual — use estimated and send the measured value for a later interval instead.

Reading a bulk response

A bulk response now says what happened to every row. Alongside the inserted and skipped counts there is a results array with one entry per submitted row, carrying its index, its outcome — inserted, duplicate or rejected — an id where there is one, and a reason where it was rejected.

So skipped is no longer ambiguous: it counts the rows that were not stored, and results tells you which of those were harmless repeats and which were refused. A duplicate row hands back the id of the record you already have, so you do not need to read the stored data back to find it. What still deserves attention is a rejected row: that is a record contradicting one already stored, which usually means a problem at the sending end rather than a retry to repeat.

If you were previously told to send records one at a time in order to tell a duplicate from an overlap, you no longer need to: both routes, on both tracks, now report the same outcomes. Before 21 October 2026 the single route answered 409 for a repeat and the bulk route counted it silently, so a sender written against that behaviour will still work — a repeat is now a 200 rather than a 409, which is the one change to be aware of.

Worked example: Electrons

Every request and response below was sent to the running application and is what it actually returned. Identifiers are replaced with placeholders; values the registry sets per row are shown as <set by Ursel>. Add Authorization: Bearer <TOKEN> to each call.

One reading

POST https://ursel-api.onrender.com/v1/meter_readings

Energy in whole Wh. The interval carries an explicit offset. The response echoes what was stored and adds the registry's own fields.

Request

{
  "energy_wh": 125000,
  "interval_end": "2026-11-01T01:00:00+00:00",
  "interval_start": "2026-11-01T00:00:00+00:00",
  "meter_id": "11111111-2222-3333-4444-555555555555",
  "quality": "actual",
  "source": "scada"
}

Response · HTTP 201

{
  "asset_type": null,
  "created_at": "<set by Ursel>",
  "energy_mwh": 0.125,
  "energy_wh": 125000,
  "flow_type": null,
  "interval_end": "2026-11-01T01:00:00Z",
  "interval_start": "2026-11-01T00:00:00Z",
  "meter_id": "11111111-2222-3333-4444-555555555555",
  "outcome": "inserted",
  "quality": "actual",
  "reading_hash": "<set by Ursel>",
  "reading_id": "99999999-8888-7777-6666-555555555555",
  "source": "scada"
}

Many readings in one request

POST https://ursel-api.onrender.com/v1/meter_readings/bulk

Three consecutive hours. The response reports how many were stored and how many were not, and returns an id per stored reading.

Request

{
  "readings": [
    {
      "energy_wh": 118000,
      "interval_end": "2026-11-02T01:00:00+00:00",
      "interval_start": "2026-11-02T00:00:00+00:00",
      "meter_id": "11111111-2222-3333-4444-555555555555",
      "quality": "actual",
      "source": "scada"
    },
    {
      "energy_wh": 121500,
      "interval_end": "2026-11-02T02:00:00+00:00",
      "interval_start": "2026-11-02T01:00:00+00:00",
      "meter_id": "11111111-2222-3333-4444-555555555555",
      "quality": "actual",
      "source": "scada"
    },
    {
      "energy_wh": 0,
      "interval_end": "2026-11-02T03:00:00+00:00",
      "interval_start": "2026-11-02T02:00:00+00:00",
      "meter_id": "11111111-2222-3333-4444-555555555555",
      "quality": "actual",
      "source": "scada"
    }
  ]
}

Response · HTTP 201

{
  "inserted": 3,
  "reading_ids": [
    "99999999-8888-7777-6666-555555555551",
    "99999999-8888-7777-6666-555555555552",
    "99999999-8888-7777-6666-555555555553"
  ],
  "results": [
    {
      "index": 0,
      "outcome": "inserted",
      "reason": null,
      "record_id": "99999999-8888-7777-6666-555555555551"
    },
    {
      "index": 1,
      "outcome": "inserted",
      "reason": null,
      "record_id": "99999999-8888-7777-6666-555555555552"
    },
    {
      "index": 2,
      "outcome": "inserted",
      "reason": null,
      "record_id": "99999999-8888-7777-6666-555555555553"
    }
  ],
  "skipped": 0
}

Re-sending a reading you already sent

POST https://ursel-api.onrender.com/v1/meter_readings/bulk

The same reading again. It is not stored twice: the row reports outcome 'duplicate' and hands back the id of the reading already held, so a retry after a timeout is safe. The single-reading route answers the same input with 200 and the stored reading — the same answer, not a different one. Both tested, not assumed.

Request

{
  "readings": [
    {
      "energy_wh": 118000,
      "interval_end": "2026-11-02T01:00:00+00:00",
      "interval_start": "2026-11-02T00:00:00+00:00",
      "meter_id": "11111111-2222-3333-4444-555555555555",
      "quality": "actual",
      "source": "scada"
    }
  ]
}

Response · HTTP 201

{
  "inserted": 0,
  "reading_ids": [],
  "results": [
    {
      "index": 0,
      "outcome": "duplicate",
      "reason": null,
      "record_id": "99999999-8888-7777-6666-555555555551"
    }
  ],
  "skipped": 1
}

Worked example: Molecules

One gas injection record

POST https://ursel-api.onrender.com/v1/molecules/gas-injections

Volume and heating value are sent; the energy fields in the response are computed by the registry from them.

Request

{
  "asset_id": "MOLASSET-EXAMPLE00001",
  "ch4_pct": 62,
  "co2_pct": 36.5,
  "lhv_mj_per_nm3": 21.5,
  "period_end": "2026-11-30T23:59:59+00:00",
  "period_start": "2026-11-01T00:00:00+00:00",
  "pressure_bar": 4.5,
  "source": "scada",
  "temperature_c": 15,
  "volume_nm3": 86400
}

Response · HTTP 201

{
  "asset_id": "MOLASSET-EXAMPLE00001",
  "ch4_pct": 62,
  "co2_pct": 36.5,
  "created_at": "<set by Ursel>",
  "energy_kwh_lhv": 516000,
  "energy_mwh_lhv": 516,
  "h2_pct": null,
  "hhv_mj_per_nm3": null,
  "injection_point_id": null,
  "lhv_mj_per_nm3": 21.5,
  "mass_kg": null,
  "notes": null,
  "outcome": "inserted",
  "period_end": "2026-11-30T23:59:59Z",
  "period_start": "2026-11-01T00:00:00Z",
  "pressure_bar": 4.5,
  "record_id": "MOLINJ-EXAMPLE00001",
  "recorded_at": "<set by Ursel>",
  "source": "scada",
  "temperature_c": 15,
  "volume_nm3": 86400,
  "wobbe_index_mj_nm3": null
}

Many gas injection records in one request

POST https://ursel-api.onrender.com/v1/molecules/gas-injections/bulk

Two consecutive months. The second period starts exactly where the first ends and both are stored — half-open periods do not overlap. Each row reports its own outcome.

Request

{
  "injections": [
    {
      "asset_id": "MOLASSET-EXAMPLE00001",
      "lhv_mj_per_nm3": 21.5,
      "period_end": "2027-01-01T00:00:00+00:00",
      "period_start": "2026-12-01T00:00:00+00:00",
      "source": "scada",
      "volume_nm3": 2600000
    },
    {
      "asset_id": "MOLASSET-EXAMPLE00001",
      "lhv_mj_per_nm3": 21.4,
      "period_end": "2027-02-01T00:00:00+00:00",
      "period_start": "2027-01-01T00:00:00+00:00",
      "source": "scada",
      "volume_nm3": 2480000
    }
  ]
}

Response · HTTP 201

{
  "inserted": 2,
  "record_ids": [
    "MOLINJ-EXAMPLE00002",
    "MOLINJ-EXAMPLE00003"
  ],
  "results": [
    {
      "index": 0,
      "outcome": "inserted",
      "reason": null,
      "record_id": "MOLINJ-EXAMPLE00002"
    },
    {
      "index": 1,
      "outcome": "inserted",
      "reason": null,
      "record_id": "MOLINJ-EXAMPLE00003"
    }
  ],
  "skipped": 0
}

Pull: reading your hardware directly

Not available yet — expected operational end December 2026

Ursel reads registered devices itself over protocols such as MQTT and Modbus, recording the source of each reading. Registration by serial number stays the first step — direct reading binds to the device record, it does not replace it.

The shape below is expected and subject to change. Unlike every other example on this page it was written by hand, because the route does not exist yet and so nothing could generate it. Do not build against it.

{
  "_note": "EXPECTED SHAPE — not a working route. Subject to change.",
  "device_serial_number": "<AS REGISTERED>",
  "protocol": "modbus_tcp",
  "address": "<HOST:PORT AND REGISTER MAP>",
  "poll_interval_seconds": 900
}

Errors and limits

  • A bulk request takes between 1 and 8,760 records, on either track. More than that is rejected before anything is stored.
  • If any meter or asset in a bulk request is not yours, the whole request is rejected — METER_NOT_FOUND on the electricity track, ASSET_NOT_FOUND on the molecules track. Nothing is partially stored. It is whole-request rather than per-row on purpose: a per-row answer would let a caller discover which identifiers exist in other organisations one row at a time.
  • Periods are half-open: a record running to 01:00 and the next starting at 01:00 do not overlap, which is what continuous metering looks like. A record that genuinely overlaps one already stored is rejected with OVERLAPPING_INTERVAL.
  • On the molecules track the overlap rule is scoped per asset, so an asset is treated as one metering point for injections. A site with two injection points needs two assets for now.
  • A timestamp with no time zone or offset is rejected. So is an interval whose end is not after its start.
  • Negative energy is rejected. Zero is accepted: a becalmed hour is a real measurement.
  • Errors carry a machine-readable code alongside the message. Branch on the code, not on the wording.
  • Five token requests per thirty minutes, on the auth server. Cache your token.

Before you go live

  • Site, asset and every device registered, each with its serial number.
  • KYC approved, machine credential issued, token cached and refreshed before it expires.
  • Clocks synchronised, and every timestamp sent with an explicit zone.
  • source set explicitly on every record — especially on the Molecules track, where omitting it records SCADA.
  • Quality flag honest: actual only for measured values.
  • Your sender logs what it sent, reads back what was stored, and does not treat a skipped row as stored.
  • Values validated at your end, because a record cannot be corrected once accepted.

Where the comparison data comes from

Some checks compare your records against independently-sourced weather. Those sources require attribution, so Ursel states them here and repeats them in the result of every check that used them — a report written from Ursel’s output therefore carries its own attribution.

  • NASA POWER — the primary source for wind speed and solar irradiance. Data obtained from the NASA Langley Research Center Prediction Of Worldwide Energy Resources (POWER) project, funded through the NASA Earth Science Division. Licensed CC BY 4.0. Each result names the API version it used and the date it was retrieved.
  • Open-Meteo — used only for hours NASA POWER does not cover. Weather data by Open-Meteo.com, licensed CC BY 4.0. A result says how many of its hours came from here, so you can see which source a given comparison actually rested on.
  • ERA5, retrieved via Oikolab — used for solar checks only, and used differently from the two above: its reading does not feed the result. The result comes from NASA POWER, with Open-Meteo filling hours NASA does not cover; the ERA5 figure is computed over the same metered hours and reported beside it, so you can see whether a second, independent reanalysis agrees. Where only one source has data for a period, the result says which. Wind checks use NASA POWER only. ERA5 is a Copernicus Climate Change Service product, so a different notice applies to it than to the two above:Contains modified Copernicus Climate Change Service information [year of retrieval]. Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains.ERA5 data retrieved via Oikolab. Each result carries this notice with the actual year it retrieved the data.

Site coordinates leave Ursel. Site coordinates are sent to weather data providers (NASA POWER, Oikolab, and Open-Meteo where used) to retrieve weather data for checks. Oikolab keeps request records, including coordinates, for up to 30 days. Other providers apply their own terms.

Each check also records the exact response it used, so a comparison can be re-derived later rather than re-fetched and hoped to match.

This page is maintained alongside the API: the push examples are generated by calling the running application, and a check fails if they stop matching it. Curated reference documentation for the full API is in preparation. For a credential or an integration question, contact the registry operator.