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
docs: address PR #2263 review feedback on PPE examples
- Fix "single operation" wording to "in one Actor run"
- Move Crawlee note out of ACTOR_MAX_TOTAL_CHARGE_USD admonition into prose
- Removed chargeableWithinLimit mention from prose
- Add chargedCount handling to batch charging example
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: sources/platform/actors/publishing/monetize/pay_per_event.mdx
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,16 +162,16 @@ When using browser automation tools like Puppeteer or Playwright for web scrapin
162
162
163
163
Finish the Actor run once charging reaches the user-configured maximum cost per run. `Actor.charge()` returns a `ChargeResult` object that helps determine when to stop.
164
164
165
-
The `eventChargeLimitReached` property checks if the user's limit allows for another charge of this event. If you have multiple events, use the `chargeableWithinLimit` property to see if other events can still be charged before stopping the Actor.
165
+
The `eventChargeLimitReached` property checks if the user's limit allows for another charge of this event.
Users set a spending limit through the Apify Console. This limit is available in your Actor code as the `ACTOR_MAX_TOTAL_CHARGE_USD`[environment variable](/platform/actors/development/programming-interface/environment-variables). The Apify SDK's `ChargeResult` respects this limit automatically.
170
170
171
-
When using [Crawlee](https://crawlee.dev/), use `crawler.autoscaledPool.abort()` instead of `Actor.exit()` to gracefully finish the crawler.
172
-
173
171
:::
174
172
173
+
When using [Crawlee](https://crawlee.dev/), use `crawler.autoscaledPool.abort()` instead of `Actor.exit()` to gracefully finish the crawler.
174
+
175
175
### Charge per result
176
176
177
177
Charge an event when your Actor produces a data item and check the spending limit before continuing.
@@ -221,7 +221,7 @@ async def main():
221
221
222
222
### Charge for multiple event types
223
223
224
-
Charge multiple event types in a single operation. Each event type must be defined in your Actor's pricing configuration.
224
+
Charge for multiple event types in one Actor run. Each event type must be defined in your Actor's pricing configuration.
225
225
226
226
<TabsgroupId="main">
227
227
<TabItemvalue="JavaScript"label="JavaScript">
@@ -267,7 +267,7 @@ async def main():
267
267
268
268
### Charge for multiple items at once
269
269
270
-
Use the `count` parameter to charge for a batch of items in a single call.
270
+
Use the `count` parameter to charge for a batch of items in a single call. The returned `chargedCount` may be lower than requested if the user's spending limit is reached, so use it to determine how many items to push.
0 commit comments