emsinhvien
emsinhvien2d ago

How to set RAM when calling an Actor via API (Python client)?

Hi, I’m running the novi/fast-tiktok-api Actor from my Python app using the Apify Python Client. Here is a simplified version of my code: from apify_client import ApifyClient client = ApifyClient("APIFY_TOKEN") run_input = { "limit": 10, "region": "JP", "type": "TREND" } run = client.actor("novi/fast-tiktok-api").call( run_input=run_input ) I would like to set the RAM (memory) for the Actor run, for example 128 MB or 256 MB. I tried passing memory=128 directly to .call(), but I got the error: ActorClient.call() got an unexpected keyword argument 'memory' Could you please show me the correct way to configure RAM (memory) when calling an Actor from the Python client? Thanks a lot! 🙏
1 Reply
xMiso
xMiso2d ago
First result from Google explicitly says: You can set the memory for a given Actor run by using the optional named argument memory_mbytes in the call() method. So, for example, you can run Actor with 8GB of RAM by calling client.actor("aYG0l9s7dbB7j3gbS").call(run_input=run_input, memory_mbytes=8192) ...

Did you find this page helpful?