API Reference
Actor API
Technical details of the Newsletter AI Agent Apify Actor API
Newsletter AI Agent Actor API
This document provides technical details about the Newsletter AI Agent Apify Actor API, including input schema, output format, and usage examples.
Actor Input Schema
The Newsletter AI Agent Actor accepts the following input parameters:
Parameters
Parameter | Type | Description | Required | Default |
---|---|---|---|---|
topic | string | The topic for the newsletter | No | ”I want to know everything about AI agents – current news, AI agentic platforms and frameworks, and companies in this field.” |
Actor Output Schema
The actor outputs the generated newsletter in the following format:
Output Fields
Field | Type | Description |
---|---|---|
topic | string | The topic that was used to generate the newsletter |
content | string | The generated newsletter content in Markdown format |
status | string | The status of the generation process (“success” or “error”) |
timestamp | string | ISO 8601 formatted timestamp of when the newsletter was generated |
Error Output Schema
If an error occurs during newsletter generation, the actor will output:
Error Fields
Field | Type | Description |
---|---|---|
topic | string | The topic that was used (if available) |
error | string | Error message describing what went wrong |
status | string | Always “error” for error outputs |
timestamp | string | ISO 8601 formatted timestamp of when the error occurred |
Usage Examples
Running the Actor via Apify Console
- Navigate to the Newsletter AI Agent on the Apify platform
- Set the
topic
input parameter to your desired topic - Click “Run” to start the actor
- Wait for the actor to complete
- View the results in the “Dataset” tab
Running the Actor via Apify API Client (Python)
Running the Actor via Apify API Client (JavaScript)
Actor Lifecycle
- The actor initializes and loads environment variables
- It processes the input parameters (using default if none provided)
- It creates a NewsletterCrew instance with the necessary agents
- The Researcher Agent gathers information about the topic
- The Writer Agent transforms the research into a newsletter draft
- The Editor Agent reviews and improves the draft
- The final newsletter is returned as output
Resource Usage
The Newsletter AI Agent performs web scraping and uses large language models, which can be resource-intensive. The actor typically takes 3-5 minutes to generate a newsletter, depending on the complexity of the topic and the amount of information available.
Next Steps
- Learn about the agents that power the Newsletter AI Agent
- Explore the tools used by the agents
- See how the Newsletter AI Agent generates newsletters