# Krakt Threadtrack (`kurtholes/krakt-threadtrack`) Actor

Paste a Reddit, Hacker News or Bluesky thread. Get every song people mentioned as a clean, deduped tracklist ranked by mentions, verified on MusicBrainz, with Spotify and YouTube links plus a one-click YouTube playlist. About $0.02 per thread.

- **URL**: https://apify.com/kurtholes/krakt-threadtrack.md
- **Developed by:** [Kurt Holes](https://apify.com/kurtholes) (community)
- **Categories:** Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 thread processeds

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

## Krakt Threadtrack

**Somebody asked "what song gave you chills?" and 400 people answered. This actor turns that thread into a playlist.**

Paste a Reddit, Hacker News or Bluesky thread. Krakt Threadtrack reads every comment, pulls out every song people mentioned, checks each one against MusicBrainz, merges the duplicates and ranks them by how many different people brought them up. You get a clean tracklist with Spotify and YouTube links and a one-click YouTube playlist. No AI, no login needed.

### What you get

| field | what |
|---|---|
| `rank`, `mentions` | Ranked by how many different people mentioned the song |
| `artist`, `title` | Cleaned up and spelled the MusicBrainz way |
| `sampleComments` | Up to 3 quotes (one per person) that mention it |
| `spotifySearchUrl`, `youtubeMusicSearchUrl`, `youtubeSearchUrl` | One click to play it anywhere |
| `youtubeUrl`, `spotifyUrl` | Direct links when we found the exact track |
| `youtubeQuickPlaylistUrl` | One link that plays the top 50 as a YouTube queue |
| `spotifyPlaylistUrl` | A real private Spotify playlist, if you add your own Spotify token |
| `verified`, `musicbrainzId`, `year`, `foundVia` | Extras |

The per-thread summary (comment count, track count, quick playlist links) is in the `OUTPUT` record of the key-value store.

### How songs are found

- `Artist - Title` lines, `"Title" by Artist`, `Title by Artist`, `Artist's "Title"`
- Spotify track links and YouTube / YouTube Music links in the comments (read from the public page and oEmbed)
- Every guess is checked on MusicBrainz (free, 1 request/second, proper User-Agent). Guesses it can't confirm are dropped unless they came from a link.

### Use it for

- "Songs that…" threads → instant playlist
- Music newsletters, radio prep, DJ crate digging
- Finding what a community actually loves, ranked

### Pricing

**$0.02 per thread.** Threads where no songs are found are free.

### Optional: real Spotify playlist

Paste a Spotify access token with the `playlist-modify-private` scope into **Spotify access token**. The actor creates a private playlist in your account and adds every track it can match. The token is only used for that run and is stored as a secret input.

### Notes and limits

- **Reddit:** Reddit blocks cloud servers from its JSON API (`old.reddit.com/.json`, `api.reddit.com`). The actor tries those, then Reddit's public comment RSS feed (works today, up to ~500 comments per thread, no vote counts), then the same routes through Apify's datacenter proxy. If Reddit tightens up, Reddit threads may fail; HN and Bluesky are rock solid.
- **Hacker News** (Algolia API) and **Bluesky** (public AppView) read the full thread.
- **X/Twitter is not supported.** Its API is paid.
- MusicBrainz allows 1 request/second, so verification is time-boxed (45 seconds per thread by default); the most-mentioned candidates are checked first. For a big thread, raise **MusicBrainz time budget** (e.g. 240). If nothing could be confirmed in time, the unconfirmed guesses are returned with `verified: false` instead of an empty list.
- The whole run has a time budget (**Run time budget**, 240 seconds by default). When it runs out, results found so far are saved and remaining threads are skipped (not charged). Raise it, together with the run timeout, for many threads.
- Text rules miss songs written as bare titles with no artist ("Wonderwall!") and sometimes pick up albums instead of songs.
- The YouTube quick playlist uses YouTube's `watch_videos` link with video IDs looked up from public search results. If lookups fail, you still get search links.
- Spotify has no login-free way to make a combined playlist link, so without a token you get per-track Spotify search links.
- Comments belong to their authors. Link back when you share.

# Actor input Schema

## `threadUrls` (type: `array`):

Reddit post, Hacker News item or Bluesky post URLs. One tracklist per thread. X/Twitter is not supported (paid API).

## `maxTracks` (type: `integer`):

Top N by mentions.

## `minMentions` (type: `integer`):

Only keep songs mentioned by at least this many people.

## `sampleComments` (type: `integer`):

Quotes kept per song, one per person.

## `verifyWithMusicBrainz` (type: `boolean`):

Check each guess against MusicBrainz (free, 1 request/second) and fix artist/title spelling. Turn off for speed.

## `keepUnverified` (type: `boolean`):

Keep 'Artist - Title' guesses MusicBrainz could not confirm. Songs from Spotify/YouTube links are always kept.

## `maxVerifySeconds` (type: `integer`):

MusicBrainz allows 1 request/second, so verification is time-boxed per thread. Candidates left unchecked after this are dropped (link-based songs are kept). Raise it (e.g. 240) for big threads.

## `maxRunSeconds` (type: `integer`):

Stop starting new work after this many seconds and save what was found. Raise it for many or very big threads (also raise the run timeout).

## `resolveYouTubeIds` (type: `boolean`):

Look up a video for each of the top 50 songs so you get one-click watch_videos playlist links.

## `useApifyProxyForReddit` (type: `boolean`):

Retry Reddit through Apify datacenter proxy when blocked.

## `spotifyToken` (type: `string`):

Your own Spotify OAuth token with playlist-modify-private scope. If set, a private Spotify playlist is created in your account.

## `spotifyPlaylistName` (type: `string`):

Defaults to 'Threadtrack: <thread title>'.

## Actor input object example

```json
{
  "threadUrls": [
    "https://news.ycombinator.com/item?id=25093230"
  ],
  "maxTracks": 100,
  "minMentions": 1,
  "sampleComments": 3,
  "verifyWithMusicBrainz": true,
  "keepUnverified": false,
  "maxVerifySeconds": 45,
  "maxRunSeconds": 240,
  "resolveYouTubeIds": true,
  "useApifyProxyForReddit": true
}
```

# Actor output Schema

## `tracks` (type: `string`):

No description

## `summary` (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 = {
    "threadUrls": [
        "https://news.ycombinator.com/item?id=25093230"
    ],
    "maxVerifySeconds": 45
};

// Run the Actor and wait for it to finish
const run = await client.actor("kurtholes/krakt-threadtrack").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 = {
    "threadUrls": ["https://news.ycombinator.com/item?id=25093230"],
    "maxVerifySeconds": 45,
}

# Run the Actor and wait for it to finish
run = client.actor("kurtholes/krakt-threadtrack").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 '{
  "threadUrls": [
    "https://news.ycombinator.com/item?id=25093230"
  ],
  "maxVerifySeconds": 45
}' |
apify call kurtholes/krakt-threadtrack --silent --output-dataset

```

## MCP server setup

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

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/Wm32cNdyoxdgXKLFe/builds/DdoTOJVnc6nG0Df6t/openapi.json
