# Test PPE Actor (`dhrumil/test-ppe-actor`) Actor

This is test PPE actor which describes how PPE is billed

- **URL**: https://apify.com/dhrumil/test-ppe-actor.md
- **Developed by:** [Dhrumil Bhankhar](https://apify.com/dhrumil) (community)
- **Categories:** Other
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/actors/running/actors-in-store.md#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

## PPE Test Actor

This actor is designed for property data scraping and quota-based usage testing on the Apify platform. It demonstrates how usage-based charging and multipliers work for item scraping scenarios.

### 📥 Input Parameters

- **`recordsToPush`** (`integer`, required)
  - Number of random items to push to the Apify dataset. This simulates the number of items processed in a run.
- **`addAdditioanalUsageFull`** (`boolean`, optional)
  - If enabled, simulates scraping full property details. Increases your usage multiplier by 1x, causing your quota to be used up faster.
- **`addAdditioanalUsageHalf`** (`boolean`, optional)
  - If enabled, simulates scraping nearest schools. Increases your usage multiplier by 0.5x, causing your quota to be used up faster.

### 💸 Understanding the Pricing

This actor uses a transparent and predictable pricing model based on two main events:

#### 1️⃣ Monthly Subscription

- **💲 Price:** $1 USD per <1,000 items
- **📦 Included Usage:** Up to <1,000 items scraped per month
- **🟢 Platform Usage Included:** The $1 subscription now includes all Apify platform usage costs for this actor—no separate Apify platform charges apply for your scraping runs.
- When you start using the actor, a monthly subscription event is triggered and you are billed $1. This covers your first 1,000 items scraped in that month, including all platform usage.

#### 2️⃣ Over-usage Charges

- **💲 Price:** $0.10 USD per additional 100 items
- **🔄 How it works:** If you exceed the 1,000 items included in your monthly subscription, you will be billed $0.10 for every additional 100 items scraped. This ensures you only pay for what you use beyond your included quota.

##### 📊 Example:

- If you scrape 2,000 items in a month, you will pay $1 for the subscription and $1 for the extra 1,000 items (10 x $0.10), for a total of $2.

#### ⚡ Additional Usage Parameters (Multipliers)

The actor may apply additional usage multipliers based on your input settings. These do **not** directly charge you extra, but they affect how quickly you use up your monthly quota. The more features you enable, the faster your included usage is consumed.

- **🌐 Residential Proxy Usage:** If you use a residential proxy, an additional 1x usage multiplier will apply. This is due to the higher cost and complexity of residential proxy traffic.
- **🧠 Memory Usage:** If you run the actor with more than 256 MB of memory, you will be charged an additional usage multiplier. For example, running at 512 MB will double your usage cost.
- **🏷️ Full Property Details:** Enabling `addAdditioanalUsageFull` will increase your usage multiplier by 1x, as it requires scraping more data per property.
- **🏫 Include Nearest Schools:** Enabling `addAdditioanalUsageHalf` adds 0.5x to your usage multiplier.

These multipliers are **cumulative**. For example, if you enable both `addAdditioanalUsageFull` and `addAdditioanalUsageHalf`, your usage for each property will be multiplied by 1.5x.

##### 🧮 How Multipliers Affect Your Quota

- **Multipliers do not bill you directly.** Instead, they reduce the number of items you can scrape before hitting your monthly quota.
- **Example:**
  - If you scrape with default settings (no multipliers), you can scrape **1,000 items** before any over-usage charge applies.
  - If you enable `addAdditioanalUsageFull` (1x additional), your usage is burned at double rate, so you can scrape **500 items** before any over-usage charge applies.
  - If you enable both `addAdditioanalUsageFull` and `addAdditioanalUsageHalf` (1x + 0.5x = 1.5x), you can scrape **400 items** before hitting your quota.

#### 🚨 When Do Over-usage Charges Apply?

- Over-usage charges ($0.10 per 100 items) are **only billed when your monthly quota is exceeded**.
- Additional usage multipliers **do not result in extra charges**—they simply cause your quota to be used up faster.

> **💡 Tip:**
> For best cost efficiency, run this actor on **256 MB memory**. The actor is highly optimized for this setting, and using more memory will increase your additional usage charges. Only increase memory if you have a specific need.

# Actor input Schema

## `recordsToPush` (type: `integer`):

Number of random items to push to Apify dataset.

## `addAdditioanalUsageFull` (type: `boolean`):

Charge for including full property details.

## `addAdditioanalUsageHalf` (type: `boolean`):

Charge for including nearest schools.

## Actor input object example

```json
{
  "recordsToPush": 2,
  "addAdditioanalUsageFull": false,
  "addAdditioanalUsageHalf": false
}
```

# 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 = {
    "recordsToPush": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("dhrumil/test-ppe-actor").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 = { "recordsToPush": 2 }

# Run the Actor and wait for it to finish
run = client.actor("dhrumil/test-ppe-actor").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 '{
  "recordsToPush": 2
}' |
apify call dhrumil/test-ppe-actor --silent --output-dataset

```

## MCP server setup

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

```

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/FTIIPzsESRAzW90YO/builds/iLTCbO1dOdQDt2r2l/openapi.json
