What's the correct way to not allow free
What's the correct way to not allow free users $5 from running my actor?
10 Replies
you can block or limit them in your Actor code.
Detect if the user is on a free plan
Use the APIFY_USER_IS_PAYING env var (or SDK helper) in your Actor
using the sdk I get an error

import { Actor } from 'apify';
await Actor.init();
const { userIsPaying } = Actor.getEnv(); // true = paying plan, false = free [User paying env]
if (!userIsPaying) {
// Block free users completely
throw new Error('This Actor is only available for paying Apify users.');
}
// …rest of your logic…
await Actor.exit();
Migration guide | Platform | Apify Documentation
How to migrate your Actor to limited permissions. Common migration paths, code examples, and common issues.
do I need to configure the settings of the actor as full permissions or limited permissions?
Also is this snippet outdated?
instead of blocking free users entirely, you can still allow them to run the Actor but with limits.
yes I want to allow them to run the actor with a limited set of filters and if they are paying they can fully use all the filters
but I need a proper way to detect free users
You can 100% do that. The proper, supported way to detect free vs paying users is to use Apify’s built-in flag:
APIFY_USER_IS_PAYING → accessible via Actor.getEnv().
const { userIsPaying } = Actor.getEnv();
This works even with limited permissions and doesn’t require calling the user API.
got it, nice
is userIsPaying a string or a boolean
userIsPaying is a boolean not a string.
You can also create a small dummy Actor to test this before adding it to your main one.
That way you can confirm how userIsPaying behaves for free vs paying accounts without publishing or affecting your real product Actor. After you verify the behavior, just move the same logic into your main Actor.