Skip to main content

Library Records

Query library records by dataset, key prefix, and date in force, and upsert up to 2000 records with their source URL and quote through /v1/data-library/records.

GET /v1/data-library/records returns the records of the shared library and of the workspace's own datasets, ordered by dataset key, record key and start date. Three filters narrow the read. dataset matches one dataset key exactly. prefix matches the start of the dataset key, which reads a whole family such as every dataset under one prefix, and record matches the start of the record key. %, _ and \ in prefix and record match literally, so a key containing an underscore is found by that underscore and not by any character.

on keeps the records in force on a date: a record is returned when its valid_from is empty or not after that date, and its valid_to is empty or not before it. An open end therefore always matches. A value that is not YYYY-MM-DD is ignored, and the read behaves as if on were absent. limit defaults to 1000 and is clamped to 1 through 5000. Each record carries shared, its dataset and record key, the free-form attributes, its validity period, source_url, quote and retrieved_at.

GET/v1/data-library/records

Query parameters

datasetstringExact dataset key.
prefixstringDataset key prefix. %, _ and \ match literally.
recordstringRecord key prefix. %, _ and \ match literally.
onstring (date)Keeps records whose validity period contains this date. A value that is not YYYY-MM-DD is ignored.
limitintegerMaximum records, clamped to 1 through 5000. Default: 1000

Record fields

iduuidRecord id.
sharedbooleanTrue for a record of the shared library.
dataset_key, record_keystringWhere the record lives.
attributesobjectThe record's values. The shape depends on the dataset's record schema; free-form for a manual dataset.
valid_from, valid_tostring (date) | nullThe period in force. An open end is null.
source_urlstring | nullWhere the value was published.
quotestring | nullThe publisher's own wording that states the record.
retrieved_atdate-timeWhen the record was last stored or refreshed.

cURL: Read a dataset family for a date

curl "https://api.talonic.com/v1/data-library/records?prefix=acme.&on=2026-03-15&limit=200" \
  -H "Authorization: Bearer $TALONIC_API_KEY"

Add or Replace Records

POST /v1/data-library/records stores up to 2000 records under one dataset for the workspace of the key and answers 201 with the number stored. A record with the same record key and valid_from as a stored record of the workspace replaces it, including its attributes, validity end, source and quote. A record whose valid_from differs is stored next to it as another period. Entries with an empty record_key are skipped and not counted in stored. valid_from and valid_to must be YYYY-MM-DD or null; any other format is refused.

Keep the source on every record. source_url and quote are what let a reader of the library, or an app that prices against it, verify a value against the publisher. The quote is the publisher's own wording, up to 4000 characters, copied from the document. A body with more than 2000 records, a record without record_key or attributes, or a malformed field is refused with 400 before anything is stored.

POST/v1/data-library/records

Body fields

dataset*stringThe dataset key the records belong to.
records*object[]Up to 2000 records.
records[].record_key*stringIdentifies the record within the dataset, up to 300 characters. An empty key is skipped.
records[].attributes*objectThe record's values.
records[].valid_fromstring (date) | nullFirst day in force, YYYY-MM-DD. Part of the record's identity.
records[].valid_tostring (date) | nullLast day in force, YYYY-MM-DD. Null for an open end.
records[].source_urlstring | nullWhere the value was published, up to 2000 characters.
records[].quotestring | nullThe publisher's own wording that states the record, up to 4000 characters.

cURL: Replace one period, add the next

curl -X POST "https://api.talonic.com/v1/data-library/records" \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "dataset": "acme.heat-tariff",
    "records": [
      { "record_key": "base-price", "attributes": { "eur_per_mwh": 98.4 }, "valid_from": "2026-01-01", "valid_to": "2026-12-31", "source_url": "https://example.com/tariffs/heat-2026.pdf", "quote": "Arbeitspreis 98,40 EUR/MWh" },
      { "record_key": "base-price", "attributes": { "eur_per_mwh": 101.2 }, "valid_from": "2027-01-01", "source_url": "https://example.com/tariffs/heat-2027.pdf", "quote": "Arbeitspreis 101,20 EUR/MWh" }
    ]
  }'

Response: 201

{ "data": { "stored": 2 } }
Records written here belong to the workspace of the key. Posting records under a dataset key does not create the dataset: define it first with POST /v1/data-library/datasets so its label, publisher and licence travel with the records, and so the dataset appears in the dataset list.

Frequently asked questions

How do I read the value that was valid on a given day?+
Pass on=YYYY-MM-DD. A record is returned when its valid_from is empty or not after that date and its valid_to is empty or not before it, so an open-ended record always matches. A value that is not a date is ignored and the read returns every period.
Why did a record I posted not count in stored?+
Entries with an empty record_key are skipped and not counted. The remaining records are stored, and stored is the number written, so compare it with the number of records you sent to find skipped entries.
What identifies a record?+
Dataset, record key and valid_from together, within the workspace. Posting the same combination again replaces the record; posting the same record key with another valid_from adds another period of it.
Can a prefix search match underscores or percent signs literally?+
Yes. In prefix and record, the characters %, _ and backslash match themselves, not as wildcards, so a key such as grid_fee is found by exactly that text.