# Hooklayer – Viral Content Intelligence (`khan.ashifur/hooklayer`) Actor

Hooklayer: viral content intelligence for TikTok & YouTube. Spy on what's working in any niche, score hooks, predict virality, find trending viral templates, and get deep creator breakdowns — 9 read-only AI tools returning evidence-backed JSON. Bring your free Hooklayer API key.

- **URL**: https://apify.com/khan.ashifur/hooklayer.md
- **Developed by:** [Md Ashifur Rahman Khan](https://apify.com/khan.ashifur) (community)
- **Categories:** AI, Social media, Agents
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Hooklayer – Viral Content Intelligence for TikTok & YouTube

Turn any AI agent, workflow, or scraper into a **viral-content strategist**. Hooklayer gives you **7 read-only tools** for scoring hooks, predicting virality, surfacing live trends, finding viral templates, and analyzing creators — all returning **structured JSON with cited evidence** and zero side effects.

This Actor runs the hosted [Hooklayer](https://hooklayer.dev) intelligence engine on Apify, so you can call any Hooklayer tool from a scheduled task, an integration, or another Actor and get the results straight into an Apify dataset.

***

### What Hooklayer does

Short-form content lives or dies in the first two seconds. Hooklayer scores that moment — and the whole video — against real, cited signals instead of guesswork. Every score ships with a `signals[]` array of evidence, a `would_fail_because` counterfactual, and a `quality` health field, so you (or your agent) know *why* a piece of content will or won't pop.

Typical uses:

- **Rank hooks before you publish** — score multiple opening lines and keep the winner.
- **Predict a video's virality** — run an independent, adversarial check with confidence, cost, and action-class breakdowns.
- **Ride live trends** — surface what is spiking right now instead of last month's meta.
- **Reverse-engineer winners** — search viral templates and remix the structure for your niche.
- **Size up a creator** — analyze any TikTok/YouTube account and get a `recommended_chain` of follow-up actions your agent can execute.

Everything is **read-only**: no posting, no mutations, no side effects — safe to run in automated pipelines.

***

### How to use this Actor

1. **Get a free API key.** Sign up at [hooklayer.dev/auth/signup](https://hooklayer.dev/auth/signup) — the free tier is enough to get started. Your key looks like `hl_live_...`.
2. **Discover the tools.** Run the Actor once with **List tools only** enabled to get every tool's name and exact `inputSchema` into the dataset.
3. **Run a tool.** Set **Tool to run** (e.g. `analyze_account`) and **Tool arguments** (the JSON that tool expects), then run.

#### Input

| Field | Type | Description |
|---|---|---|
| `apiKey` | string (secret) | Your Hooklayer API key (`hl_live_...`). Required. |
| `tool` | string | Tool to run, e.g. `analyze_account`. Leave empty to return the tool catalog. |
| `toolInput` | object | Arguments for the tool, as JSON. |
| `listToolsOnly` | boolean | Return the catalog of tools without calling one. |
| `serverUrl` | string | Advanced. Defaults to the hosted `https://hooklayer.dev/api/mcp`. |

#### Example — discover the tools

```json
{
  "apiKey": "hl_live_xxx",
  "listToolsOnly": true
}
```

#### Example — analyze a creator

```json
{
  "apiKey": "hl_live_xxx",
  "tool": "analyze_account",
  "toolInput": { "handle": "@example", "platform": "tiktok" }
}
```

> Field names inside `toolInput` follow each tool's own `inputSchema` — always check the catalog output first.

***

### Output

Each run writes to the default dataset. A tool call returns one record:

```json
{
  "tool": "analyze_account",
  "input": { "handle": "@example", "platform": "tiktok" },
  "isError": false,
  "result": {
    "score": 82,
    "signals": ["..."],
    "would_fail_because": "...",
    "recommended_chain": ["predict_virality", "..."]
  }
}
```

Catalog runs write one record per tool with its `name`, `description`, and `inputSchema`.

***

### Why Hooklayer

- **Evidence, not vibes** — every score carries cited `signals[]` and a counterfactual.
- **Agent-ready** — `recommended_chain` fields tell an autonomous agent what to do next.
- **Safe by design** — 7 read-only tools, structured JSON, no mutations.
- **Production-ready** — MCP 2024-11-05, OAuth 2.1 + API-key auth, free tier to start.

Links: [hooklayer.dev](https://hooklayer.dev) · [GitHub](https://github.com/khan-ashifur/hooklayer) · [Glama listing](https://glama.ai/mcp/servers/khan-ashifur/hooklayer)

***

*Hooklayer is a hosted service; this Actor is a thin, open wrapper that authenticates to your Hooklayer account with your own API key. Your key is stored as an Apify secret and is never logged.*

# Actor input Schema

## `apiKey` (type: `string`):

Your Hooklayer API key (starts with hl\_live\_). Get one free at https://hooklayer.dev/auth/signup

## `tool` (type: `string`):

Name of the Hooklayer tool to run (for example analyze\_account or predict\_virality). Leave empty to return the full catalog of available tools and their input schemas.

## `toolInput` (type: `object`):

Arguments passed to the selected tool, as JSON. Tip: run once with 'List tools only' enabled to see each tool's exact inputSchema.

## `listToolsOnly` (type: `boolean`):

If enabled, the Actor connects and returns the catalog of available tools (name, description, inputSchema) without calling any of them.

## `serverUrl` (type: `string`):

Hooklayer MCP endpoint. Leave as the default hosted server unless you are self-hosting.

## Actor input object example

```json
{
  "toolInput": {},
  "listToolsOnly": false,
  "serverUrl": "https://hooklayer.dev/api/mcp"
}
```

# 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("khan.ashifur/hooklayer").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("khan.ashifur/hooklayer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 khan.ashifur/hooklayer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=khan.ashifur/hooklayer",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/xw1njRdH3ToqCO4iV/builds/4t7c4HLUdKRZlWdg1/openapi.json
