# Stripe Analytics (`nottooshabby/stripe-analytics`) Actor

Fetch Stripe balance history & payouts for any date range. This actor automates financial data exports for accounting, reconciliation, and cash flow analysis. Perfect for finance teams, SaaS analytics, and automated reporting workflows. Secure, fast, and ready for scheduled cloud execution.

- **URL**: https://apify.com/nottooshabby/stripe-analytics.md
- **Developed by:** [Raphael Kuban](https://apify.com/nottooshabby) (community)
- **Categories:** E-commerce, Integrations, Automation
- **Stats:** 1 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 get stripe balance reports

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🚀 Stripe Analytics Fetcher – Apify Actor

Easily fetch and analyze your core Stripe financial data, including balance history and payouts, using this powerful, ready-to-deploy Apify Actor.

Whether you're building financial dashboards, automating reconciliation, or integrating with analytics tools, this Stripe Analytics Fetcher is a flexible solution built on Python and the Apify SDK.

***

### 🔍 What It Does

This Actor connects to your Stripe account via API and retrieves key financial data within a specified date range (defaults to the last 7 days). It fetches two main types of data:

#### 📈 Balance History

Detailed records of all transactions that affect your Stripe balance.

- 🧾 **Transaction ID**
- 💰 **Gross Amount, Net Amount, and Fee (converted to currency units)**
- 💱 **Currency**
- 📦 **Status** (e.g., available, pending)
- 📝 **Type** (e.g., charge, refund, payout)
- 🕒 **Timestamp**
- 🔗 **Source object details** (like the original charge or refund ID)

#### 💸 Payouts

Records of funds transferred from your Stripe balance to your bank account.

- 🧾 **Payout ID**
- 💰 **Amount**
- 💱 **Currency**
- 📦 **Status** (e.g., paid, in\_transit)
- 📅 **Arrival Date**
- 🕒 **Creation Timestamp**
- 💳 **Payout method and type**

***

### ✅ Why Use This?

- 🔁 Automated Stripe financial data retrieval
- 📊 Simplifies data exports for financial analysis, accounting, and reporting
- ☁️ Runs in the cloud, no server setup needed
- 🔗 Integrates directly into Apify workflows and datasets
- 📅 Supports filtering by date range for precise reporting
- 🧩 Ideal for financial automation, cash flow analysis, and payment data auditing

***

### ⚙️ Input Configuration

This Actor expects a JSON input with the following fields:

{
"stripe\_api\_key": "sk\_live\_YOUR\_SECRET\_KEY",
"analytics\_limit": 25,
"start\_date": "2023-10-01",
"end\_date": "2023-10-31"
}

- `stripe_api_key` (**required**): Your Stripe secret key.
- `analytics_limit` (optional): Number of records to fetch for each data type (default is 10).
- `start_date` (optional): The start date for the data range in `YYYY-MM-DD` format.
- `end_date` (optional): The end date for the data range in `YYYY-MM-DD` format.

> **Note:** If `start_date` and `end_date` are omitted, the Actor will default to fetching data from the last 7 days.

***

### 📤 Output

The Actor pushes structured financial data to the Apify dataset, separated into different views.

#### Balance History Example:

{
"transaction\_id": "txn\_1XXXXXXX",
"amount": 5500,
"net": 5302,
"fee": 198,
"currency": "USD",
"status": "available",
"type": "charge",
"description": "Charge for order #123",
"created\_timestamp": 1721312400,
"source\_id": "ch\_1XXXXXXX",
"source\_object": "charge"
}

#### Payout Example:

{
"payout\_id": "po\_1XXXXXXX",
"amount": 12550,
"currency": "USD",
"status": "paid",
"arrival\_date": 1721347200,
"created\_timestamp": 1721319000,
"method": "standard",
"type": "bank\_account",
"description": "STRIPE PAYOUT"
}

***

### 📌 Use Cases

- 💼 Financial reconciliation and auditing
- 🔎 Cash flow analysis and tracking
- 🧾 Payout verification against bank statements
- 📊 Data pipelines for finance and accounting teams
- 📈 Visual dashboards with no-code platforms
- 🛠️ Comprehensive financial reporting

***

### 🛠️ Technologies Used

- Python 3.11+
- Stripe API
- Apify SDK
- `asyncio` for non-blocking API calls

***

### 🚀 Getting Started

1. Deploy this Actor on Apify.
2. Add your Stripe API key to the input configuration.
3. (Optional) Set your desired date range and record limit.
4. Run the Actor manually or schedule it to run automatically.
5. Export or process the results from the Apify dataset views.

***

### 🔒 Security Note

Make sure to store and use your Stripe secret key securely. Never commit it to version control or share it publicly.

***

### 🙋 Support

Have questions, ideas, or feature requests?\
Feel free to open an issue, contact support via Apify, or fork the project and contribute.

***

**Keywords:** Stripe API, Stripe integration, Stripe analytics, Stripe balance, Stripe payouts, Apify Actor, Python automation, serverless data pipeline, financial reporting, cash flow analysis, payment monitoring, accounting automation, financial data, API reporting

# Actor input Schema

## `stripe_api_key` (type: `string`):

API key for your stripe account, this value will be encrypted

## Actor input object example

```json
{}
```

# 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("nottooshabby/stripe-analytics").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("nottooshabby/stripe-analytics").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 nottooshabby/stripe-analytics --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=nottooshabby/stripe-analytics",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

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