podcastindexjs
Version:
client-side JS library for interacting with the Podcast Index API
48 lines (30 loc) • 1.72 kB
Markdown
PodcastIndexJS is a client-side javascript library to use the Podcast Index API <https://podcastindex.org/>. This library was adapted from the Node package <https://github.com/RyanHirsch/podcastdx-client>, in order for use on the client-side.
To use the Podcast Index API, you must register for a developer `API KEY` and `API SECRET` from <https://api.podcastindex.org/signup>.
All available methods/types can be viewed at <https://jasonobeid.github.io/PodcastIndexJS/classes/index.PodcastIndexClient.html>.
```sh
yarn add podcastindexjs
```
```ts
import { PodcastIndexClient } from "podcastindexjs";
// assumes you have your key and secret set as environment variables
const client = new PodcastIndexClient(process.env.API_KEY, secret: process.env.API_SECRET);
client.search("javascript").then(console.log);
client.recentFeeds().then(console.log);
client.recentNewFeeds().then(console.log);
client.recentEpisodes().then(console.log);
client.podcastByUrl("https://feeds.theincomparable.com/batmanuniversity").then(console.log);
client.podcastById(75075).then(console.log);
client.podcastByItunesId(1441923632).then(console.log);
client.episodesByFeedUrl("https://feeds.theincomparable.com/batmanuniversity").then(console.log);
client.episodesByFeedId(75075).then(console.log);
client.episodesByItunesId(1441923632).then(console.log);
client.episodeById(16795106).then(console.log);
```
Before running any tests, you would need to add your `API KEY` and `API SECRET` to jestSetup.ts
Join on Discord at <https://discord.gg/d6apPvR3N6> or on <https://podcastindex.social/>