How many GB do you need
Add the pages a job fetches to the fetches it repeats, and multiply by the bytes each one sends and receives: the product is the traffic in bytes, and dividing it by unitBytes from the price list gives GB. Coronium publishes no typical page size, so both figures come from your own job. This page is part of Pay per GB.
Updated Read as Markdown
The estimate
Traffic in bytes is (pages + repeated fetches) × bytes per page, and GB is that total divided by unitBytes. The calculator takes the three figures as whole numbers and shows the bytes, the GB and the cost at each tier of GET /app/api/prices, read when the calculator comes into view. That read needs no account.
How many pages the job fetches.
Each fetch you expect to repeat, once per repeat. Empty is none.
Measured on one of your own pages, sent and received together.
- Fetchespages + retried pages
- Type the pages and the bytes per page
- Bytesfetches × bytes per page
- Type the pages and the bytes per page
- GBbytes ÷ unitBytes of the price list
- Type the pages and the bytes per page
Cost at each tier of the list: not typed yet.
Type the pages and the bytes per page to see the traffic.
Prices are read in this browser from GET /app/api/prices and GET /app/api/buy.
Count each retry as one more fetch. A browser that loads a page also requests its images, scripts, styles and fonts, and each of those carries bytes of its own, so for a browser-driven job measure the whole page load as one figure. A job that fetches only the HTML of each page counts that alone.
How do I measure bytes per page?
Fetch one page the way the job will, and add what went each way. curl reports the parts it sent and received:
curl -s -o /dev/null -w '%{size_request} %{size_upload} %{size_header} %{size_download}\n' https://example.com/The figures are the request head, the request body, the answer headers and the answer body, in bytes; add them for one request. Measure several pages of the kind the job fetches and use the larger figures.
How does it turn into a cost?
The ledger prices a byte count at the tier of the country the traffic left from: b bytes at p micro-USD per GB cost b × p × 10,000 units of n, and nPerUsdMicro units make one micro-USD. The same sum in integers, for your own script:
def cost_usd_micros(pages: int, repeats: int, bytes_per_page: int, usd_micros_per_gb: int, prices: dict) -> int:
"""Whole micro-USD, toward zero, as the statement shows them."""
total = (pages + repeats) * bytes_per_page
n = total * usd_micros_per_gb * int(prices["nPerUsdMicro"]) // int(prices["unitBytes"])
return n // int(prices["nPerUsdMicro"])type Prices = { unitBytes: string; nPerUsdMicro: string }
function costUsdMicros(pages: bigint, repeats: bigint, bytesPerPage: bigint, usdMicrosPerGb: bigint, prices: Prices): bigint {
const total = (pages + repeats) * bytesPerPage
const n = (total * usdMicrosPerGb * BigInt(prices.nPerUsdMicro)) / BigInt(prices.unitBytes)
return n / BigInt(prices.nPerUsdMicro)
}Read https://coronium.ai/pay-per-gb/how-many-gb-do-i-need.md. I will give you my page count, my repeated fetches and my bytes per page. Call GET https://coronium.ai/app/api/prices and tell me the traffic in GB and its cost at the tier of the country I name, with integers only. Use HTTP calls only.Read usdMicrosPerGb for the tier from GET /app/api/prices; a country that is in no tier is charged at the tier defaultTier names.
Why is the statement the authority?
The estimate predicts; the edge's count decides. After a first run, GET /app/api/billing/statement?month=YYYY-MM gives the requests, the bytes and the charge for each day and country. Divide the bytes by the pages the job fetched to get its own bytes per page, and use that figure for the next estimate.
An attempt that reaches no device costs nothing, so failed attempts before a stream opens do not add to the count. A request that reaches the site is counted whatever the site answers, an error page included.
The stated limits list what the service does only within a bound, and Buy proxies adds funds to the balance.