Skip to content

Commit

Permalink
docs(academy): add example code link to ACTOR_MAX_PAID_DATASET_ITEMS …
Browse files Browse the repository at this point in the history
…section
  • Loading branch information
metalwarrior665 committed Aug 21, 2024
1 parent e1d2d31 commit 46aa7dd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ You can read more about Actors in the Store and different pricing models from th

1. Set `minMemoryMbytes` and `maxMemoryMBytes` in [`actor.json`](https://docs.apify.com/platform/actors/development/actor-definition/actor-json) in your Actor folder. If users use more memory than you counted with in your price estimations, their runs will generate more underlying platform usage and will cost you more, which might affect your profit margin.

2. Always check `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable in your Actor code. Your Actor should never return more than `ACTOR_MAX_PAID_DATASET_ITEMS` results, because the user will be not charged for more and you could start generating losses. This variable is configurable by the user to limit how much the run will cost them.
2. Always check `ACTOR_MAX_PAID_DATASET_ITEMS` environment variable in your Actor code. Your Actor should never return more than `ACTOR_MAX_PAID_DATASET_ITEMS` results, because the user will be not charged for more and you could start generating losses. This variable is configurable by the user to limit how much the run will cost them. You can copy paste [this code](https://github.com/metalwarrior665/max-paid-items-example/blob/master/src/push-data.ts#L12) to your project to make pushing data aware of the max paid dataset items.

3. To set your price per 1,000 results, we recommend running your Actor several times to see the average cost per 1,000 runs that is available in the Apify Console when you open run detail. Usually runs returning only 1 result are much more expensive in the underlying platform costs than runs returning many results, due to fixed costs at Actor startups. Hence, try runs with different numbers of results in your experiments to get the best idea about the average costs. Also make sure your runs never return 0 results, e.g. when scraping social network profiles without any videos, return at least the basic profile info.

Expand Down

0 comments on commit 46aa7dd

Please sign in to comment.