# Stripe Latest Charges (`nottooshabby/stripe-charges`) Actor

Fetch and export the latest Stripe charges with this powerful Apify Actor. Ideal for automating sales reporting, tracking payment data, or integrating Stripe transactions into your SaaS analytics, finance dashboards, or eCommerce workflows. Fast, secure, and ready for scheduled cloud execution.

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

## Pricing

$5.00 / 1,000 latest charges

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 Sales Fetcher – Apify Actor

Easily fetch and analyze your latest **Stripe sales (charges)** using this powerful, ready-to-deploy **Apify Actor**.

Whether you're building dashboards, automating sales reporting, or integrating with financial analytics tools, this Stripe Sales Fetcher is a simple yet flexible solution built on **Python** and the **Apify SDK**.

***

### 🔍 What It Does

This Actor connects to your **Stripe account** via API and retrieves the most recent sales data, including:

- 🧾 Charge ID
- 💰 Amount (converted to currency units)
- 💱 Currency
- 📦 Status
- 📝 Description
- 🕒 Timestamp
- 📧 Customer email and name
- 💳 Payment method type
- 🏦 Card brand and last 4 digits (if available)

***

### ✅ Why Use This?

- 🔁 Automated Stripe charge retrieval
- 📊 Simplifies sales data exports for analysis or reporting
- ☁️ Runs in the cloud, no server setup needed
- 🔗 Integrates directly into Apify workflows and datasets
- 📈 Supports up to 100 recent charges per run
- 🧩 Ideal for financial automation, SaaS analytics, eCommerce tracking, and payment data auditing

***

### ⚙️ Input Configuration

This Actor expects a JSON input with the following fields:

{
"stripe\_api\_key": "sk\_live\_YOUR\_SECRET\_KEY",
"sales\_limit": 10
}

- `stripe_api_key` (required): Your Stripe **secret key**
- `sales_limit` (optional): Number of latest charges to fetch (default is 5, max is 100)

***

### 📤 Output

The Actor pushes structured sales data to the Apify dataset. Example output:

{
"charge\_id": "ch\_1XXXXXXX",
"amount": 49.99,
"currency": "USD",
"status": "succeeded",
"description": "Monthly subscription",
"created\_timestamp": 1721309123,
"customer\_email": "user@example.com",
"customer\_name": "John Doe",
"payment\_method\_type": "card",
"card\_brand": "visa",
"card\_last4": "4242"
}

***

### 📌 Use Cases

- 💼 Monthly revenue tracking
- 🔎 Customer payment insights
- 🧾 Charge reconciliation and auditing
- 📊 Data pipelines for finance teams
- 📈 Visual dashboards with no-code platforms
- 🛠️ SaaS metrics collection

***

### 🛠️ Technologies Used

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

***

### 🚀 Getting Started

1. Deploy this Actor on [Apify](https://apify.com/)
2. Add your Stripe API key to the input configuration
3. Run the Actor manually or schedule it to run automatically
4. Export or process the results from the Apify dataset

***

### 🔒 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 sales, Stripe charges, Apify Actor, Python automation, serverless data pipeline, SaaS analytics, payment monitoring, financial reporting, charge history, eCommerce analytics, customer payments, automated billing data

# 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-charges").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-charges").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-charges --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/74IwHnpNy7g8jdO6O/builds/iSi1ANH6EpcEOlEs2/openapi.json
