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_result.mdx
+84-27Lines changed: 84 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,37 +48,69 @@ Set memory limits using `minMemoryMbytes` and `maxMemoryMbytes` in your [`actor.
48
48
"actorSpecification": 1,
49
49
"name": "name-of-my-scraper",
50
50
"version": "0.0",
51
-
"minMemoryMbytes": 256,
52
-
"maxMemoryMbytes": 4096,
51
+
"minMemoryMbytes": 512,
52
+
"maxMemoryMbytes": 1024,
53
53
}
54
54
```
55
55
56
+
:::note Memory requirements for browser-based scraping
57
+
58
+
When using browser automation tools like Puppeteer or Playwright for web scraping, increase the memory limits to accommodate the browser's memory usage.
59
+
60
+
:::
61
+
56
62
### Implement the `ACTOR_MAX_PAID_DATASET_ITEMS` check
57
63
58
64
This check prevents your Actor from generating more results than the user has paid for, protecting both you and your users from unexpected costs.
59
65
60
-
The `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable contains the user-set limit on returned results for paid-per-result Actors. Do not exceed this limit.
66
+
The `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable contains the user-set limit on returned results for paid-per-result Actors. Do not exceed this limit. You can see the example implementation in the following code snippets.
You can find the whole code of implementing this check in this [example](https://github.com/metalwarrior665/max-paid-items-example/blob/master/src/push-data.ts).
113
-
114
171
### Test your Actor
115
172
116
173
Test your Actor with various result volumes to determine optimal pricing. Start with minimal datasets (1-100 results) to understand your base costs and ensure the Actor works correctly with small inputs. Then test with typical usage volumes (1,000-10,000 results) to simulate real-world scenarios and identify any performance bottlenecks.
0 commit comments