Prerequisites
Before you start, make sure you have the following ready:
- PodClaw API key — free at podclaw.io/signup
- Python 3.9+
- langchain, langchain-openai, and requests packages installed
pip install langchain langchain-openai langchain-hub requests
Quick Start
The example below defines two LangChain tools — one to create a podcast show and one to publish an episode — then wires them into an OpenAI tools agent. The agent receives a plain-English instruction and calls the right tools in order.
python — langchain_podclaw.py
import requests
from langchain.tools import tool
from langchain.agents import AgentExecutor, create_openai_tools_agent
from langchain_openai import ChatOpenAI
from langchain import hub
PODCLAW_API_KEY = "pc_your_api_key_here"
BASE_URL = "https://podclaw.io/api"
@tool
def create_podcast_show(title: str, description: str, category: str = "Technology") -> dict:
"""Create a new podcast show on PodClaw."""
response = requests.post(
f"{BASE_URL}/shows",
headers={"Authorization": f"Bearer {PODCLAW_API_KEY}"},
json={"title": title, "description": description, "category": category}
)
return response.json()
@tool
def publish_episode(show_id: str, title: str, audio_url: str, description: str = "") -> dict:
"""Publish a podcast episode to Apple Podcasts, Spotify, and 20+ platforms."""
response = 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"
}
)
return response.json()
# Create agent with PodClaw tools
llm = ChatOpenAI(model="gpt-4o", temperature=0)
tools = [create_podcast_show, publish_episode]
prompt = hub.pull("hwchase17/openai-tools-agent")
agent = create_openai_tools_agent(llm, tools, prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
# Run the agent
result = agent_executor.invoke({
"input": "Create a podcast show called 'AI Weekly' about artificial intelligence news, then publish an episode titled 'GPT-5 Announced' using audio from https://example.com/episode1.mp3"
})
What happens next
After your LangChain agent calls publish_episode, PodClaw handles the rest automatically:
- A valid RSS 2.0 feed is generated and kept in sync as new episodes are added
- The show is submitted to Apple Podcasts, Spotify, and 20+ additional directories
- Each episode receives a permanent GUID and a shareable episode page
- Download analytics start accumulating immediately
Tip: The audio_url field accepts any publicly accessible MP3, M4A, or OGG URL. If you generate audio with a TTS service like ElevenLabs or OpenAI TTS, host the file on S3 or R2 and pass the URL directly.
Going further
Once your first episode is live, PodClaw's API exposes additional capabilities you can wire into your LangChain agents:
- Analytics endpoint — GET /api/shows/:id/analytics returns episode download counts, listener geography, and app breakdown. Use this to give your agents feedback on what content performs best.
- Episode scheduling — Set
status: "scheduled" with a publish_at timestamp to queue episodes for future release.
- Webhook callbacks — Configure a webhook URL in the PodClaw dashboard to receive POST notifications when Apple Podcasts or Spotify confirm your episode is indexed.