Read and export your usage history

Read daily usage and the credit ledger in the dashboard and through the billing API, export all of it as one JSON file, and turn the daily rows into a CSV file.

Updated

Wayfern records your usage per UTC day and every change to your balance. This guide shows where to read both in the dashboard, how to fetch them through the API, and how to export them.

In the dashboard

The Usage page has two parts:

  • Usage history shows daily totals for the last 7, 30 or 90 days. Choose one metric: Credits, Browser in hours, Search in requests, Captcha in solves, Web Data in billed units, or Residential in GB.
  • Credit history lists each grant, purchase and debit on your balance. It shows the 50 most recent entries.

The dashboard home shows the credits you used each day in the last 30 days. Invoices are on the Account page, and each downloads as a PDF.

Through the API

The billing routes accept a signed-in dashboard session, not a wf_ API token. A wf_ token on these routes gets 401.

Daily usage

GET /api/billing/usage/history?days=N returns one row per UTC day with usage, for the last N days including today. days is from 1 to 365, with a default of 30.

curl "https://api.wayfern.com/api/billing/usage/history?days=90" \
  -H "Authorization: Bearer $DASHBOARD_JWT"
{
  "usage": [
    {
      "userId": "usr_92a1",
      "day": "2026-10-28",
      "sessionSeconds": 5400,
      "searchRequests": 12,
      "captchaSolves": 3,
      "residentialBytes": 48000000,
      "webRequests": 240,
      "creditsMcr": 294360,
      "updatedAt": "2026-10-28T23:58:12.000Z"
    }
  ]
}
  • creditsMcr is in thousandths of a credit. Divide it by 1,000.
  • webRequests counts billed Web Data units, for example pages.
  • A day without usage has no row.
  • The row for today changes until the day ends.

Credit ledger

GET /api/billing/history returns the 50 most recent ledger entries, newest first. Each entry has kind, amountMcr, source, balanceAfterMcr and createdAt. kind is grant, debit, pack, reset or clawback. amountMcr is signed and in thousandths of a credit.

Current period

GET /api/billing/entitlements returns the balance, the totals of the current period, the period start and end, and the spend limit status.

Export

There is no CSV export and no paging in the usage API. You have two options.

The account data export gives you everything at once. On the Account page, open Your data and select Download my data. It saves one JSON file with your profile, sign-in history, payments, invoices, the full credit ledger in creditLedger and every daily row in dailyUsage. When two-factor sign-in is on, it asks for an authenticator code. The export allows 3 requests an hour. The API route is POST /api/auth/export.

curl -X POST https://api.wayfern.com/api/auth/export \
  -H "Authorization: Bearer $DASHBOARD_JWT" \
  -H "Content-Type: application/json" \
  -d '{ "code": "123456" }' \
  -o wayfern-data.json

Omit code when two-factor sign-in is off.

For a CSV of daily usage, fetch up to 365 days in one call and write the rows yourself:

import csv
import os

import requests

res = requests.get(
    "https://api.wayfern.com/api/billing/usage/history",
    headers={"Authorization": f"Bearer {os.environ['DASHBOARD_JWT']}"},
    params={"days": 365},
    timeout=60,
)
res.raise_for_status()
rows = res.json()["usage"]

with open("wayfern-usage.csv", "w", newline="") as f:
    out = csv.writer(f)
    out.writerow(["day_utc", "credits", "browser_hours", "search_requests",
                  "captcha_solves", "web_units", "residential_gb"])
    for r in rows:
        out.writerow([
            r["day"],
            r["creditsMcr"] / 1000,
            round(r["sessionSeconds"] / 3600, 3),
            r["searchRequests"],
            r["captchaSolves"],
            r["webRequests"],
            round(r["residentialBytes"] / 1e9, 4),
        ])

print(len(rows), "days written")

The API covers at most 365 days per call. To keep a longer record, run the script on a schedule and store rows by day. The data export always holds every day.

Usage per job

The usage history counts your whole account. To see what one job cost, read the credits field of each Web Data and Operations response and add it up in your code. See Credits and spend limits and Pricing.