# Apify Cost Auditor: Find Wasted Spend in Your Account (`the100/apify-cost-auditor`) Actor

Audits your own Apify account (read-only) and lists where money is wasted: failed and timed-out runs you still paid for, runs that returned nothing, memory set far too high, idle named storages, repeated identical runs and Actor price increases. Shows the monthly saving and the fix for each.

- **URL**: https://apify.com/the100/apify-cost-auditor.md
- **Developed by:** [Christopher Dorado](https://apify.com/the100) (community)
- **Categories:** Developer tools, Automation, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $790.00 / 1,000 spend leaks

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Apify Cost Auditor: Find Wasted Spend in Your Account

Audits your own Apify account and shows where money is being wasted, with the monthly amount and the fix for each leak. It only reads. Nothing in your account is changed.

### What does the Apify Cost Auditor do?

Apify bills are made of many small runs, so waste is hard to see in the billing page. This Actor reads your runs, storages, schedules and plan through the official Apify API and lists the leaks, sorted by money:

- **Failed and timed-out runs you still paid for**, grouped by Actor, task and schedule, with the last error message
- **Runs that returned 0 results but cost money** (only for Actors that normally return data)
- **Memory set far too high**: runs billed for 4 GB that never used more than 400 MB, with the memory to set instead
- **Idle named storages**: named datasets and key-value stores nobody has opened for 30+ days, with their monthly storage cost
- **Repeated identical runs**: the same input started again and again within 24 hours (free to review)
- **Price increases** of pay-per-event Actors you use, with the extra cost at your volume (free to review)
- **Plan fit**: when you are on pace to use far less than the usage your plan prepays (free to review)
- **Spend by Actor**: runs, failure rate, spend, share of the bill and cost per 1,000 results for every Actor you ran

### How to use

1. In Apify Console open **Settings > API & Integrations** and create a token. Switch on **Limit token permissions** and give it read access if you want the tightest setup.
2. Paste the token into the input and run.
3. Open the **REPORT**, the leaks table, **LEAKS_CSV** and **SPEND_BY_ACTOR_CSV**.

No token? Leave the input empty to see a free demo on a sample account.

Run it once a month, or put it on a schedule to catch new leaks early.

### What you get

Each leak has: where it is, how many runs or storages are affected, the money wasted in the audit window, the estimated waste per month and per year, what happened in plain words, how to fix it, and a link to the right page in Apify Console.

### Pricing

**$0.99 per leak worth at least $3 a month** (you can raise or lower that amount). Smaller leaks, review items, the summary, the spend table and the report are free. The demo is free. If nothing is wasted, you pay nothing.

### Is it safe to paste my token?

- The Actor can only send read (GET) requests. It cannot start, stop, change or delete anything.
- The token is a secret input: Apify stores it encrypted. The Actor uses it during the run and never logs it, saves it or sends it anywhere except api.apify.com.
- Your email, proxy password and other profile fields are not read into the results.
- You can use a scoped read-only token and delete it after the run.

### How the numbers are made

- A run's cost is what you paid for it: the pay-per-event charges of the Actor plus platform usage when you are the one paying for usage. Runs of your own Actors count their platform usage only.
- Monthly figures scale what was seen in the audit window to 30 days. With less than 3 days of runs nothing is scaled.
- Apify keeps runs only as long as your plan's data retention (7 days on the Free plan), so the audit covers the look-back you set or the retention, whichever is shorter.
- Memory advice is only given when both the memory peak and the CPU use clearly fit the smaller size. Test one run after changing it.
- Storage cost uses the storage unit prices of your own plan.

### FAQ

**Does it change anything?** No. It reads and reports. You decide what to fix.

**Will it find something in every account?** No. Small or tidy accounts may have nothing to cut, and then the run is free.

**Does it work for organization accounts?** Yes, with a token of that organization.

**Can I run it from the API or on a schedule?** Yes, like any Actor. The output is a dataset plus CSV and HTML files in the key-value store.

# Actor input Schema

## `apifyToken` (type: `string`):

Console > Settings > API & Integrations. For the tightest setup create a new token, switch on 'Limit token permissions' and give it read access only. The token is used during this run to read your runs, storages, schedules and plan. It is never stored, logged or sent anywhere else. Leave empty to see a free demo on a sample account.

## `windowDays` (type: `integer`):

How many days of runs to audit. Apify keeps runs only as long as your plan's data retention, so the audit covers whichever is shorter.

## `minMonthlyWasteUsd` (type: `integer`):

Leaks below this monthly amount are still listed, but free.

## `idleStorageDays` (type: `integer`):

Named datasets, key-value stores and request queues not opened for this long are listed with their monthly cost.

## `maxRuns` (type: `integer`):

The newest runs are read first. Raise it for very busy accounts.

## `useSampleData` (type: `boolean`):

Runs on a built-in example account so you can see the output. Never charged.

## Actor input object example

```json
{
  "windowDays": 30,
  "minMonthlyWasteUsd": 3,
  "idleStorageDays": 30,
  "maxRuns": 2000,
  "useSampleData": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `report` (type: `string`):

No description

## `leaksCsv` (type: `string`):

No description

## `spendByActorCsv` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("the100/apify-cost-auditor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("the100/apify-cost-auditor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call the100/apify-cost-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,the100/apify-cost-auditor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/TNGkzGnW19xbtQ3mg/builds/WngTkIrIYWf7OHUSZ/openapi.json
