Skip to main content
Month end means signing in to six billing portals, finding the invoices page in each one, and copying numbers into a spreadsheet. This program sends one agent per portal, each signed in through its own profile, a few at a time. Each returns every invoice from the month with its number, date, total and status, and downloads each invoice’s PDF. The program then saves the PDFs beside the numbers and writes a CSV your bookkeeper can import.

What you need

  • An Outcrawl API key in OUTCRAWL_API_KEY.
  • One profile per portal, signed in and labelled ap-<vendor> (ap-aws, ap-zoom…). Sign each one in once: from TypeScript with oc.browser({ profile }), or with an agent run that types your password from a text secret, reading any emailed code through an inbox integration such as AgentMail.
  • Optional: SHEET_WEBHOOK_URL, an endpoint of yours that appends rows to your sheet or accounting system, for example a Google Apps Script web app.

How it works

1

Every portal at once, inside your limit

Every key on your account shares one browser slot count. Browsers, agent runs, crawls, searches and scrapes that aren’t served from cache each hold a slot. The program keeps MAX_AT_ONCE portals going, below your plan’s count. A submit over the limit is refused with ConcurrencyLimitError, and the program waits 20 seconds and tries again; a QuotaExceededError for requests per minute says how long to wait in retryAfterSeconds.
2

An agent reads each billing page

Each agent run starts signed in through its profile, finds the month’s invoices, and answers a schema: number, date, total, currency, status, and the PDF link when the page shows one. It then downloads each invoice’s PDF. The task is read-only, and the rule Only use aws.amazon.com. is enforced for each portal’s own site.
3

The PDFs, kept for you

Every file a run downloads is kept for 7 days. Once a run ends, job.downloads() lists its PDFs and saveDownload writes each one to invoices/2026-08/. Each PDF is matched to its invoice by its link or by the invoice number in its name.
4

Filed as a CSV

Every row goes into invoices/2026-08/invoices.csv, and, if you set SHEET_WEBHOOK_URL, to your own endpoint as JSON.
A portal that builds the PDF in the page and shows no link still works: the agent presses its download button, and the file is kept like any other. See downloads. A PDF the program could not match to an invoice is still saved in the folder; its row leaves stored empty.

The program

What you get back

invoices/2026-08/invoices.csv, with each invoice’s PDF saved beside it:
Here Atlassian showed no PDF link, so its agent pressed the download button instead, and the PDF was matched by its invoice number. A portal whose run did not finish is printed at the end with its replay link, so you can watch where it stopped.

What it costs

An agent run is billed for the model’s usage, browser time and proxy usage, per pricing. A typical agent run costs about 15 credits a minute all in, proxy usage included. That is an estimate: the real figure depends on the task, and a page-heavy portal costs more.
  • Each portal takes about 2 minutes: about 30 credits.
  • Keeping and fetching the PDFs costs nothing extra.
Six portals: 6 × 30 = about 180 credits a month, under a fifth of the Free plan’s 1,000. Each portal run’s caps.budget is 150.

Make it yours

  • File straight into your accounting: replace the sheet POST with one call per row to your accounting system’s API to create a bill.
  • Run it on the 3rd of every month from your own scheduler (cron, a CI schedule) and set MONTH from the date.
  • Catch what is unpaid: post every row whose status is due or overdue to Slack.
  • Let a run sign back in when a session has lapsed: give it your password as a secret and an inbox integration for the code.

Profiles

One signed-in browser per portal.

Agents

Runs, caps and typed results.

Downloads

Every file a run downloaded, kept 7 days.

Files

Hand a file to a run so it can upload it.