The `podcast-api` library provides convenient JavaScript bindings for the Listen Notes Podcast API, enabling developers to search, retrieve, and manage podcast and episode metadata programmatically. It supports a wide range of environments, including server-side Node.js applications, serverless Cloudflare Workers/Pages, and client-side browser JavaScript, although browser usage is discouraged without proper API key handling to prevent exposure. The current stable version is 2.0.4, with active development indicated by frequent releases introducing new endpoints like `searchEpisodeTitles` and `fetchPodcastsByDomain`. A key differentiator is its dual client architecture, offering `Client` for Node.js/browser environments and `ClientForWorkers` specifically optimized for Cloudflare Workers, providing streamlined access to the same API that powers the Listen Notes search engine.
npm install podcast-apiVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes the `podcast-api` client and demonstrates a basic full-text search for podcasts, logging the results. It highlights API key configuration and error handling.
Proxy requests through your own backend server or a serverless function (like Cloudflare Workers) to keep your API key secure.
For Node.js or browser, use `import { Client } from 'podcast-api';`. For Cloudflare Workers, use `import { ClientForWorkers } from 'podcast-api';` and ensure your API key is stored as a Worker secret.Ensure your Node.js environment is updated to version 10 or newer. Check your `node` version using `node -v`.
Initialize the client with `Client({ apiKey: 'YOUR_API_KEY' })` or ensure your `LISTEN_API_KEY` environment variable is correctly configured and accessible in your application's environment.Ensure you are using named imports for ESM (`import { Client } from 'podcast-api';`) or destructuring for CommonJS (`const { Client } = require('podcast-api');`). Do not attempt `import Client from 'podcast-api';` or `const Client = require('podcast-api'); Client(...)`.No dependency data recorded yet.