Retrieving "Maximum Charged Results" via API #346
Replies: 4 comments
-
Hi! According to the documentation (https://docs.apify.com/platform/actors/development/programming-interface/environment-variables#system-environment-variables), If the run has no configured limit, the variable will be empty, which is the correct behavior - you're supposed to let the Actor run and the platform will stop it in case the user runs out of credit. |
Beta Was this translation helpful? Give feedback.
-
Is Apify SDK for Python required for the platform to stop the actor? This doesn't seem to work with the Client. Since I'm running it in DEVELOPMENT mode, I'm not being charged, and it allows exceeding the limit. I'm not entirely sure if this happens automatically. There should be a way to determine the maximum result a user can enter in the run options based on their remaining credit. In the console interface, this value is displayed in real-time, ensuring that users do not exceed their available limit. |
Beta Was this translation helpful? Give feedback.
-
This is handled entirely by the platform, the SDK should not be a requirement. If you're not being charged, then you cannot exceed the limit - I'm not sure how else it should behave.
Problem is, there cannot really be a way - this number can change while your Actor is running - imagine that the user runs multiple paid Actors at once - then their "limit" is highly unpredictable. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your help! |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a question regarding PPR actors.
In the Apify Console, users can manually set the "Maximum charged results" value in the Run Options section. The maximum allowed value is automatically calculated based on the actor’s pricing and the user’s remaining monthly limit, ensuring they cannot enter a value exceeding their available balance.
However, I couldn't find a way to retrieve this value using the Apify Python Client API. For example:
If the user manually sets a "Maximum charged results" value, maxItems returns the specified number. However, if it is set to "No limit", the value returned is None.
I also tried checking the following environment variable but got the same result:
As a workaround, I found a manual solution by calculating the maximum number of results a user can retrieve based on their balance. This involves checking the user’s monthly limit, their remaining balance, and the actor’s per-result pricing, then performing the calculation externally. While this works, I was wondering if there is a more direct way to obtain this value.
Is there an API method that provides this pre-calculated "Maximum charged results" value, or is manual calculation the only option?
I would appreciate any guidance on this.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions