Skip to content

Commit 347a605

Browse files
docs: Fix PR comments
1 parent 2f7a9c6 commit 347a605

File tree

2 files changed

+20
-26
lines changed

2 files changed

+20
-26
lines changed

sources/platform/actors/publishing/monetize/pay_per_event.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ sidebar_position: 3
1212
import Tabs from '@theme/Tabs';
1313
import TabItem from '@theme/TabItem';
1414

15-
The pay-per-event pricing model offers a flexible monetization option for Actors on Apify Store. Unlike pay per result, PPE allows you to charge users based on specific events triggered programmatically by your Actor's code.
15+
The PPE pricing model offers a flexible monetization option for Actors on Apify Store. Unlike pay per result, PPE allows you to charge users based on specific events triggered programmatically by your Actor's code.
1616

1717
PPE lets you define pricing for individual events. You can charge for specific events directly from your Actor using the [JS](/sdk/js/reference/class/Actor#charge)/[Python](/sdk/python/reference/class/Actor#charge) SDK, or by calling the [PPE charging API](/api/v2/post-charge-run) directly. Common events include Actor start, dataset item creation, and external API calls.
1818

19-
The details on how your cost is computed can be found in [Example of a pay-per-event pricing model](#example-of-a-pay-per-event-pricing-model).
19+
The details on how your cost is computed can be found in [Example of a PPE pricing model](#example-of-a-ppe-pricing-model).
2020

2121
## How is profit computed
2222

@@ -40,7 +40,7 @@ An Actor's negative net profit does not affect the positive profit of another Ac
4040

4141
:::
4242

43-
## How to set pricing for pay-per-event Actors
43+
## How to set pricing for PPE Actors
4444

4545
1. _Understand your costs_: Analyze resource usage (e.g CPU, memory, proxies, external APIs) and identify cost drivers
4646
1. _Define clear events_: break your Actor's functionality into measurable, chargeable events.
@@ -51,7 +51,7 @@ An Actor's negative net profit does not affect the positive profit of another Ac
5151
1. _Test your pricing_: Run your Actor and analyze cost-effectiveness using a special dataset.
5252
1. _Communicate value_: Ensure pricing reflects the value provided and is competitive.
5353

54-
## Best practices for pay-per-event Actors
54+
## Best practices for PPE Actors
5555

5656
Use our SDKs (JS and, Python or use [`apify actor charge`](/cli/docs/next/reference#apify-actor-charge-eventname) when using our Apify CLI) to simplify PPE implementation into your Actor. This tool can handle pricing, usage tracking, idempotency keys, API errors, and, event charging via an API.
5757

@@ -77,9 +77,9 @@ When using browser automation tools like Puppeteer or Playwright for web scrapin
7777

7878
:::
7979

80-
### Charge for "Actor start"
80+
### Charge for `Actor start`
8181

82-
Charge for "Actor start" to prevent users from running your Actor for free.
82+
Charge for `Actor start` to prevent users from running your Actor for free.
8383

8484
<Tabs groupId="main">
8585
<TabItem value="JavaScript" label="JavaScript">
@@ -317,7 +317,7 @@ Try to limit the number of events. Fewer events make it easier for users to unde
317317

318318
For Actors that produce data, events should map to something concrete in the user's dataset or storage.
319319

320-
However, we acknowledge that some events don't produce tangible results (such as running AI workflows or processing external API calls). This flexibility is what makes pay-per-event pricing powerful. It gives you the freedom to charge for special operations, complex workflows, and unique value propositions.
320+
However, we acknowledge that some events don't produce tangible results (such as running AI workflows or processing external API calls). This flexibility is what makes PPE pricing powerful. It gives you the freedom to charge for special operations, complex workflows, and unique value propositions.
321321

322322
Examples:
323323

@@ -330,9 +330,9 @@ Examples:
330330

331331
If you're not using the Apify SDKs (JS/Python), you need to handle idempotency (ensuring the same operation produces the same result when called multiple times) manually to prevent charging the same event multiple times.
332332

333-
## Example of a pay-per-event pricing model
333+
## Example of a PPE pricing model
334334

335-
You make your Actor pay-per-event and set the following pricing:
335+
You make your Actor PPE and set the following pricing:
336336

337337
- _`actor-start` event_: $0.10 per start
338338
- _`scraped-product` event_: $0.01 per product
@@ -356,9 +356,9 @@ Your profit is computed only from the first two users, since they are on Apify p
356356
- _Total underlying cost_: $3.20 + $1.50 = $4.70
357357
- _Your profit_: 80% of revenue minus costs = 0.8 × $25.20 - $4.70 = $15.46
358358

359-
## PPE event names
359+
## Event names
360360

361-
To implement pay-per-event pricing, you need to define specific events in your Actor code. You can retrieve the list of available pricing event names using the [Get Actor](https://apify.com/docs/api/v2/act-get) API endpoint.
361+
To implement PPE pricing, you need to define specific events in your Actor code. You can retrieve the list of available pricing event names using the [Get Actor](https://apify.com/docs/api/v2/act-get) API endpoint.
362362

363363
## Next steps
364364

sources/platform/actors/publishing/monetize/pay_per_result.mdx

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,14 @@ import TabItem from '@theme/TabItem';
1414

1515
In this model, you set a price per 1,000 results. Users are charged based on the number of results your Actor produces and stores in the run's default dataset. Your profit is calculated as 80% of the revenue minus platform usage costs.
1616

17-
The details on how your cost is computed can be found in [Example of a pay-per-result pricing model](#example-of-a-pay-per-result-pricing-model).
17+
The details on how your cost is computed can be found in [Example of a PPR pricing model](#example-of-a-ppr-pricing-model).
1818

1919
:::tip Additional benefits
2020

21-
Actors that implement pay-per-result pricing receive additional benefits, including increased visibility in the Apify Store and enhanced discoverability for users looking for monetized solutions.
21+
Actors that implement PPR pricing receive additional benefits, including increased visibility in the Apify Store and enhanced discoverability for users looking for monetized solutions.
2222

2323
:::
2424

25-
## Pay-per-result (PPR) vs. pay-per-event (PPE)
26-
27-
Unlike PPR, which charges based on the number of results produced, PPE lets you define pricing for individual events. You can charge for specific events directly from your Actor by calling the PPE charging API. Common events include Actor start, dataset item creation, and external API calls.
28-
29-
If you're interested in learning more about PPE, check out the [Pay per event (PPE)](/platform/actors/publishing/monetize/pay-per-event) section.
30-
3125
## How is profit computed
3226

3327
Your profit is calculated from the mentioned formula:
@@ -37,11 +31,11 @@ Your profit is calculated from the mentioned formula:
3731
where:
3832

3933
- _Revenue_: The amount charged for results via the PPR pricing API or through JS/Python SDK. You receive 80% of this revenue.
40-
- _Platform costs_: The underlying platform usage costs for running the Actor, calculated in the same way as for PPE. For more details, visit the [Example of a pay-per-result pricing model](#example-of-a-pay-per-result-pricing-model) section.
34+
- _Platform costs_: The underlying platform usage costs for running the Actor, calculated in the same way as for PPE. For more details, visit the [Example of a PPR pricing model](#example-of-a-ppr-pricing-model) section.
4135

4236
Only revenue and cost for Apify customers on paid plans are taken into consideration when computing your profit. Users on free plans are not reflected there.
4337

44-
## Best practices for pay-per-result Actors
38+
## Best practices for PPR Actors
4539

4640
To ensure profitability, check the following best practices.
4741

@@ -69,7 +63,7 @@ When using browser automation tools like [Puppeteer](https://pptr.dev/) or [Play
6963

7064
This check prevents your Actor from generating more results than the user has paid for, protecting both you and your users from unexpected costs.
7165

72-
The `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable contains the user-set limit on returned results for pay-per-results Actors. Do not exceed this limit. You can see the example implementation in the following code snippets.
66+
The `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable contains the user-set limit on returned results for PPR Actors. Do not exceed this limit. You can see the example implementation in the following code snippets.
7367

7468
<Tabs groupId="main">
7569
<TabItem value="JavaScript" label="JavaScript">
@@ -85,7 +79,7 @@ let isGettingItemCount = false;
8579
let pushedItemCount = 0;
8680

8781
export const pushDataMaxAware = async (data: Parameters<Actor['pushData']>[0]): Promise<{ shouldStop: boolean }> => {
88-
// If this isn't pay-per-result, just push like normallyå
82+
// If this isn't PPR, just push like normally
8983
if (!MAX_ITEMS) {
9084
await Actor.pushData(data);
9185
return { shouldStop: false };
@@ -136,7 +130,7 @@ class PayPerResultManager:
136130
self.pushed_item_count = 0
137131

138132
async def push_data_max_aware(self, data: Union[Dict[Any, Any], List[Dict[Any, Any]]]) -> Dict[str, bool]:
139-
# If this isn't pay-per-result, just push like normally
133+
# If this isn't PPR, just push like normally
140134
if not self.max_items:
141135
await Actor.push_data(data)
142136
return {'shouldStop': False}
@@ -205,9 +199,9 @@ Example scenarios:
205199

206200
This ensures that every run generates at least one result, guaranteeing that users are charged appropriately for using your Actor.
207201

208-
## Example of pay-per-result pricing model
202+
## Example of PPR pricing model
209203

210-
You make your Actor pay-per-result and set the price to be _$1/1,000 results_. During the first month, three users use your Actor:
204+
You make your Actor PPR and set the price to be _$1/1,000 results_. During the first month, three users use your Actor:
211205

212206
- _User 1 (paid plan)_: Gets 50,000 results, costing them $50
213207
- _User 2 (paid plan)_: Gets 20,000 results, costing them $20

0 commit comments

Comments
 (0)