You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -191,6 +191,14 @@ If you want to use the synthetic start event, remove the existing start event fr
191
191
192
192
Charge for things like URLs that appear valid but lead to errors (like 404s) since you had to open the page to discover the error. Return error items with proper error codes and messages instead of failing the entire Actor run.
193
193
194
+
:::info One call vs two calls
195
+
196
+
The following code snippets show the single call option to both return error item and charge for the work done.
197
+
198
+
If you prefer to return error item and charge for the work done in two calls, you can use the two calls option where you charge for the work done with `Actor.charge( ... )` and return the error item with `Actor.pushData( ... )`.
199
+
200
+
:::
201
+
194
202
<TabsgroupId="main">
195
203
<TabItemvalue="JavaScript"label="JavaScript">
196
204
@@ -294,35 +302,158 @@ You can display a status message or push a record to the dataset to inform users
294
302
295
303
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.
296
304
297
-
## Example of a PPE pricing model
298
-
299
-
You make your Actor PPE and set the following pricing:
305
+
## Examples of a PPE pricing model
306
+
307
+
### Example: simple PPE pricing
308
+
309
+
-`scraped-product`: $0.01 per product - count every product record you return.
310
+
-`scraped-product-detail`: $0.05 per detail - count every enriched product detail you provide.
The platform usage costs are just examples, but you can see the actual costs in the [Computing your costs for PPE and PPR Actors](/platform/actors/publishing/monetize/pricing-and-costs#computing-your-costs-for-ppe-and-ppr-actors) section.
The platform usage costs are just examples, but you can see the actual costs in the [Computing your costs for PPE and PPR Actors](/platform/actors/publishing/monetize/pricing-and-costs#computing-your-costs-for-ppe-and-ppr-actors) section.
This example illustrates the key trade-off of PPE pricing: while it's harder for users to predict exact costs upfront, it provides developers with a safer and more scalable revenue model that grows with actual usage.
322
453
323
454
## Event names
324
455
325
-
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.
456
+
If you need to know your event names, you can retrieve the list of available pricing event names using the [Get Actor](https://apify.com/docs/api/v2/act-get) API endpoint.
Copy file name to clipboardExpand all lines: sources/platform/actors/publishing/monetize/pay_per_result.mdx
+72-13Lines changed: 72 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,16 @@ where:
35
35
36
36
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.
37
37
38
+
## PPR vs PPE
39
+
40
+
PPR charges based on the number of results produced. PPE lets you define pricing for individual events, and help you to make your pricing more flexible. You can charge for specific events directly from your Actor by calling the PPE charging API.
41
+
42
+
:::info Learn more about PPE
43
+
44
+
If you want to learn more about PPE, please refer to the [Pay per event](/platform/actors/publishing/monetize/pay-per-event) section.
45
+
46
+
:::
47
+
38
48
## Best practices for PPR Actors
39
49
40
50
To ensure profitability, check the following best practices.
@@ -201,19 +211,68 @@ This ensures that every run generates at least one result, guaranteeing that use
201
211
202
212
## Example of PPR pricing model
203
213
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:
205
-
206
-
-_User 1 (paid plan)_: Gets 50,000 results, costing them $50
207
-
-_User 2 (paid plan)_: Gets 20,000 results, costing them $20
208
-
-_User 3 (free plan)_: Gets 5,000 results, costing them $0
209
-
210
-
Let's say the underlying platform usage for the first user is $5, for the second $2, and for the third $0.5.
211
-
212
-
Your profit is computed only from the first two users, since they are on Apify paid plans. The revenue breakdown is:
213
-
214
-
-_Total revenue_: $50 + $20 = $70
215
-
-_Total underlying cost_: $5 + $2 = $7
216
-
-_Your profit_: 80% of revenue minus costs = 0.8 × $70 - $7 = $49
214
+
You make your Actor PPR and set the price to be _$1/1,000 results_. During the first month, three users use your Actor.
215
+
216
+
#### Pricing breakdown by user
217
+
218
+
<table>
219
+
<thead>
220
+
<tr>
221
+
<th>User</th>
222
+
<thstyle={{whiteSpace: 'nowrap'}}>Plan</th>
223
+
<thstyle={{width: '35%'}}>Results</th>
224
+
<thstyle={{width: '45%'}}>Charges</th>
225
+
<thstyle={{whiteSpace: 'nowrap'}}>Total</th>
226
+
<thstyle={{whiteSpace: 'nowrap'}}>Cost</th>
227
+
</tr>
228
+
</thead>
229
+
<tbody>
230
+
<tr>
231
+
<td>1</td>
232
+
<tdstyle={{whiteSpace: 'nowrap'}}>Paid plan</td>
233
+
<td>
234
+
<div>50,000 results</div>
235
+
</td>
236
+
<td>
237
+
<div>50,000 ÷ 1,000 × $1.00 = $50.00</div>
238
+
</td>
239
+
<td><strong>$50.00</strong></td>
240
+
<td>$5.00</td>
241
+
</tr>
242
+
<tr>
243
+
<td>2</td>
244
+
<tdstyle={{whiteSpace: 'nowrap'}}>Paid plan</td>
245
+
<td>
246
+
<div>20,000 results</div>
247
+
</td>
248
+
<td>
249
+
<div>20,000 ÷ 1,000 × $1.00 = $20.00</div>
250
+
</td>
251
+
<td><strong>$20.00</strong></td>
252
+
<td>$2.00</td>
253
+
</tr>
254
+
<tr>
255
+
<td>3</td>
256
+
<tdstyle={{whiteSpace: 'nowrap'}}>Free plan</td>
257
+
<td>
258
+
<div>5,000 results</div>
259
+
</td>
260
+
<td>
261
+
<div>5,000 ÷ 1,000 × $1.00 = $5.00</div>
262
+
</td>
263
+
<td><strong>$0.00</strong></td>
264
+
<td>$0.50</td>
265
+
</tr>
266
+
</tbody>
267
+
</table>
268
+
269
+
The platform usage costs are just examples, but you can see the actual costs in the [Computing your costs for PPE and PPR Actors](/platform/actors/publishing/monetize/pricing-and-costs#computing-your-costs-for-ppe-and-ppr-actors) section.
0 commit comments