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
@@ -136,7 +136,7 @@ Use our [SDKs](/sdk) (JS and, Python or use [`apify actor charge`](/cli/docs/nex
136
136
137
137
### Use synthetic start event `apify-actor-start`
138
138
139
-
:::info Synthetic Actor recommended
139
+
:::info Synthetic Actor start event recommended
140
140
141
141
We recommend using the synthetic Actor start event in PPE Actors. It benefits both you and your users.
142
142
@@ -179,13 +179,26 @@ Your Actor might already have a start event defined, such as `actor-start` or an
179
179
180
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
181
182
+
### Use synthetic default dataset item event `apify-default-dataset-item`
183
+
184
+
The `apify-default-dataset-item` synthetic event charges users for each item written to the run's default dataset. It lets you align PPE pricing with per-result use cases without adding charging code to your Actor.
185
+
186
+
This event simplifies migration from pay-per-result (PPR) Actors to the pay-per-event (PPE) model. No code changes are required.
187
+
188
+
#### How the synthetic default dataset item event works
189
+
190
+
- Apify automatically charges this event whenever your Actor writes an item to the default dataset (for example, when using `Actor.pushData`).
191
+
- No code changes are required to charge this event.
192
+
- You can remove the event in Apify Console if you don't want automatic charging for default dataset items. If you remove it, default dataset writes will no longer be charged automatically.
193
+
- The event applies only to the default dataset of the run. Writes to other (non-default) datasets are not charged by this synthetic event.
194
+
182
195
### Set memory limits
183
196
184
197
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
198
186
199
```json
187
200
{
188
-
"actorSpecification": 1,
201
+
"actorSpecification": 1,
189
202
"name": "name-of-my-scraper",
190
203
"version": "0.0",
191
204
"minMemoryMbytes": 512,
@@ -213,15 +226,15 @@ import { Actor } from 'apify';
213
226
214
227
constprocessUrl=async (url) => {
215
228
constresponse=awaitfetch(url);
216
-
229
+
217
230
if (response.status===404) {
218
231
// Charge for the work done and return error item in one call
219
232
awaitActor.pushData({
220
233
url: url,
221
234
error:"404",
222
235
errorMessage:"Page not found"
223
236
}, 'scraped-result');
224
-
237
+
225
238
return;
226
239
}
227
240
@@ -232,7 +245,7 @@ await Actor.init();
232
245
233
246
constinput=awaitActor.getInput();
234
247
const { urls } = input;
235
-
248
+
236
249
for (consturlof urls) {
237
250
awaitprocessUrl(url);
238
251
}
@@ -251,30 +264,30 @@ import requests
251
264
252
265
asyncdefprocess_url(url):
253
266
response = requests.get(url)
254
-
267
+
255
268
if response.status_code ==404:
256
269
# Charge for the work done and return error item in one call
257
270
await Actor.push_data({
258
271
'url': url,
259
272
'error': '404',
260
273
'errorMessage': 'Page not found'
261
274
}, 'scraped-result')
262
-
275
+
263
276
return
264
277
265
278
# Rest of the process_url function
266
279
267
280
asyncdefmain():
268
281
await Actor.init()
269
-
282
+
270
283
input_data =await Actor.get_input()
271
284
urls = input_data.get('urls', [])
272
-
285
+
273
286
for url in urls:
274
287
await process_url(url)
275
-
288
+
276
289
# Rest of the Actor logic
277
-
290
+
278
291
await Actor.exit()
279
292
```
280
293
@@ -294,7 +307,7 @@ However, we acknowledge that some events don't produce tangible results (such as
294
307
Examples:
295
308
296
309
-_`post` event_: Each charge adds one social media post to the dataset
297
-
-_`profile` event_: Each charge adds one user profile to the dataset
310
+
-_`profile` event_: Each charge adds one user profile to the dataset
298
311
-_`processed-image` event_: Each charge adds one processed image to the dataset
299
312
-_`ai-analysis` event_: Each charge processes one document through an AI workflow (no tangible output, but valuable processing)
0 commit comments