On Usage Reports

Hey folks,
I was wondering if you guys have a shortcut to get an estimate of the costs, or at least, how much I’d be charged today for my current usage. (Org’s name is IFS).

I think I could put something together in Google Sheets. Is there any public-ish API I can use to retrieve current usage? I’ve been playing around with fly apps list -j and fly scale show -a app-name -j, but can’t seem to figure out yet where would I get the usage (without to falling back to gently scraping https://fly.io/organizations/ifs/usage :slight_smile: )

Cheers, Vicente.

You can get these through GraphQL using the billables field on an organization. The query we use for that URL is:

    query($slug: String!, $startDate: ISO8601DateTime!, $endDate: ISO8601DateTime!) {
      organization(slug: $slug){
        id
        slug
        name
        type
        billables(startDate: $startDate, endDate: $endDate){
          nodes {
            app {
              name
            }
            category
            product
            quantity
          }
        }
      }
    }
1 Like