# A price file

`v1/prices/<yyyy-mm-dd>.json` is one day's copy of AWS's public On-Demand prices for what LedgerMath measures: the records a versioned rule set selected from AWS's price lists, kept verbatim, added once and never edited.

## Where it is

- Address: `https://api.ledgermath.com/v1/prices/<yyyy-mm-dd>.json`, with the UTC date its fetch started; at most one for each day.
- Reached from: the table of contents (`prices.files[].url`; the newest, `prices.newest.url`).
- Links to: the versioned price list files of AWS it was cut from (`sources[].url`).
- A price is cited by the file's path, as the table of contents gives it (`prices.files[].path`), the SKU and the rate code: see [Prices](/docs/prices). The path is a name, not an address: the file is at the `url` the same entry gives.
- Schema: [Price file](https://api.ledgermath.com/v1/schemas/prices.schema.json), served by the API.

## What its schema says

<details>
<summary>A day's copy of what AWS publicly charges for what LedgerMath measures, kept at the path prices/&lt;yyyy&gt;/&lt;mm&gt;/&lt;dd&gt;/aws.json, under the UTC date it was fetched.</summary>

Added once, never edited. It holds the records the named rule set selected from AWS's Price List offer files, verbatim: each product and each set of On-Demand terms is AWS's own object, parsed and written back with nothing changed but the whitespace between tokens. Each source names the versioned URL its bytes came from, their size and SHA-256, so anyone can download the whole file and cut it again. A price is cited as this file's path, the SKU and the rate code. The root and LedgerMath's own objects are closed; AWS's objects are open, because they are AWS's words.

</details>

## Example

An excerpt, made by the generator, of the file at [https://api.ledgermath.com/v1/prices/2026-11-26.json](https://api.ledgermath.com/v1/prices/2026-11-26.json) (39,602 bytes) as LedgerMath's fixed sample took it on 2026-11-26; the file is never edited, so that address serves the same bytes.

```json
{
  "schema": "ledgermath.prices/1",
  "provider": "aws",
  "fetched_at": "2026-11-26T03:24:26.271Z",
  "measured": {
    "region": "us-east-2",
    "instance_types": ["c6i.8xlarge", "c8a.2xlarge", "c8i.2xlarge", "i4i.2xlarge", "m5.large"]
  },
  "rules": {"name": "ledgermath.aws-price-rules", "version": 1},
  "sources": [
    {
      "offer_code": "AmazonEC2",
      "url": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/20261124231417/us-east-2/index.json",
      "version": "20261124231417",
      "publication_date": "2026-11-24T23:14:17Z",
      "bytes": 441873144,
      "sha256": "sha256:c27cd9f3f192d37f27b4e02e9ab347a08a4c6dd9a2d963866de6be4613108377",
      "header": {
        "formatVersion": "v1.0",
        "disclaimer": "This pricing list is for informational purposes only. All prices are subject to the additional terms included in the pricing pages on http://aws.amazon.com. All…",
        "offerCode": "AmazonEC2",
        "version": "20261124231417",
        "publicationDate": "2026-11-24T23:14:17Z",
        "attributesList": {}
      },
      "selections": [
        {
          "rule": "ec2-instance-on-demand-linux",
          "selects": "Each instance type in measured.instance_types, in measured.region: productFamily \"Compute Instance\" or \"Compute Instance (bare metal)\", operatingSystem \"Linux\",…",
          "skus": [
            "8ESS9QXCJT48TMPH",
            "AWAUVC8BN4PM4V42",
            "8D49XP354UEYTHGM",
            "WKW5NUYTBWN4S8VU",
            "NKB8DU47ZKKBXW65"
          ]
        }
      ],
      "products": {
        "8ESS9QXCJT48TMPH": {
          "sku": "8ESS9QXCJT48TMPH",
          "productFamily": "Compute Instance",
          "attributes": {
            "servicecode": "AmazonEC2",
            "location": "US East (Ohio)",
            "locationType": "AWS Region",
            "instanceType": "i4i.2xlarge",
            "currentGeneration": "Yes",
            "instanceFamily": "Storage optimized",
            "vcpu": "8",
            "physicalProcessor": "Intel Xeon 8375C (Ice Lake)",
            "clockSpeed": "3.5 GHz",
            "memory": "64 GiB",
            "storage": "1 x 1875 NVMe SSD",
            "networkPerformance": "Up to 12 Gigabit",
            "processorArchitecture": "64-bit",
            "tenancy": "Shared",
            "operatingSystem": "Linux",
            "licenseModel": "No License required",
            "usagetype": "USE2-BoxUsage:i4i.2xlarge",
            "operation": "RunInstances",
            "availabilityzone": "NA",
            "capacitystatus": "Used",
            "classicnetworkingsupport": "false",
            "dedicatedEbsThroughput": "Up to 10000 Mbps",
            "dedicatedEbsThroughputDescription": "2500 Mbps",
            "ecu": "NA"
          }
        }
      },
      "terms": {
        "OnDemand": {
          "8ESS9QXCJT48TMPH": {
            "8ESS9QXCJT48TMPH.JRTCKXETXF": {
              "offerTermCode": "JRTCKXETXF",
              "sku": "8ESS9QXCJT48TMPH",
              "effectiveDate": "2026-11-01T00:00:00Z",
              "priceDimensions": {
                "8ESS9QXCJT48TMPH.JRTCKXETXF.6YS6EN2CT7": {
                  "rateCode": "8ESS9QXCJT48TMPH.JRTCKXETXF.6YS6EN2CT7",
                  "description": "$0.686 per On Demand Linux i4i.2xlarge Instance Hour",
                  "beginRange": "0",
                  "endRange": "Inf",
                  "unit": "Hrs",
                  "pricePerUnit": {"USD": "0.6860000000"},
                  "appliesTo": []
                }
              },
              "termAttributes": {}
            }
          }
        }
      }
    }
  ]
}
```

<details>
<summary>What the excerpt leaves out, in 7 places</summary>

The excerpt is made by one rule, applied at every depth, and changes nothing else. A list of more than one element keeps its first, unless every element is a string, a number, true, false or null and the list takes at most 120 characters as JSON: then it is kept whole. An object keeps every member its schema names, but of members whose schemas are each nothing but a reference to one and the same definition (such as a request's eight phases), it keeps the first. Of an object's members whose names its schema does not fix, it keeps the first, then each next one while the values kept, as excerpted, take at most 300 bytes as JSON, and none after the first that does not fit. A string longer than 160 characters keeps its first 160 and ends with …

- `sources`: its first element of 3
- `sources[0].header.disclaimer`: its first 160 of 248 characters
- `sources[0].selections`: its first element of 4
- `sources[0].selections[0].selects`: its first 160 of 422 characters
- `sources[0].products["8ESS9QXCJT48TMPH"].attributes`: 24 of its 37 members whose names its schema does not fix
- `sources[0].products`: 1 of its 8 members whose names its schema does not fix
- `sources[0].terms.OnDemand`: 1 of its 8 members whose names its schema does not fix

</details>

## Fields

Each field is named by its path from the top of the file: `a.b` is the member `b` of the object `a`, `[]` stands for each element of a list, `*` for a member whose name is not fixed (its object's type says when the names must match a pattern), and a name with a dot in it is written `["p99.9"]`. Under each path are its type and whether it is required (present wherever the object holding it is) or optional (it may be absent). An object said to have no other members holds none but those listed for it; any other object may hold members this page does not list. The file holds no top-level member but those below. The file and LedgerMath's own objects in it hold no member but those listed. AWS's objects (a source's `header`, each product, each term and its `termAttributes`, and each price dimension) are copied as AWS gives them, and may hold members this page does not list.

### `schema`

always `"ledgermath.prices/1"` · required

What this file is, and which version of its shape.

### `provider`

always `"aws"` · required

Whose price lists these are.

### `fetched_at`

string matching `^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}Z$` · required

When the fetch started, UTC, to the millisecond. Its date names the file.

### `measured`

object, no other members · required

What is measured, as LedgerMath's schedule (which benchmarks run on which instance types, in which zone) said when the file was cut: the inputs the rules were given besides the offer files.

### `measured.region`

string matching `^[a-z]{2}-[a-z]+-[0-9]$` · required

The Region of the schedule's zone.

### `measured.instance_types`

list of strings matching `^[a-z][a-z0-9-]*\.[a-z0-9]+$`, at least 1 element, no element twice · required

The schedule's instance types, sorted.

### `rules`

object, no other members · required

The rule set the records were selected with, by name and version. A record a rule of this version does not select is not in the file, whatever AWS charges for it.

### `rules.name`

always `"ledgermath.aws-price-rules"` · required

The rule set's name.

### `rules.version`

integer, 1 or more · required

The rule set's version. A rule set is never changed once a price file names it: a change is a new version.

### `sources`

list of at least 1 element, each element: object, no other members · required

One per offer file the rules read.

Each element: One offer file the rules read: the versioned URL its bytes were downloaded from, their size and SHA-256, the file's header, what each rule selected from it, and the selected products and their On-Demand terms, verbatim.

### `sources[].offer_code`

string matching `^[A-Za-z0-9]+$` · required

AWS's offer code, such as AmazonEC2.

### `sources[].url`

string matching the pattern its schema gives · required

The versioned URL the bytes were downloaded from; never a current URL.

### `sources[].version`

string matching `^[0-9]{14}$` · required

The offer file's own version.

### `sources[].publication_date`

string, not empty · required

The offer file's own publicationDate.

### `sources[].bytes`

integer, 1 or more · required

The size of the file downloaded.

### `sources[].sha256`

string matching `^sha256:[0-9a-f]{64}$` · required

The SHA-256 of the file downloaded.

### `sources[].header`

object · required

Every top-level member of the offer file other than products and terms, verbatim.

### `sources[].header.formatVersion`

string · required

The offer file's formatVersion, AWS's, copied as AWS gives it.

### `sources[].header.disclaimer`

string · optional

The offer file's disclaimer, AWS's words, copied as AWS gives them.

### `sources[].header.offerCode`

string · required

The offer file's offerCode, AWS's, copied as AWS gives it: the same as the source's offer_code.

### `sources[].header.version`

string · required

The offer file's version, AWS's, copied as AWS gives it: the same as the source's version, and the 14 digits of its url.

### `sources[].header.publicationDate`

string · required

The offer file's publicationDate, AWS's, copied as AWS gives it: the same as the source's publication_date.

### `sources[].selections`

list of at least 1 element, each element: object, no other members · required

Each rule of the rule set that reads this offer, what it selects, and the SKUs it selected, in the offer file's order.

### `sources[].selections[].rule`

string matching `^[a-z0-9]+(-[a-z0-9]+)*$` · required

The rule's name, unique within its rule set.

### `sources[].selections[].selects`

string, not empty · required

What the rule selects, in words.

### `sources[].selections[].skus`

list of at least 1 element, no element twice, each element: string, not empty · required

The SKUs it selected, in the offer file's order: each is a key of products.

### `sources[].products`

object, at least 1 member · required

The selected products, verbatim, each under the SKU the offer file files it under.

### `sources[].products.*`

object · one or more of them

AWS's product object.

### `sources[].products.*.sku`

string, not empty · required

AWS's SKU for the product: the key it is filed under in products.

### `sources[].products.*.productFamily`

string · optional

The product's family, AWS's, such as Compute Instance or Storage, copied as AWS gives it.

### `sources[].products.*.attributes`

object · required

The product's attributes, AWS's, by name, copied as AWS gives them: such as instanceType, regionCode and operatingSystem, which the rules select on.

### `sources[].products.*.attributes.*`

string · any number of them

One attribute's value, as AWS gives it.

### `sources[].terms`

object, no other members · required

The selected products' terms: On-Demand terms only.

### `sources[].terms.OnDemand`

object, at least 1 member · required

Each selected product's On-Demand terms, verbatim: terms.OnDemand.\<sku\> of the offer file, a map from \<sku\>.\<offerTermCode\> to a term.

### `sources[].terms.OnDemand.*`

object, at least 1 member · one or more of them

One selected product's On-Demand terms, under its SKU: terms.OnDemand.\<sku\> of the offer file, copied as AWS gives it, each term under \<sku\>.\<offerTermCode\>.

### `sources[].terms.OnDemand.*.*`

object · one or more of them

AWS's term object.

### `sources[].terms.OnDemand.*.*.offerTermCode`

string, not empty · required

AWS's code for the term: the term is filed under \<sku\>.\<offerTermCode\>.

### `sources[].terms.OnDemand.*.*.sku`

string, not empty · required

The SKU of the product the term is for: the SKU it is filed under.

### `sources[].terms.OnDemand.*.*.effectiveDate`

string · required

The term's effectiveDate, AWS's, copied as AWS gives it.

### `sources[].terms.OnDemand.*.*.priceDimensions`

object, at least 1 member · required

A map from rate code, \<sku\>.\<offerTermCode\>.\<code\>, to a price dimension.

### `sources[].terms.OnDemand.*.*.priceDimensions.*`

object · one or more of them

AWS's price dimension: a rate, the unit it is per, and the range of usage it applies to.

### `sources[].terms.OnDemand.*.*.priceDimensions.*.rateCode`

string, not empty · required

AWS's rate code, \<sku\>.\<offerTermCode\>.\<code\>: the price dimension is filed under it, and a price is cited by it.

### `sources[].terms.OnDemand.*.*.priceDimensions.*.description`

string · optional

AWS's words for the price, copied as AWS gives them, such as $0.096 per On Demand Linux m5.large Instance Hour.

### `sources[].terms.OnDemand.*.*.priceDimensions.*.beginRange`

string · optional

Where the range of usage the rate applies to begins, as AWS writes it.

### `sources[].terms.OnDemand.*.*.priceDimensions.*.endRange`

string · optional

Where the range of usage the rate applies to ends, as AWS writes it, such as Inf.

### `sources[].terms.OnDemand.*.*.priceDimensions.*.unit`

string · required

The unit the rate is per, AWS's, such as Hrs, copied as AWS gives it.

### `sources[].terms.OnDemand.*.*.priceDimensions.*.pricePerUnit`

object, at least 1 member · required

The price per unit, by currency, as AWS writes the number.

### `sources[].terms.OnDemand.*.*.priceDimensions.*.pricePerUnit.*`

string matching `^[0-9]+(\.[0-9]+)?$` · one or more of them

The price of one unit in one currency, under the currency's code, such as USD: a decimal number written as a string, as AWS writes it.

### `sources[].terms.OnDemand.*.*.priceDimensions.*.appliesTo`

list of strings · optional

AWS's appliesTo list, copied as AWS gives it.

### `sources[].terms.OnDemand.*.*.termAttributes`

object · optional

The term's termAttributes, AWS's, copied as AWS gives them.
