# TrendLoom — Research, Content Ideas & Script Packages (`genkenobi/trendloom`) Actor

Turn a topic into source-grounded content ideas or a six-scene script draft in English, German or Turkish. Includes primary research and accepts your channel notes. No YouTube account lookup or metrics; upstream keys included.

- **URL**: https://apify.com/genkenobi/trendloom.md
- **Developed by:** [Burhan Hayber](https://apify.com/genkenobi) (community)
- **Categories:** Videos, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / six-scene script package

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## TrendLoom — Source Research, Content Ideas & Script Packages

Turn a research question into **primary-paper references**, **three original content ideas**, or a **six-scene Short script draft**. TrendLoom searches real primary-paper abstracts through the official Europe PMC API, accepts only explicit commercially reusable CC BY or CC0 license metadata, and preserves their PubMed citation links and attribution. API access and model processing are included: you do **not** need a YouTube or OpenRouter key.

This release does **not** use the YouTube API, fetch channel pages, collect or analyze YouTube metrics, or access private channel analytics. For channel-aware ideas, you may paste a short manual summary and a few recent titles you own or are authorized to share in `styleNotes`. TrendLoom will use them only as context for distinct ideas: no automatic channel lookup, performance estimates, title copying or metric output. Do not paste full transcripts or material you lack permission to use.

### Choose one result

- **`research` — $0.02:** up to three relevant, explicitly licensed primary-paper abstracts, titles, attribution and citation links. No AI generation.
- **`ideas` — $0.05:** source research plus three original topics, titles, hooks, angles, source references and supporting quotations.
- **`package` — $0.10:** source research, three ideas and one six-scene production draft: narration, three title variants, description, tags, thumbnail brief, image/camera prompts and source references. `ideaIndex` chooses one of the ideas generated in this run.

One selected custom result event is charged per successfully delivered result, not per source or per scene. A package costs $0.10 in TrendLoom result charges, not $0.02 + $0.05 + $0.10. The Actor refuses a non-zero `apify-default-dataset-item` event because it would add a second per-item charge. Apify may separately charge its platform-managed `apify-actor-start` event (default $0.00005/run when enabled) and compute usage; those platform fees are not part of the TrendLoom result price. Check the active Apify pricing details and your run spending limit before starting. Upstream model processing is included: no OpenRouter key is required.

### Quick start

```json
{
  "action": "research",
  "query": "sleep memory consolidation",
  "language": "en"
}
```

Use formal research keywords rather than a headline. The default query performs a real source lookup, not a generated demo.

#### Ideas tailored to your channel — manual input

Choose **Three content ideas** and fill in:

- `query`: the scientific topic to research (still required).
- `channelDescription`: your own short description of the channel topic, audience and editorial style (optional, up to 1000 characters).
- `exampleTitles`: up to five previous titles you own or are authorized to share (optional, up to 180 characters each).
- `styleNotes`: additional creative/visual preferences (optional).

The service uses this context to suggest distinct new angles, not to analyze channel performance. **No channel/video link, ID or handle is fetched; no views, subscribers, scores or growth predictions are produced.** The context is not factual evidence: claims still need the licensed primary abstracts. Exact and conservatively detected near-copy titles trigger the existing bounded repair or a clear failure, not silent replacement. This heuristic is not a semantic originality or rights guarantee.

Use your own description or authorized brief notes; do not paste full transcripts, statistics, private data or material you lack permission to process. Existing inputs using only `styleNotes` remain supported. The same optional channel fields can guide the ideas stage of a script package.

Example:

```json
{
  "action": "ideas",
  "query": "sleep memory consolidation",
  "language": "de",
  "channelDescription": "Wissenschaft für neugierige Einsteiger: alltagsnahe Erklärungen, verständlich und ohne Fachjargon.",
  "exampleTitles": ["Warum uns vertraute Gerüche nicht mehr auffallen", "Wie Erinnerungen im Schlaf verändert werden"],
  "styleNotes": "Einfache visuelle Metaphern; ruhige Papieranimation."
}
```

Supported video languages: **English, German, Turkish**. Source abstracts retain their original language. Visual prompts may be English. Supported target durations: 45, 60 or 90 seconds. Durations are planning estimates, including four seconds reserved for an outro—not measured voiceover.

### Output and exports

Each successful run writes **one complete result** to its default dataset and the `OUTPUT` key-value record. Dataset overview columns include action, query, title, source count and idea count. Nested fields retain the sources, ideas, script and warnings. Use JSON export to preserve nested structures.

For script packages, additional files are available in the run's key-value store:

- `PACKAGE.md`: metadata and production package.
- `SCENES.json`: the six-scene draft.
- `PRODUCTION-PROMPT.txt`: a standalone production brief.

Actual citations come from source lookups; they are not invented by the model. Literal-quotation and identifier checks help catch malformed evidence. **These checks do not establish that every generated claim is factually supported.** Read the actual paper, preserve population/method/limitations, and review all narration and visuals before use. Every package is an unapproved draft, even if an automated review passes.

### What is not included

- No rendered video, image generation, audio/TTS, animation or publication.
- No guaranteed factual accuracy, virality, reach, sales or originality clearance.
- No complete systematic literature review or full-paper access. An abstract may omit important qualifications; clinical/medical content is not medical advice.
- No YouTube views, rankings, channel scraping, private analytics or video downloads.
- Not all news, sport or general-interest questions have suitable primary research. If no relevant abstract with an accepted reuse license is found, the run fails clearly rather than inventing sources.

### Limits and reliability

Inputs are bounded: a 3–180-character query, at most 1000 characters each of style notes and channel description, up to five example titles of at most 180 characters each, exactly three generated ideas and exactly six script scenes. Work runs through a budget-guarded TrendLoom service with two concurrent operations and an initial fair-use cap of ten operations per Apify customer per UTC day. Shared upstream/cost limits can temporarily reject new work; such a rejection is not a successful result.

No automatic replay is made after an uncertain service timeout. The service binds each request to its Apify run identity and retains idempotency state to prevent repeated paid work for that run. Start a new run only after inspecting the previous run's status. Upstream source and model availability varies.

### API and integrations

Run this Actor from Apify Console, schedules, Make, n8n, Zapier, the Apify API or an AI agent. Authenticate to Apify with **your Apify API token**, never with a TrendLoom service secret. After publication, use the API tab for exact code examples and URLs.

```bash
curl --request POST \
  --header "Authorization: Bearer $APIFY_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{"action":"research","query":"sleep memory consolidation","language":"en"}' \
  'https://api.apify.com/v2/acts/genkenobi~trendloom/run-sync-get-dataset-items?timeout=420&memory=256&maxTotalChargeUsd=0.11'
```

The result dataset belongs to your Apify run. Keep your token private. Longer scripts can exceed a synchronous client's deadline; use the asynchronous run endpoint and retrieve the dataset after completion if needed.

### Privacy and use terms

By running the Actor, you request processing of the supplied query, manual channel description, title examples, creative notes and selected settings. Do not include secrets, sensitive personal information, confidential manuscripts or material you do not have permission to process.

The Actor uses Apify infrastructure and a developer-operated TrendLoom service. For run authentication, it forwards only the current run's ephemeral limited-permissions Apify token to that fixed HTTPS service; the service uses it to verify this run's Actor ID and user identity, and does not store or log the token. It does not receive your full-account API token. Source keywords are sent to the relevant public literature APIs. For ideas and scripts, your query, channel description, example titles, creative notes, selected abstracts and draft content are sent to OpenRouter and its selected model provider. These third parties have their own privacy policies: [Apify](https://apify.com/privacy-policy), [OpenRouter](https://openrouter.ai/privacy), [Europe PMC](https://europepmc.org/PrivacyNotice).

TrendLoom's separate service keeps completed result payloads for up to seven days for idempotency/recovery, then deletes those payloads. Minimal request identity, authorization and cost-accounting records remain for operation and abuse prevention. It does not read the owner's private Studio storage. Your Apify inputs, logs, datasets and exports are retained according to your Apify account's retention settings, independently of the TrendLoom service. You can delete run storage in Apify; use this Actor's **Issues** tab for support or a service-side deletion request and include only the run ID, not API tokens.

Source results include the index-reported CC BY or CC0 license and available author attribution. Preserve that attribution and the applicable license; check the original paper for the authoritative terms and any third-party exclusions. Missing, non-commercial, no-derivatives or unknown licenses are not accepted. A citation or abstract license is not permission to reproduce unrelated full-paper images or datasets. You are responsible for editorial review, permissions, final production and any publication. TrendLoom is not affiliated with PubMed, Europe PMC, Crossref, YouTube or the cited authors.

# Actor input Schema

## `action` (type: `string`):

One report per run. Research $0.02; three original ideas $0.05; six-scene script package $0.10. Upstream keys are included.

## `query` (type: `string`):

3–180 characters of scientific keywords. Searches Europe PMC for PubMed-indexed primary abstracts with explicit CC BY/CC0 reuse licenses. No YouTube API, channel lookup, metrics or private analytics. Not all subjects have suitable primary sources.

## `language` (type: `string`):

Language for titles, narration and ideas. Source abstracts retain their original language; image prompts may be English.

## `duration` (type: `integer`):

Estimated duration including a reserved four-second outro; no audio or rendered video is produced.

## `channelDescription` (type: `string`):

For ideas and packages: manually describe the channel topic, audience and editorial style in your own words. Use only material you own or are authorized to share. No links, handles, private addresses, full transcripts or performance statistics. Context, not factual evidence. Up to 1000 characters.

## `exampleTitles` (type: `array`):

For ideas and packages: add up to five titles you own or are authorized to share, at most 180 characters each. These are topics to avoid repeating, not templates to copy or performance evidence. No links or statistics. No channel or video is fetched.

## `styleNotes` (type: `string`):

Optional visual and editorial preferences. Existing manual channel notes here remain supported; use the separate channel description and title-example fields for new inputs. Context only; not evidence. Do not paste full transcripts or statistics. Up to 1000 characters.

## `ideaIndex` (type: `integer`):

For package: choose the first, second or third original idea generated in this run. Zero-based index, not a stored private studio draft.

## Actor input object example

```json
{
  "action": "research",
  "query": "sleep memory consolidation",
  "language": "en",
  "duration": 60,
  "channelDescription": "",
  "exampleTitles": [],
  "styleNotes": "",
  "ideaIndex": 0
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `output` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("genkenobi/trendloom").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("genkenobi/trendloom").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call genkenobi/trendloom --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,genkenobi/trendloom"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/92Xhz8TkbaPTyi8Th/builds/i7R0YXkTxp6wSuXhQ/openapi.json
