🌾 Haystack Integration

Haystack Podcast Hosting API: Publish Episodes from AI Pipelines

PodClaw is the podcast hosting API built for AI pipelines. Drop in a custom Haystack component and your pipeline can create shows, publish audio to Apple Podcasts and Spotify, and track listener analytics — all in one run() call.

Prerequisites

You'll need the following before you start:

pip install haystack-ai requests

Custom PodClaw Component

Haystack's @component decorator turns any Python class into a pipeline node. The component below accepts episode metadata as typed inputs and calls the PodClaw REST API to publish the episode, returning the episode ID and public URL.

python — podclaw_component.py
import requests from haystack import component PODCLAW_API_KEY = "pc_your_api_key_here" BASE_URL = "https://podclaw.io/api" @component class PodClawShowCreator: """Creates a new podcast show on PodClaw.""" @component.output_types(show_id=str, rss_url=str) def run(self, title: str, description: str, category: str = "Technology"): resp = requests.post( f"{BASE_URL}/shows", headers={"Authorization": f"Bearer {PODCLAW_API_KEY}"}, json={"title": title, "description": description, "category": category}, timeout=30, ) resp.raise_for_status() data = resp.json() return {"show_id": data["id"], "rss_url": data.get("rss_url", "")} @component class PodClawPublisher: """Publishes an episode to PodClaw and returns the episode URL.""" @component.output_types(episode_id=str, episode_url=str, success=bool) def run(self, show_id: str, title: str, audio_url: str, description: str = ""): resp = requests.post( f"{BASE_URL}/shows/{show_id}/episodes", headers={"Authorization": f"Bearer {PODCLAW_API_KEY}"}, json={ "title": title, "description": description, "audio_url": audio_url, "status": "published", }, timeout=30, ) resp.raise_for_status() data = resp.json() return { "episode_id": data.get("id", ""), "episode_url": data.get("url", ""), "success": True, }

Wiring it into a Pipeline

Add the component to a Haystack Pipeline and connect it to upstream nodes. Here's a minimal example that publishes directly from a known audio URL:

python — run_pipeline.py
from haystack import Pipeline from podclaw_component import PodClawPublisher pipe = Pipeline() pipe.add_component("publisher", PodClawPublisher()) result = pipe.run({ "publisher": { "show_id": "show_abc123", "title": "Weekly AI Digest — Episode 14", "audio_url": "https://your-storage.com/episode-14.mp3", "description": "This week: GPT updates, open-source releases, and community news.", } }) print("Episode live at:", result["publisher"]["episode_url"])
Tip: To build a full RAG-to-podcast pipeline, chain an InMemoryBM25RetrieverOpenAIGenerator → TTS component → PodClawPublisher. Connect the TTS component's audio_url output to the publisher's audio_url input.

What happens after publish

Once your pipeline calls run(), PodClaw handles everything downstream:

Frequently Asked Questions

How do I integrate PodClaw with a Haystack pipeline?

Create a custom Haystack component decorated with @component that calls PodClaw's REST API in its run() method. Add it to your Pipeline, connect it to upstream nodes that produce your audio URL and metadata, and call pipeline.run(). Full code is on this page.

Does PodClaw work with Haystack 2.x?

Yes. PodClaw is a standard REST API. The examples on this page use Haystack 2.x syntax with the @component decorator. The same PodClaw API calls work in Haystack 1.x pipelines with minor syntax adjustments to how components are defined.

Can a Haystack RAG pipeline publish podcast episodes automatically?

Yes. Chain a retriever → LLM generator → TTS component → PodClawPublisher in a single Haystack pipeline. The retriever pulls relevant documents, the LLM writes the script, TTS converts it to audio, and PodClaw distributes it to Apple Podcasts, Spotify, and 20+ other directories automatically.

Ready to ship your first AI podcast?

Get your free PodClaw API key and wire it into your Haystack pipeline in minutes.

Get Started Free →