# AWS CUR Anomaly Detector (`ceddl/aws-cur-anomaly-detector`) Actor

Credential-free deterministic anomaly preflight for one bounded, already-exported AWS Cost and Usage Report.

- **URL**: https://apify.com/ceddl/aws-cur-anomaly-detector.md
- **Developed by:** [Cedric Günther](https://apify.com/ceddl) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $94.00 / 1,000 cur report analyzeds

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

## AWS CUR Anomaly Detector

Analyze one already-exported AWS Cost and Usage Report without AWS credentials. The Actor accepts a public HTTPS CSV or single gzip-compressed CSV, maps exact legacy CUR or Data Exports CUR 2.0 headers, and ranks daily unblended-cost changes using deterministic decimal arithmetic.

It does not connect to AWS or S3, monitor continuously, forecast spend, recommend savings, convert currencies, or send report rows to a model. Findings are review candidates, not proof of waste or authorization to change infrastructure.

### Input

`reportUrl` is required. The remaining fields default to a 7-day baseline, latest represented date, service grouping, USD 25 absolute threshold, 50 percent threshold, both directions, and 100 findings. Add `region`, `usageType`, `operation`, or `linkedAccount` to `groupBy` only when the exact corresponding column exists. Non-USD reports require `minAbsoluteChange` in the report currency.

The file is limited to 100 MiB downloaded, 500 MiB expanded, 5,000,000 rows, 500,000 groups, and one currency. ZIP, Parquet, multi-file reports, live AWS access, and fuzzy header matching are rejected.

### Output and billing

The default dataset contains one `summary`, zero or more ranked `anomaly` records, and one `diagnostics` record. `OUTPUT.json` contains the identical ordered records and `SUMMARY.json` contains the summary. Output contains aggregates and hashes, never raw billing rows or account credentials.

Under pay-per-event pricing, one `cur-report-analyzed` event is charged only after all three durable output surfaces succeed. Validation, download, format, baseline, bound, runtime, and zero-capacity failures are non-billable. A durable semantic ledger prevents repeat charging after retries or interrupted charge acknowledgement.

### Local verification

```powershell
npm install
npm test
npm run build
npm run schema:check
python ../../tools/store-qa-gate/store_qa_gate.py --schema-only .
```

Tests use only synthetic dates, services, regions, and costs. The Store prefill uses the stable public synthetic fixture; no Actor cloud run or paid action is part of local QA.

# Actor input Schema

## `reportUrl` (type: `string`):

Public HTTPS or Apify-managed upload URL for exactly one CSV or CSV.GZ file. Never enter AWS credentials.

## `curVariant` (type: `string`):

Detect the supported CUR header family automatically, or require one exact variant.

## `timeGrain` (type: `string`):

Aggregate report costs by UTC day; day is the only supported v1 grain.

## `groupBy` (type: `array`):

Service must be first. Requested optional dimensions must exist in the report.

## `baselineDays` (type: `integer`):

Number of complete UTC days immediately before the comparison date used for the mean baseline.

## `comparisonDate` (type: `string`):

ISO date, or null to use the latest date represented in the file.

## `minAbsoluteChangeUsd` (type: `number`):

Minimum absolute cost change for USD reports; non-USD reports use the report-currency field.

## `minAbsoluteChange` (type: `number`):

Required for non-USD reports; otherwise null uses the USD threshold.

## `minPercentChange` (type: `number`):

Minimum absolute percentage change from the baseline mean required for a finding.

## `direction` (type: `string`):

Return cost increases, decreases, or both directions.

## `maxFindings` (type: `integer`):

Maximum number of deterministically ranked anomaly records returned after filtering.

## Actor input object example

```json
{
  "reportUrl": "https://api.apify.com/v2/key-value-stores/JsQc6agTsYO4aerhy/records/aws-cur-anomaly-detector-store-qa.csv?signature=9VjIEH5uzHRxLq4EYK0j",
  "curVariant": "auto",
  "timeGrain": "day",
  "groupBy": [
    "service",
    "region"
  ],
  "baselineDays": 7,
  "minAbsoluteChangeUsd": 25,
  "minPercentChange": 50,
  "direction": "both",
  "maxFindings": 100
}
```

# Actor output Schema

## `records` (type: `string`):

No description

## `output` (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 = {
    "reportUrl": "https://api.apify.com/v2/key-value-stores/JsQc6agTsYO4aerhy/records/aws-cur-anomaly-detector-store-qa.csv?signature=9VjIEH5uzHRxLq4EYK0j",
    "groupBy": [
        "service",
        "region"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ceddl/aws-cur-anomaly-detector").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 = {
    "reportUrl": "https://api.apify.com/v2/key-value-stores/JsQc6agTsYO4aerhy/records/aws-cur-anomaly-detector-store-qa.csv?signature=9VjIEH5uzHRxLq4EYK0j",
    "groupBy": [
        "service",
        "region",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("ceddl/aws-cur-anomaly-detector").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 '{
  "reportUrl": "https://api.apify.com/v2/key-value-stores/JsQc6agTsYO4aerhy/records/aws-cur-anomaly-detector-store-qa.csv?signature=9VjIEH5uzHRxLq4EYK0j",
  "groupBy": [
    "service",
    "region"
  ]
}' |
apify call ceddl/aws-cur-anomaly-detector --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ceddl/aws-cur-anomaly-detector"
        }
    }
}
```

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/PzqjYeQPr6BNj9Glg/builds/6KgZXqlexwOBOJDG8/openapi.json
