clj-midas 1.0.0 tracks the California Energy Commission's MIDAS v2.0 API (live 2026-06-22), a breaking change. v1.0 was removed from the live service that day, so 1.0.0 is a v2-only release — there is no v1.0 compatibility mode. This guide is what a v0.x/v1.0 consumer needs to upgrade.
clj-midas is a read-only consumer client. In v2.0 all public GET endpoints are unauthenticated, so you need no credentials — just (create-anonymous-client). The authenticated constructors (create-client / create-auto-client) exist only for utilities that upload rate data to the CEC; that path requires CEC-issued utility credentials and is not exercised by this project.
| v1.0 | v2.0 | What you do |
|---|---|---|
| Token required for reads | GET endpoints are unauthenticated | Use (create-anonymous-client) — no username/password |
| RIN list is a bare array | Keyed object, always { "Rates": [...] } (regardless of SignalType) | Nothing — entities/rin-list peels it for you |
| Lookup table is a bare array | Keyed object { "table_name": …, "data": [...] } | Nothing — entities/lookup-table peels :data for you |
Interval price field value | Value (capital V) | Nothing — coercion follows |
RateType long-form only | Electricity rates send the short UploadCode ("TOU"); GHG/Flex send the long Description | Nothing — rate-type-kw keys on both |
GHG in kg/kWh CO2 | g/kWh CO2 (values 1000× larger) | Recompute any cross-boundary comparisons; :midas.unit/g-co2-per-kwh is the new unit |
GHG/Flex SignalType was null | Always populated (long-form labels) | Nothing — signal-type-kw recognises them |
ValueInformation bare datetimes were PT for some signals | UTC for every signal type | Read :tick/beginning / :tick/end (zone-aware); the zone-naive :midas.value/date-start/-end/time-* keys are removed |
LastUpdated was a bare wall-clock string | Carries a basic-format UTC offset, e.g. "…+0000" | Nothing — parsing accepts +0000, +00:00, and Z |
GET /HistoricalData?id= (query) | GET /HistoricalData/{rate_id} (path), 6-month max range per call | Nothing — get-historical-data signature is unchanged: (get-historical-data client rin startdate enddate) |
GET /HistoricalList | Removed | Use (entities/rin-list (get-rin-list client 0)) for the full active RIN list |
GET /Holiday (get-holidays) | Retired (absent from the CEC's published OpenAPI) | Remove any get-holidays calls. The 8=Holiday day-type value in rate schedules is unaffected |
USCA-SGIP-MOER-{REGION} RINs (the old BANC region code is now P2), and Flex Alerts into the single USCA-FLEX-ALRT-0000. Legacy RINs are retired.MOER RIN returns no data before 2026-06-22. The canonical source for older GHG history is the SGIP Signal bulk CSV (content.sgipsignal.com/download-data) or the WattTime API. Electricity-rate and Flex Alert history are unaffected.07:00:00 UTC during PDT, 08:00:00 during PST); clj-midas re-expresses them in the client zone (default America/Los_Angeles), DST-correct.The release-day smoke-test surfaced four places where the live v2.0 API diverges from the reverse-engineered midas-api-specs; each is filed upstream and handled defensively in clj-midas:
Rates, not keyed by signal type (midas-api-specs#2).RateType is the UploadCode short code for electricity rates (midas-api-specs#1).{table_name, data} objects, not bare arrays (midas-api-specs#3).LastUpdated is a basic-offset UTC timestamp (+0000) (midas-api-specs#4).midas-api-specs/doc/v2-migration.mdmidas-api-specs/doc/datetime-and-timezone.mdmidas-api-specs/doc/rin-structure.mdmidas-api-specs/doc/flex-alerts.mdCan you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |