Skip to content

Commit 11db39b

Browse files
authored
docs: add new section regarding PPE based on alpha PPE docs (#1481)
1 parent 8b913f6 commit 11db39b

File tree

5 files changed

+73
-4
lines changed

5 files changed

+73
-4
lines changed
72.4 KB
Loading
124 KB
Loading
106 KB
Loading
113 KB
Loading

sources/platform/actors/publishing/monetize.mdx

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ sidebar_position: 2
99

1010
---
1111

12+
import Tabs from '@theme/Tabs';
13+
import TabItem from '@theme/TabItem';
14+
1215
Apify Store allows you to monetize your web scraping and automation projects by publishing them as Paid Actors. This guide explains the available pricing models and how to get started.
1316

1417
## Pricing models
@@ -17,8 +20,8 @@ Actors in Apify Store can be published under one of the following pricing models
1720

1821
1. **Free**: Users can run the Actor without any additional charges beyond the platform usage costs generated by the Actor.
1922
2. **Rental**: Users pay for the platform usage costs. However, after a trial period, they need to pay a flat monthly fee to the developer to continue using the Actor.
20-
3. **Pay per result**: Users don't pay for the platform usage costs. Instead, they pay the developer based on the number of results produced by the Actor.
21-
4. **Pay per event**: Users don't pay for the platform usage cost the Actor generates. Instead, they pay based on specific events that are programmatically triggered from the Actor's source code. These events are defined by the developer and can include actions such as generating a single result or starting an Actor.
23+
3. **Pay per result (PPR)**: Users don't pay for the platform usage costs. Instead, they pay the developer based on the number of results produced by the Actor.
24+
4. **Pay per event (PPE)**: Users don't pay for the platform usage cost the Actor generates. Instead, they pay based on specific events that are programmatically triggered from the Actor's source code. These events are defined by the developer and can include actions such as generating a single result or starting an Actor.
2225

2326
### Rental pricing model
2427

@@ -71,22 +74,88 @@ You make your Actor pay-per-result and set the price to be $1/1,000 results. Dur
7174
Your profit is computed only from the first two users, since they are on Apify paid plans. The revenue for the first user is $50 and for the second $20, i.e., total revenue is $70. The total underlying cost is _$5 + $2 = $7_. Since your profit is 80% of the revenue minus the cost, it would be _0.8 * 70 - 7 = $49_.
7275
</details>
7376

74-
#### Best practices for Pay-per-results Actors
77+
#### Best practices for PPR Actors
7578

7679
To ensure profitable operation:
7780

7881
- Set memory limits in your [`actor.json`](https://docs.apify.com/platform/actors/development/actor-definition/actor-json) file to control platform usage costs
7982
- Implement the `ACTOR_MAX_PAID_DATASET_ITEMS` check to prevent excess result generation
8083
- Test your Actor with various result volumes to determine optimal pricing
8184

85+
### Pay-per-event pricing model
86+
87+
The pay-per-event pricing model offers a flexible monetization option for Actors on Apify Store. Unlike the pay-per-result, PPE allows you to charge users based on specific events triggered programmatically by your Actor's code.
88+
89+
#### PPE vs PPR
90+
91+
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.
92+
93+
For a detailed comparison of pricing models, refer to our [user-facing documentation](/platform/actors/running/actors-in-store).
94+
95+
#### How is profit computed
96+
97+
Your profit is calculated as follows:
98+
99+
`profit = (0.8 * revenue) - platform costs`
100+
101+
where:
102+
103+
- _Revenue_: The amount charged for events via the PPE [API](/api/v2/post-charge-run) or through [JS](/sdk/js/reference/class/Actor#charge)/[Python](/sdk/python/reference/class/Actor#charge) SDK. You receive 80% of this revenue.
104+
- _Platform costs_: The underlying platform usage costs for running the Actor, calculated using the same unit pricing as PPR.
105+
106+
Only paid user activity is included in profit calculations.
107+
108+
#### How to set pricing for PPE
109+
110+
1. _Understand your costs_: Analyze resource usage (e.g CPU, memory, proxies, external APIs) and identify cost drivers
111+
1. _Define clear events_: break your Actor's functionality into measurable, chargeable events.
112+
1. _Common use cases_:
113+
1. _For scraping_: combine Actor start and dataset items pricing to reflect setup and per-result cost.
114+
1. _Beyond scraping_: Account for intergrations with external systems or external API calls.
115+
1. _External API costs_: Account for additional processing costs.
116+
1. _Test your pricing_: Run your Actor and analyze cost-effectiveness using a special dataset.
117+
1. _Communicate value_: Ensure pricing reflects the value provided and is competetive.
118+
119+
#### Best practices for PPE Actors
120+
121+
- Set memory limits in your [`actor.json`](/platform/actors/development/actor-definition/actor-json) file to control platform usage costs
122+
- Avoid duplicate charges by not calling the start Actor event during migration.
123+
- Ensure users are not charged beyond their set maximum. The [`ChargingManager`](https://github.com/metalwarrior665/actor-charge-manager-poc) or our SDKs ([JS](/sdk/js/reference/class/ChargingManager) and [Python](/sdk/python/reference/class/ChargingManager)) can handle this logic.
124+
- Use idempotency keys in API calls to prevent double charges.
125+
- Try to limit the number of evernt. Fewer events makes it easier for users to understand your pricing.
126+
- Try to make your event have tangible artifacts that users can see and understand (this might be not possible when using external APIs) i.e:
127+
- Get a record
128+
- Save it to dataset
129+
- etc.
130+
131+
:::note `ChargingManager` usage
132+
133+
Use our [`ChargingManager`](https://github.com/metalwarrior665/actor-charge-manager-poc) or SDKs ([JS](/sdk/js/reference/class/ChargingManager) and, [Python](/sdk/python/reference/class/ChargingManager) 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.
134+
135+
You can also choose not to use it, but then you must handle API integration and possible edge cases manually. You can use `ChargingManager` code as a reference.
136+
137+
:::
138+
82139
## Setting up monetization
83140

84141
Navigate to your [Actor page](https://console.apify.com/actors?tab=my) in Apify Console, choose Actor that you want to monetize, and select the Publication tab.
85142
![Monetization section](./images/monetization-section.png)
86143
Open the Monetization section and complete your billing and payment details.
87144
![Set up monetization](./images/monetize_actor_set_up_monetization.png)
88-
Follow the monetization wizard to configure. Follow the monetization wizard to configure your pricing model.
145+
Choose the pricing model for your Actor.
89146
![Monetization wizard](./images/monetization_wizard.png)
147+
Follow the monetization wizard to configure your pricing model.
148+
<Tabs>
149+
<TabItem value="Rental" label="Rental">
150+
![rental moentization wizard](./images/rental-wizard.png)
151+
</TabItem>
152+
<TabItem value="Pay-per-result" label="Pay-per-result">
153+
![ppr moentization wizard](./images/ppr-wizard.png)
154+
</TabItem>
155+
<TabItem value="Pay-per-event" label="Pay-per-event">
156+
![ppe moentization wizard](./images/ppe-wizard.png)
157+
</TabItem>
158+
</Tabs>
90159

91160
## Changing monetization
92161

0 commit comments

Comments
 (0)