Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PodcastIndexClient

Hierarchy

  • PodcastIndexClient

Index

Constructors

constructor

Properties

Private apiUrl

apiUrl: string = ...

Private key

key: string

Private secret

secret: string

Private userAgent

userAgent: string = ...

Private version

version: string = ...

Methods

categories

episodeById

  • episodeById(id: number, options?: { fulltext?: boolean }): Promise<EpisodeById>
  • Get all the metadata for a single episode by passing its id.

    Parameters

    • id: number
    • options: { fulltext?: boolean } = {}
      • Optional fulltext?: boolean

    Returns Promise<EpisodeById>

episodesByFeedId

  • episodesByFeedId(id: number | number[], options?: { fulltext?: boolean; max?: number; since?: number }): Promise<Episodes>
  • This call returns all the episodes we know about for this feed, in reverse chronological order. Note: The id parameter is the internal Podcastindex id for this feed.

    Parameters

    • id: number | number[]
    • options: { fulltext?: boolean; max?: number; since?: number } = {}
      • Optional fulltext?: boolean
      • Optional max?: number

        You can specify a maximum number of results to return

      • Optional since?: number

        You can specify a hard-coded unix timestamp, or a negative integer that represents a number of seconds prior to right now. Either way you specify, the search will start from that time and only return feeds updated since then.

    Returns Promise<Episodes>

episodesByFeedUrl

  • episodesByFeedUrl(url: string, options?: { fulltext?: boolean; max?: number; since?: number }): Promise<Episodes>
  • This call returns all the episodes we know about for this feed, in reverse chronological order.

    Parameters

    • url: string
    • options: { fulltext?: boolean; max?: number; since?: number } = {}
      • Optional fulltext?: boolean
      • Optional max?: number

        You can specify a maximum number of results to return

      • Optional since?: number

        You can specify a hard-coded unix timestamp, or a negative integer that represents a number of seconds prior to right now. Either way you specify, the search will start from that time and only return feeds updated since then.

    Returns Promise<Episodes>

episodesByItunesId

  • episodesByItunesId(id: number, options?: { fulltext?: boolean; max?: number; since?: number | Date }): Promise<Episodes>
  • If we have an itunes id on file for a feed, then this call returns all the episodes we know about for the feed, in reverse chronological order. Note: The itunes id parameter can either be the number alone, or be prepended with “id”.

    Parameters

    • id: number
    • options: { fulltext?: boolean; max?: number; since?: number | Date } = {}
      • Optional fulltext?: boolean
      • Optional max?: number

        You can specify a maximum number of results to return

      • Optional since?: number | Date

        You can specify a hard-coded unix timestamp, or a negative integer that represents a number of seconds prior to right now. Either way you specify, the search will start from that time and only return feeds updated since then.

    Returns Promise<Episodes>

episodesRandom

  • episodesRandom(options?: { cat?: string | string[]; lang?: string | string[]; max?: number; notcat?: string | string[] }): Promise<RandomEpisodes>
  • This call returns a random batch of [max] episodes, in no specific order.

    Note: If no [max] is specified, the default is 1. You can return up to 40 episodes at a time. Note: Language and category names are case-insensitive. Note: You can mix and match the cat and notcat filters to fine tune a very specific result set.

    Parameters

    • options: { cat?: string | string[]; lang?: string | string[]; max?: number; notcat?: string | string[] } = {}
      • Optional cat?: string | string[]

        You may use this argument to specify that you ONLY want episodes with these categories in the results. Separate multiple categories with commas. You may specify either the category id or the category name

      • Optional lang?: string | string[]

        Specifying a language code (like "en") will return only episodes having that specific language. You can specify multiple languages by separating them with commas. If you also want to return episodes that have no language given, use the token "unknown". (ex. en,es,ja,unknown)

      • Optional max?: number

        You can specify a maximum number of results to return

      • Optional notcat?: string | string[]

        You may use this argument to specify categories of episodes to NOT show in the results. Separate multiple categories with commas. You may specify either the category id or the category name.

    Returns Promise<RandomEpisodes>

Private fetch

Private generateHeaders

  • generateHeaders(): Promise<{ Authorization: string; Content-Type: string; User-Agent: string; X-Auth-Date: string; X-Auth-Key: string }>
  • Returns Promise<{ Authorization: string; Content-Type: string; User-Agent: string; X-Auth-Date: string; X-Auth-Key: string }>

