Apify Proxies Help

hello, i created an actor using the cli, logged in using an api token, then i wrote
await Actor.init();

const proxyConfiguration = await Actor.createProxyConfiguration({
groups: ['RESIDENTIAL'],
});
await Actor.init();

const proxyConfiguration = await Actor.createProxyConfiguration({
groups: ['RESIDENTIAL'],
});
then i passed the proxyConfiguration into
new PuppeteerCrawler({proxyConfig, requestHandler and etc})
new PuppeteerCrawler({proxyConfig, requestHandler and etc})
and then I did await Actor.exit(). when i try to
apify run
apify run
it says that i can't use proxies outside of Actors. could you help me guys, please.
5 Replies
other-emerald
other-emerald•2y ago
For free plan, apify doesn't allows to use apify proxy outside of apify environment. It wouldn't work if you try to run the above code locally unless you a paid subscriber.
fair-rose
fair-roseOP•2y ago
@gtry but isn't wrapping my code in Actor.init() and Actor.exit() activating the apify environment? or how do i "activate it"? do i need to deploy the actor? i am already logged in using the apify cli btw. and what subscription in particular do i need to use proxies outside of apify environment? there is like 4 different plans
other-emerald
other-emerald•2y ago
do i need to deploy the actor? - yes i am already logged in using the apify cli btw. - yes, all you will need to do is apify push to push it to apify and your code will start working as expected and you won't need to subscribe to a paid plan to be able to do that as apify provides free $5 credit/month. It just that in free tier you won't be able to use proxy outside of apify but you can still use proxy if you do apify push.
fair-rose
fair-roseOP•2y ago
@gtry thank you so much i will try it out
MEE6
MEE6•2y ago
@IAN just advanced to level 1! Thanks for your contributions! 🎉

Did you find this page helpful?