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
Copy file name to clipboardExpand all lines: apify-api/openapi/paths/actor-runs/actor-runs@{runId}@charge.yaml
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,12 @@ post:
7
7
The event you are charging for must be one of the configured events in your Actor. If the Actor is not set up as pay per event, or if the event is not configured,
8
8
the endpoint will return an error. The endpoint must be called from the Actor run itself, with the same API token that the run was started with.
9
9
10
+
:::info Learn more about pay-per-event pricing
11
+
12
+
For more details about pay-per-event (PPE) pricing, refer to our [PPE documentation](/platform/actors/publishing/monetize/pay-per-event).
Copy file name to clipboardExpand all lines: sources/academy/platform/get_most_of_actors/store_basics/how_actor_monetization_works.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,11 @@ Monetizing your Actor on the Apify platform involves several key steps:
33
33
- 2nd user starts their trial but pays next month.
34
34
- 3rd user on a free plan finishes the trial without upgrading to a paid plan and can’t use the Actor further.
35
35
36
-
Learn more about the rental pricing model in our [documentation](/platform/actors/publishing/monetize#rental-pricing-model).
36
+
:::info Rental pricing details
37
+
38
+
If you want more details about rental pricing, refer to our [rental pricing documentation](/platform/actors/publishing/monetize/rental).
39
+
40
+
:::
37
41
38
42
### Pay-per-result pricing model
39
43
@@ -49,7 +53,11 @@ Learn more about the rental pricing model in our [documentation](/platform/actor
49
53
- Dataset storage: $1 per 1,000 GB-hours
50
54
-_Example_: you set a price of $1 per 1,000 results. Two users generate 50,000 and 20,000 results, paying $50 and $20, respectively. If the platform usage costs are $5 and $2, your profit is $49.
51
55
52
-
Learn more about the pay-per-result pricing model in our [documentation](/platform/actors/publishing/monetize#pay-per-result-pricing-model).
56
+
:::info Pay-per-result details
57
+
58
+
If you want more details about PPR pricing, refer to our [PPR documentation](/platform/actors/publishing/monetize/pay-per-result).
59
+
60
+
:::
53
61
54
62
### Pay-per-event pricing model
55
63
@@ -77,7 +85,11 @@ Learn more about the pay-per-result pricing model in our [documentation](/platfo
77
85
- This comes up to $1.625 of total revenue
78
86
- That means if platform usage costs are $0.365 for user A and $0.162 for user B your profit is $4.748
79
87
80
-
Learn more about the pay-per-event pricing model in our [documentation](/platform/actors/publishing/monetize#pay-per-event-pricing-model).
88
+
:::info Pay-per-event details
89
+
90
+
If you want more details about PPE pricing, refer to our [PPE documentation](/platform/actors/publishing/monetize/pay-per-event).
@@ -16,11 +16,11 @@ The PPE pricing model offers a flexible monetization option for Actors on Apify
16
16
17
17
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.
18
18
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).
19
+
The details on how your cost is computed can be found in [Example of a PPE pricing](#example-of-a-ppe-pricing).
20
20
21
21
:::tip Additional benefits
22
22
23
-
Actors that implement PPE pricing receive additional benefits, including increased visibility in Apify Store and enhanced discoverability for users looking for monetized solutions.
23
+
Actors that implement PPE pricing receive additional benefits, including increased visibility in Apify Store and enhanced discoverability.
24
24
25
25
:::
26
26
@@ -132,44 +132,36 @@ When using [Crawlee](https://crawlee.dev/), use `crawler.autoscaledPool.abort()`
132
132
133
133
## Best practices for PPE Actors
134
134
135
-
Use our SDKs ([JS](/sdk/js/)and, [Python](/sdk/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.
135
+
Use our [SDKs](/sdk) (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. SDKs help you handle pricing, usage tracking, idempotency keys, API errors, and, event charging via an API. You can also choose not to use it, but then you must handle API integration and possible edge cases manually.
136
136
137
-
You can also choose not to use it, but then you must handle API integration and possible edge cases manually.
138
-
139
-
### Set memory limits
140
-
141
-
Set memory limits using `minMemoryMbytes` and `maxMemoryMbytes` in your [`actor.json`](https://docs.apify.com/platform/actors/development/actor-definition/actor-json) file to control platform usage costs.
142
-
143
-
```json
144
-
{
145
-
"actorSpecification": 1,
146
-
"name": "name-of-my-scraper",
147
-
"version": "0.0",
148
-
"minMemoryMbytes": 512,
149
-
"maxMemoryMbytes": 1024,
150
-
}
151
-
```
137
+
### Use synthetic start event `apify-actor-start`
152
138
153
-
:::note Memory requirements for browser-based scraping
139
+
:::info Synthetic Actor recommended
154
140
155
-
When using browser automation tools like Puppeteer or Playwright for web scraping, increase the memory limits to accommodate the browser's memory usage.
141
+
We recommend using the synthetic Actor start event in PPE Actors. It benefits both you and your users.
156
142
157
143
:::
158
144
159
-
### Use synthetic start event `apify-actor-start`
160
-
161
-
This event is automatically charged by the Apify platform when an Actor is started or resurrected.
145
+
Starting an Actor takes time, and creates additional cost for the Actor creator, because the profit equals revenue minus platform costs.
162
146
163
-
Users of your Actor are charged one event for each GB of memory used by the Actor (at least one event per run). We _strongly_ suggest setting the price of this event to $0.0001 to remain competitive in the Store and attractive for your customers. If you define this event, you also save 5 seconds of Actor runtime from each Actor run, which won't be deducted from your payout profits.
147
+
One of the options to charge for the time spent on starting the Actor is to charge an “Actor start” event. Unfortunately, this makes your Actor comparably expensive with other tools on the market (outside of [Apify Store](/platform/console/store)) that do not incur this startup cost.
164
148
165
-
:::note Automatic charging of synthetic start event
149
+
We want to make it easier for Actor creators to stay competitive, but also help them to be profitable. Therefore, we have the Apify Actor synthetic start event`apify-actor-start`. This event is enabled by default for all new PPE Actors, and when you use it Apify will cover the compute unit cost of the first 5 seconds of every Actor run.
166
150
167
-
You must _not_ manually charge for the synthetic start event (`apify-actor-start`) in your Actor code.
151
+
The default price of the event is set intentionally low. This pricing means that the free 5 seconds of compute we provide costs us more than the revenue generated from the event. We've made this investment to _support our creator community_ by reducing your startup costs while keeping your Actors competitively priced for users.
168
152
169
-
If you attempt to charge this event yourself, the operation will fail.
170
-
This event is _always_ charged automatically by the Apify platform whenever your Actor starts or is resurrected.
153
+
#### How the synthetic start event works
171
154
172
-
:::
155
+
- The Apify Actor start event is _automatically enabled_ for all new PPE Actors. For existing Actors, you can enable it in Apify Console.
156
+
- Apify _automatically charges_ the event.
157
+
- You must _not_ manually charge for the synthetic start event (`apify-actor-start`) in your Actor code. If you attempt to charge this event yourself, the operation will fail.
158
+
- The default price of the event is _$0.00005_, which equals _$0.05 per 1,000 starts_. We recommend keeping the default price to keep your Actors competitive.
159
+
- The number of events charged _depends on the memory_ of the Actor run. Up to and including 1 GB of RAM, the event is charged once. Then it's charged once for each extra GB of memory. For example:
160
+
- 128 MB RAM: 1 event, $0.00005
161
+
- 1 GB RAM: 1 event, $0.00005
162
+
- 4 GB RAM: 4 events, $0.0002
163
+
- You can increase the price of the event if you wish, but you _won't get more free compute_.
164
+
- You can delete the event if you wish, but if you do, you will _lose the free 5 seconds_ of compute.
173
165
174
166
#### Synthetic start event for new Actors
175
167
@@ -179,18 +171,40 @@ For new Actors, this event is added automatically as you can see on the followin
179
171
180
172
#### Synthetic start event for existing Actors
181
173
182
-
If you have existing Actors, you can add this event manually in Apify Console.
174
+
If you have existing Actors, you can add this event manually in Apify Console in the **Publication** tab.
183
175
184
176
#### Synthetic start event for Actors with start event
185
177
186
178
Your Actor might already have a start event defined, such as `actor-start` or another variant of the event name. In this case, you can choose whether to use the synthetic start event or keep the existing start event.
187
179
188
-
If you want to use the synthetic start event, remove the existing start event from your Actor and add the synthetic start event in Apify Console.
180
+
If you want to use the synthetic start event, remove the existing start event from your Actor and add the synthetic start event in Apify Console in the **Publication** tab.
181
+
182
+
### Set memory limits
183
+
184
+
Set memory limits using `minMemoryMbytes` and `maxMemoryMbytes` in your [`actor.json`](https://docs.apify.com/platform/actors/development/actor-definition/actor-json) file to control platform usage costs.
185
+
186
+
```json
187
+
{
188
+
"actorSpecification": 1,
189
+
"name": "name-of-my-scraper",
190
+
"version": "0.0",
191
+
"minMemoryMbytes": 512,
192
+
"maxMemoryMbytes": 1024,
193
+
}
194
+
```
195
+
196
+
:::note Memory requirements for browser-based scraping
197
+
198
+
When using browser automation tools like Puppeteer or Playwright for web scraping, increase the memory limits to accommodate the browser's memory usage.
199
+
200
+
:::
189
201
190
202
### Charge for invalid input
191
203
192
204
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
205
206
+
The snippet below shows how you can charge for invalid inputs using `Actor.pushData` when a dataset item is created and the `scraped-result` event is charged.
207
+
194
208
<TabsgroupId="main">
195
209
<TabItemvalue="JavaScript"label="JavaScript">
196
210
@@ -279,9 +293,9 @@ However, we acknowledge that some events don't produce tangible results (such as
279
293
280
294
Examples:
281
295
282
-
-_`scraped-product` event_: Each charge adds one product record to the dataset
283
-
-_`processed-image` event_: Each charge adds one processed image to the dataset
284
-
-_`extracted-review` event_: Each charge adds one review to the dataset
296
+
-_`post` event_: Each charge adds one social media post to the dataset
297
+
-_`profile` event_: Each charge adds one user profile to the dataset
298
+
-_`processed-image` event_: Each charge adds one processed image to the dataset
285
299
-_`ai-analysis` event_: Each charge processes one document through an AI workflow (no tangible output, but valuable processing)
286
300
287
301
:::note Additional context
@@ -294,35 +308,97 @@ You can display a status message or push a record to the dataset to inform users
294
308
295
309
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
310
297
-
## Example of a PPE pricing model
311
+
## Example of a PPE pricing
298
312
299
-
You make your Actor PPE and set the following pricing:
313
+
You create a social media monitoring Actor with the following pricing:
300
314
301
-
-_`actor-start` event_: $0.10 per start
302
-
-_`scraped-product` event_: $0.01 per product
303
-
-_`scraped-product-detail` event_: $0.05 per detail
304
-
-_`ai-analysis` event_: $0.15 per analysis
315
+
-`post`: $0.002 per post - count every social media post you extract.
316
+
-`profile`: $0.005 per profile - count every user profile you extract.
317
+
-`sentiment-analysis`: $0.01 per post - count every post analyzed for sentiment, engagement metrics, and content classification using external LLM APIs.
305
318
306
-
During the first month, three users use your Actor:
319
+
:::info Fixed pricing vs. usage-based pricing
307
320
308
-
-_User 1 (paid plan)_: Starts Actor 5 times, scrapes 1,000 products, makes 50 product details, runs 30 AI analyses
Your profit and costs are computed _only from the first two users_ since they are on Apify paid plans.
390
+
391
+
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.
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.
401
+
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.
0 commit comments