You can also run the actor programmatically using the Apify API:
Copy
import osfrom apify_client import ApifyClient# Initialize the ApifyClient with your API tokenclient = ApifyClient(os.getenv('APIFY_API_KEY'))# Start the actor and wait for it to finishrun = client.actor('your-username/newsletter-ai-agent').call({ 'topic': 'AI advancements in healthcare'})# Fetch the actor's outputoutput = client.dataset(run['defaultDatasetId']).list_items().items[0]newsletter_content = output['content']print(newsletter_content)