Private hexDigestMessage

  • hexDigestMessage(message: string): Promise<string>
  • Parameters

    • message: string

    Returns Promise<string>

podcastById

  • podcastById(id: number): Promise<Podcast>
  • This call returns everything we know about the feed.

    Parameters

    • id: number

    Returns Promise<Podcast>

podcastByItunesId

  • If we have an itunes id on file for a feed, then this call returns everything we know about that feed.

    Parameters

    • id: number

    Returns Promise<PodcastByItunesId>

podcastByUrl

  • podcastByUrl(url: string): Promise<Podcast>
  • This call returns everything we know about the feed.

    Parameters

    • url: string

    Returns Promise<Podcast>

raw

  • Make a raw request to podcast index. This is an escape hatch for leveraging the auth handling in the client but managing the calls and responses yourself. Example: client.raw("/podcasts/byfeedid?id=75075"); client.raw("/podcasts/byfeedid", { id: 75075 });

    Type parameters

    • T

    Parameters

    Returns Promise<T>

recentEpisodes

  • recentEpisodes(options?: { before?: number; excludeString?: string; fulltext?: boolean; max?: number }): Promise<RecentEpisodes>
  • This call returns the most recent [max] number of episodes globally across the whole index, in reverse chronological order. Max of 1000

    Parameters

    • options: { before?: number; excludeString?: string; fulltext?: boolean; max?: number } = {}
      • Optional before?: number

        If you pass an episode id, you will get recent episodes before that id, allowing you to walk back through the episode history sequentially.

      • Optional excludeString?: string

        If you pass this argument, any item containing this string will be discarded from the result set. This may, in certain cases, reduce your set size below your “max” value.

      • Optional fulltext?: boolean

        If present, return the full text value of any text fields (ex: description). If not provided, field value is truncated to 100 words.

      • Optional max?: number

    Returns Promise<RecentEpisodes>

recentFeeds

  • recentFeeds(options?: { category?: string | number | number[] | string[]; lang?: string | string[]; max?: number; notCategory?: string | number | number[] | string[]; since?: number }): Promise<RecentFeeds>
  • This call returns the most recently feeds in reverse chronological order.

    Parameters

    • options: { category?: string | number | number[] | string[]; lang?: string | string[]; max?: number; notCategory?: string | number | number[] | string[]; since?: number } = {}

      additional api options

      • Optional category?: string | number | number[] | string[]

        You can pass multiple of these to form an array. It will take precedent over the notCategory[] array, and instead only show you feeds with those categories in the result set. These values are OR'd

      • Optional lang?: string | string[]

        specifying a language code (like “en”) will return only feeds having that specific language.

      • Optional max?: number

        Max number of items to return, defaults to 40

      • Optional notCategory?: string | number | number[] | string[]

        You can pass multiple of these to form an array. The category ids given will be excluded from the result set.

      • Optional since?: number

        You can specify a hard-coded unix timestamp, or a negative integer that represents a number of seconds prior to now. Either way you specify, the search will start from that time and only return feeds updated since then.

    Returns Promise<RecentFeeds>

recentNewFeeds

  • This call returns every new feed added to the index over the past 24 hours in reverse chronological order. Max of 1000

    Parameters

    • options: { max?: number } = {}
      • Optional max?: number

        Max number of items to return, defaults to 10

    Returns Promise<RecentNewFeeds>

recentSoundbites

search

  • search(query: string, options?: { clean?: boolean; fulltext?: boolean; max?: number }): Promise<Search>
  • This call returns all of the feeds that match the search terms in the title, author, or owner of the feed. This is ordered by the last-released episode, with the latest at the top of the results.

    Parameters

    • query: string

      search query

    • options: { clean?: boolean; fulltext?: boolean; max?: number } = {}
      • Optional clean?: boolean
      • Optional fulltext?: boolean
      • Optional max?: number

    Returns Promise<Search>

searchPerson

  • searchPerson(query: string, options?: { fulltext?: boolean }): Promise<SearchPerson>
  • This call returns all of the episodes where the specified person is mentioned.

    Parameters

    • query: string

      search query

    • options: { fulltext?: boolean } = {}
      • Optional fulltext?: boolean

    Returns Promise<SearchPerson>

stats

  • stats(): Promise<Stats>

Generated using TypeDoc