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 withoc.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:
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.
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
MONTHfrom the date. - Catch what is unpaid: post every row whose
statusisdueoroverdueto 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.
Related
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.