What the marketplaces say each machine earned, by day
const url = 'https://api.flotera.com/api/v1/marketplaces/earnings?days=7';const options = { method: 'GET', headers: {cookie: '__Host-erm_session=<__Host-erm_session>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.flotera.com/api/v1/marketplaces/earnings?days=7' \ --cookie __Host-erm_session=<__Host-erm_session>One row per machine, marketplace and UTC day, carrying the platform’s own rolling 24-hour figure as of the last sample of that day.
This is not a ledger and not the money contour. It is somebody else’s number, recorded as reported; Ermeon’s own money lives in billing and is computed differently. Because the platform’s window rolls, a sum over several days is an estimate, and any total built from these rows must be labelled as coming from the marketplace.
samples says how many times the day was sampled. A day sampled once
at noon describes half a day.
collected_since is the earliest day on record, and null when there is
none. Without it an empty chart is unreadable: “earned nothing” and
“not recorded yet” both render as blank space and lead opposite ways.
accrued_since is the earliest day the accrual itself ran. A row is
also written by the platform-report path, which predates the accrual,
so a row does not mean the day was watched — accrued_seconds does.
A reader that draws price × time must date and mark it by this field,
or it will report an unmeasured day as a measured zero.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Window length in days, inclusive of today.
Responses
Section titled “Responses”Daily earnings as reported by the marketplaces.
object
One machine, one marketplace, one UTC day — carrying TWO different sums. They are not interchangeable and must never be added together.
object
Supported marketplace. The database constrains the same two values, so a third one is a migration rather than a new string.
What the platform itself reported for the day, AFTER its cut. Null when the platform said nothing; Clore publishes no such report at all, so this stays null there forever.
Our own count: the price of the running deals multiplied by the time they ran, BEFORE the platform’s cut. Computed identically on both marketplaces — a fleet total must be summed from this field, because the field beside it means one thing on Vast and nothing on Clore. The difference between the two is the platform’s cut plus downtime we did not observe.
Rented seconds behind earn_usd_accrued. Without it $0.05 over a day and $0.05 over an hour read the same.
Seconds of a KNOWN-RUNNING rental that could not be counted because sync stayed silent past its cap. Non-zero means earn_usd_accrued is understated by exactly this much time.
How many times this day was sampled.
WHICH CURRENCIES the accrual arrived in, and what they were worth at the moment we accrued them. Empty for two DIFFERENT kinds of day, told apart by earn_usd_accrued: an idle day has zero (no deals, so no currency), a day accrued before the breakdown existed has a non-zero sum (there was a currency, we just did not write it down). The second cannot be re-priced at any rate, and showing it as zero coins would erase money that was earned.
What one deal currency brought in over one day.
object
The marketplace’s own spelling — the same string the commission rate is keyed by.
Coins. A MEASUREMENT: no rate went into it and it will never change. Twelve decimals because a two-minute slice of a bitcoin rental is smaller than a satoshi.
The same money at THE RATE OF THE MOMENT WE ACCRUED IT. “What we earned then” and “what it is worth now” are different questions; this answers the first, and amount with a current rate answers the second.
Earliest day on record; null when nothing has been recorded. Tells “earned nothing” apart from “not recorded yet”.
Earliest day our own accrual actually ran (accrued_seconds > 0); null when it never has. Not the same as collected_since: a row is also created by the platform’s report, a path older than the accrual, and those days carry accrued_seconds = 0. Charting price × time and dating it by collected_since declares days watched that the accrual never saw.
Marketplace rates AS OF NOW, so the screen can answer “what is the earned money worth today”. A different number from usd inside the breakdown, which froze the rate of the accrual moment. A currency absent here is not converted at all: substituting someone else’s rate is the same as inventing money.
What one coin is worth in dollars RIGHT NOW, as the marketplace itself prices it. Not an exchange quote: this is the rate the platform uses to price the machine, and disagreeing with it would show the owner numbers their own dashboard does not have.
object
Supported marketplace. The database constrains the same two values, so a third one is a migration rather than a new string.
When the snapshot carrying this rate was taken. Null for the dollar: nobody observes it, a dollar is a dollar.
Example
{ "items": [ { "marketplace": "vast", "earn_usd_accrued": "12.340000", "by_currency": [ { "currency": "CLORE-Blockchain", "amount": "10.750000000000", "usd": "0.100000" } ] } ], "current_rates": [ { "marketplace": "vast", "currency": "bitcoin", "usd_per_coin": "63771.469876789735" } ]}Missing/invalid credentials (code=unauthorized).
RFC 9457 problem document with a stable machine code.
object
Stable machine-readable error code (03 §2.4).
UUID (v7 for new entities; v4 accepted during migration).
object
JSON Pointer to the offending field.
Example
{ "type": "https://ermeon.com/problems/validation", "code": "unauthorized"}Authenticated but not permitted. code=forbidden — role/scope mismatch; code=feature_not_entitled — the plan does not include the capability; code=account_frozen — the account is frozen and this operation is declared x-ermeon-frozen: deny. The three are deliberately distinct: only the last one is fixed by a top-up (13 §5.6).
RFC 9457 problem document with a stable machine code.
object
Stable machine-readable error code (03 §2.4).
UUID (v7 for new entities; v4 accepted during migration).
object
JSON Pointer to the offending field.
Example
{ "type": "https://ermeon.com/problems/validation", "code": "unauthorized"}Request failed validation (code=validation_failed), with per-field errors.
RFC 9457 problem document with a stable machine code.
object
Stable machine-readable error code (03 §2.4).
UUID (v7 for new entities; v4 accepted during migration).
object
JSON Pointer to the offending field.
Example
{ "type": "https://ermeon.com/problems/validation", "code": "unauthorized"}A dependency the endpoint needs is not configured or is temporarily unavailable (code=unavailable). The rest of the API keeps working — an absent external integration must not take the service down.
RFC 9457 problem document with a stable machine code.
object
Stable machine-readable error code (03 §2.4).
UUID (v7 for new entities; v4 accepted during migration).
object
JSON Pointer to the offending field.
Example
{ "type": "https://ermeon.com/problems/validation", "code": "unauthorized"}