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: sources/platform/actors/publishing/monetize/pay_per_event.mdx
+28-20Lines changed: 28 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,33 +132,21 @@ 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 ([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. 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 TL;DR:
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`
145
+
Starting an Actor takes time, and creates additional cost for the Actor creator, because the profit equals revenue minus platform costs.
160
146
161
-
This event is automatically charged by the Apify platform when an Actor is started or resurrected.
147
+
One of the options to charge for the time spent on starting the Actor is to charge an “Actor start” event. Let’s say $1 for 1000 Actor starts. 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.
148
+
149
+
We want to make it easier for Apify Store creators to stay competitive. To do that, we have the Apify Actor synthetic start event `apify-actor-start`.
162
150
163
151
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.
164
152
@@ -187,6 +175,26 @@ Your Actor might already have a start event defined, such as `actor-start` or an
187
175
188
176
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.
189
177
178
+
### Set memory limits
179
+
180
+
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.
181
+
182
+
```json
183
+
{
184
+
"actorSpecification": 1,
185
+
"name": "name-of-my-scraper",
186
+
"version": "0.0",
187
+
"minMemoryMbytes": 512,
188
+
"maxMemoryMbytes": 1024,
189
+
}
190
+
```
191
+
192
+
:::note Memory requirements for browser-based scraping
193
+
194
+
When using browser automation tools like Puppeteer or Playwright for web scraping, increase the memory limits to accommodate the browser's memory usage.
195
+
196
+
:::
197
+
190
198
### Charge for invalid input
191
199
192
200
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.
0 commit comments