Get data
The ECB's euro reference rate for the US dollar, January 2024. The series is the call:
datumesh.com/relay/ecb.europa.eu/fx_reference(USD, *)
Each way below fetches the same cells, and each row carries its receipt.
Excel and Google Sheets take the CSV link; the test fetches that link nightly.
The Python and JavaScript libraries read and verify receipts today.
In a browser
datumesh.com/relay/ecb.europa.eu/fx_reference(USD, *)
Verify a receipt: every value on the page is the cell of its day; this checks 2 January:
from datumesh import fetch_keys, verify; import json, urllib.request; r = json.load(urllib.request.urlopen("https://datumesh.com/cell/datumesh.com/relay/ecb.europa.eu/fx_reference(USD,2024-01-02)"))["receipt"]; print(verify(r, fetch_keys("datumesh.com")).ok)
Excel
datumesh.com/relay/ecb.europa.eu/fx_reference(USD, *)
Excel: Data โ Get Data โ From Web โ https://datumesh.com/x/interval/datumesh.com/relay/ecb.europa.eu/fx_reference?currency=USD&from=2024-01-01&to=2024-01-31&format=csv
Verify a receipt: take the hash from the receipt column of the row, then run:
from datumesh import fetch_keys, verify; import json, urllib.request; print(verify(json.load(urllib.request.urlopen("https://datumesh.com/receipt/a6ff1944afe27dbcfddd00a29976b9e81a2dcc5c0a87b95ea939c7fa923ed33e")), fetch_keys("datumesh.com")).ok)
Google Sheets
datumesh.com/relay/ecb.europa.eu/fx_reference(USD, *)
=IMPORTDATA("https://datumesh.com/x/interval/datumesh.com/relay/ecb.europa.eu/fx_reference?currency=USD&from=2024-01-01&to=2024-01-31&format=csv")
Verify a receipt: take the hash from the receipt column of the row, then run:
from datumesh import fetch_keys, verify; import json, urllib.request; print(verify(json.load(urllib.request.urlopen("https://datumesh.com/receipt/a6ff1944afe27dbcfddd00a29976b9e81a2dcc5c0a87b95ea939c7fa923ed33e")), fetch_keys("datumesh.com")).ok)
pandas
datumesh.com/relay/ecb.europa.eu/fx_reference(USD, *)
pd.read_csv("https://datumesh.com/x/interval/datumesh.com/relay/ecb.europa.eu/fx_reference?currency=USD&from=2024-01-01&to=2024-01-31&format=csv")
import json
import urllib.request
import pandas as pd
from datumesh import fetch_keys, verify
df = pd.read_csv("https://datumesh.com/x/interval/datumesh.com/relay/ecb.europa.eu/fx_reference?currency=USD&from=2024-01-01&to=2024-01-31&format=csv")
print(df["date"][0], df["value"][0])
receipt = json.load(urllib.request.urlopen("https://datumesh.com/receipt/" + df["receipt"][0]))
result = verify(receipt, fetch_keys("datumesh.com"))
print(result.ok, result.level)
2024-01-02 1.0956
True signed
Verify a receipt: the code above checks the receipt of the first row against the mesh's keys.
curl
datumesh.com/relay/ecb.europa.eu/fx_reference(USD, *)
curl -s "https://datumesh.com/x/interval/datumesh.com/relay/ecb.europa.eu/fx_reference?currency=USD&from=2024-01-01&to=2024-01-31&format=csv"
date,value,receipt
2024-01-02,1.0956,a6ff1944afe27dbcfddd00a29976b9e81a2dcc5c0a87b95ea939c7fa923ed33e
Verify a receipt: take the hash from the receipt column of the row, then run:
from datumesh import fetch_keys, verify; import json, urllib.request; print(verify(json.load(urllib.request.urlopen("https://datumesh.com/receipt/a6ff1944afe27dbcfddd00a29976b9e81a2dcc5c0a87b95ea939c7fa923ed33e")), fetch_keys("datumesh.com")).ok)
JavaScript
datumesh.com/relay/ecb.europa.eu/fx_reference(USD, *)
import { fetchKeys, verify } from "@datumesh/verify";
const { members } = await (await fetch("https://datumesh.com/x/interval/datumesh.com/relay/ecb.europa.eu/fx_reference?currency=USD&from=2024-01-01&to=2024-01-31")).json();
const r = verify(members[0].receipt, await fetchKeys("datumesh.com"));
console.log(members.length, members[0].value, r.ok, r.level);
22 1.0956 true signed
Verify a receipt: the code above checks the receipt of the first day against the mesh's keys.