Package 'podindexr'

Title: A Podcast Index API Library for R
Description: Access and download data from the Podcast Index Database directly from R using the 'PodcastIndex' <https://podcastindex-org.github.io/docs-api> API.
Authors: Eric Nantz [aut, cre]
Maintainer: Eric Nantz <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-11-15 02:50:21 UTC
Source: https://github.com/rpodcast/podindexr

Help Index


Create podcastindex authentication token

Description

Create a custom authentication token required by the podcastindex api utilizing the podcastindex API key and secret pair

Usage

create_hash(epoch_time = NULL)

Arguments

epoch_time

string of time in UTC unix format. If NULL, the current system time will be used.

Value

string representing hash (sha1) of API key, secret and epoch time created with the digest package


Get episodes from podcast feed ID

Description

episodes_byfeedid() obtains all episodes from the a podcast specified by one or more PodcastIndex feed ID(s)

Usage

episodes_byfeedid(feedid, max = 10, fulltext = FALSE, since = NULL)

Arguments

feedid

vector of one or more integers representing PodcastIndex Feed IDs.

max

Maximum number of results to return. Value must be a single integer between 1 and 1000.

fulltext

boolean to return the full text value of any text fields within the result data. If set to FALSE, all text fields are truncated to 100 words.

since

optional date string in format YYYY-MM-DD that when specified will only return podcasts/episodes created since the specified date.

Value

tibble data frame with metadata associated with episodes

Examples

# Requires API key and secret

episodes_byfeedid(feedid = 920666)

Get episodes from podcast guid

Description

episodes_byguid() obtains metadata for a single episode from a podcast specified by a guid and either a feed ID or URL

Usage

episodes_byguid(guid, feedurl = NULL, feedid = NULL, fulltext = FALSE)

Arguments

guid

character string of guid value for episode to retrieve

feedurl

character string of podcast feed URL

feedid

vector of one or more integers representing PodcastIndex Feed IDs.

fulltext

boolean to return the full text value of any text fields within the result data. If set to FALSE, all text fields are truncated to 100 words.

Value

tibble data frame with metadata associated with the episode

Examples

# Requires API key and secret

# using guid and feedid

episodes_byguid(guid = "PC2084", feedid = 920666)

# using guid and feedurl
episodes_byguid(guid = "PC2084", feedurl = "http://mp3s.nashownotes.com/pc20rss.xml")

Get metadata for a single episode

Description

episodes_byid() obtains all metadata associated with a single episode specified by ID.

Usage

episodes_byid(id, fulltext = FALSE)

Arguments

id

integer of the PodcastIndex episode ID to search for.

fulltext

boolean to return the full text value of any text fields within the result data. If set to FALSE, all text fields are truncated to 100 words.

Value

tibble data frame with metadata associated with the episode

Examples

# Requires API key and secret

episodes_byid(id = 75075)

Get episodes from podcast feed URL

Description

episodes_byfeedid() obtains all episodes from the a podcast specified by a feed URL

Usage

episodes_byurl(url, max = 10, fulltext = FALSE, since = NULL)

Arguments

url

character string of podcast feed URL

max

Maximum number of results to return. Value must be a single integer between 1 and 1000.

fulltext

boolean to return the full text value of any text fields within the result data. If set to FALSE, all text fields are truncated to 100 words.

since

optional date string in format YYYY-MM-DD that when specified will only return podcasts/episodes created since the specified date.

Value

tibble data frame with metadata associated with episodes

Examples

# Requires API key and secret

episodes_byurl(url = "https://engineered.network/pragmatic/feed/index.xml")

Get live podcast episodes

Description

episodes_live() obtains metadata for episodes that have the podcast-liveitem tag enabled in the feed, meaning episodes airing live at the time of running this function.

Usage

episodes_live(max = 10)

Arguments

max

Maximum number of results to return. Value must be a single integer between 1 and 1000.

Value

tibble data frame with metadata associated with live episodes

Examples

# Requires API key and secret

episodes_live(max = 20)

Random podcast episodes

Description

episodes_random() obtains a random selection of podcast episodes from the Podcast Index database

Usage

episodes_random(
  max = 2,
  lang = "en",
  cat_terms = NULL,
  notcat_terms = NULL,
  fulltext = FALSE
)

Arguments

max

Maximum number of results to return. Value must be a single integer between 1 and 1000.

lang

optional two-letter language code that when specified will only return podcasts/episodes having that specific language.

cat_terms

optional character vector of one or more categories that when specified will only return podcasts/episodes under those categories.

notcat_terms

optional character vector of one or more categories that when specified will only return podcasts/episodes not under those categories.

fulltext

boolean to return the full text value of any text fields within the result data. If set to FALSE, all text fields are truncated to 100 words.

Value

tibble data frame with metadata associated with episodes

Examples

# Requires API key and secret

episodes_random(max = 20)

Get recent podcast episodes

Description

episodes_recent() obtains the most recent max number of podcast episodes across the entire PodcastIndex database, sorted in reverse chronological order.

Usage

episodes_recent(
  max = 7,
  exclude_string = NULL,
  before = NULL,
  fulltext = FALSE
)

Arguments

max

Maximum number of results to return. Value must be a single integer between 1 and 1000.

exclude_string

character string used to exclude any episodes with title or URL containing the specified string.

before

episode ID string that when specified will only return episodes created before the specified episode ID, allowing you to walk back through episode history sequentially.

fulltext

boolean to return the full text value of any text fields within the result data. If set to FALSE, all text fields are truncated to 100 words.

Value

tibble data frame with metadata associated with episodes

Examples

# Requires API key and secret

episodes_recent(max = 20)

Get podcast feeds by medium

Description

feeds_bymedium obtains all feeds marked with the specified medium tag value.

Usage

feeds_bymedium(
  medium = c("audiobook", "blog", "film", "music", "newsletter", "podcast", "video")
)

Arguments

medium

character string of medium to search for. Must be one of audiobook, blog, film, music, newsletter, ⁠podcast,⁠ or video

Value

tibble data frame with metadata associated with feeds

Examples

## Not run: 
# Requires API key and secret

feeds_bymedium(medium = "film")

## End(Not run)

Get new podcast feeds

Description

feeds_recent()' retrieves the newest podcast feeds added to the podcastindex over the past 24 hours.

Usage

feeds_new(max = 60, since = NULL, feedid = NULL, desc = FALSE)

Arguments

max

Maximum number of results to return. Value must be a single integer between 1 and 1000.

since

optional date string in format YYYY-MM-DD that when specified will only return podcasts/episodes created since the specified date.

feedid

string of the Podcastindex Feed ID to start from (or go to if desc is set to TRUE). If since is specified, feedid takes precedence.

desc

boolean to display feeds in descending order. Only applicable when specifying feedid.

Value

tibble data frame with metadata associated with new feeds

Examples

# Requires API key and secret

feeds_new(max = 20)

Get recent podcast feeds

Description

feeds_recent() retrieves the most recent podcast feeds added to the podcastindex.

Usage

feeds_recent(
  max = 40,
  lang = "en",
  since = NULL,
  cat_terms = NULL,
  notcat_terms = NULL
)

Arguments

max

Maximum number of results to return. Value must be a single integer between 1 and 1000.

lang

optional two-letter language code that when specified will only return podcasts/episodes having that specific language.

since

optional date string in format YYYY-MM-DD that when specified will only return podcasts/episodes created since the specified date.

cat_terms

optional character vector of one or more categories that when specified will only return podcasts/episodes under those categories.

notcat_terms

optional character vector of one or more categories that when specified will only return podcasts/episodes not under those categories.

Value

tibble data frame with metadata associated with recent feeds in chronological order

Examples

# Requires API key and secret

feeds_recent()

feeds_recent(max = 100, since = "2021-01-01", cat_terms = c("News", "Finance"))

Get podcast feeds supporting value tag

Description

feeds_withvalue obtains all feeds from the Podcast Index database that support the value tag in the podcast namespace

Usage

feeds_withvalue()

Value

tibble data frame with metadata associated with feeds

Examples

## Not run: 
# Requires API key and secret

feeds_withvalue()

## End(Not run)

Obtain podcastindex API key and secret pair

Description

Obtain the podcastindex API key and secret values from a .Renviron file, either stored in the current directory or the user's home directory.

Usage

get_podcastindex_api_keys()

Value

list with API key and API secret values


Detect if podcastindex API key/secret pair is defined

Description

Detect if podcastindex API key/secret pair is defined

Usage

podcastindex_api_isset()

Value

boolean, TRUE if both PODCASTINDEX_API_KEY and PODCASTINDEX_API_SECRET environment variables are defined in the current R session.


Get podcast feed metadata

Description

podcasts_byfeedid() obtains all available metadata from the Podcast Index database associated with a particular feed ID

Usage

podcasts_byfeedid(feedid)

Arguments

feedid

integer representing a Podcast Index feed ID

Value

tibble data frame with metadata associated with feed

Examples

# Requires API key and secret

podcasts_byfeedid(feedid = 920666)

Get podcast feed metadata

Description

podcasts_byfeedurl() obtains all available metadata from the Podcast Index database associated with a particular feed URL

Usage

podcasts_byfeedurl(url)

Arguments

url

character string of podcast feed URL

Value

tibble data frame with metadata associated with feed

Examples

# Requires API key and secret

podcasts_byfeedurl(url = "https://feeds.theincomparable.com/batmanuniversity")

Get podcast feed metadata

Description

podcasts_byfeedguid() obtains all available metadata from the Podcast Index database associated with a particular feed GUID

Usage

podcasts_byguid(guid)

Arguments

guid

string representing a Podcast Index feed GUID

Value

tibble data frame with metadata associated with feed

Examples

# Requires API key and secret

podcasts_byguid(guid = "9b024349-ccf0-5f69-a609-6b82873eab3c")

Get podcast feed metadata

Description

podcasts_byitunesid() obtains all available metadata from the Podcast Index database associated with a particular iTunes ID

Usage

podcasts_byitunesid(itunesid)

Arguments

itunesid

integer representing a Podcast Index iTunes feed ID

Value

tibble data frame with metadata associated with feed

Examples

# Requires API key and secret

podcasts_byitunesid(itunesid = 1441923632)

Get podcast categories

Description

podcasts_categories() obtains all of the possible categories supported by the Podcast Index.

Usage

podcasts_categories()

Value

tibble data frame with category id and name

Examples

# Requires API key and secret

podcasts_categories()

Search podcasts with Apple-like API

Description

search_apple_byterm() replaces the Apple search API but uses the Podcast Index database instead.

Usage

search_apple_byterm(term)

Arguments

term

character string of the term to search for

Value

tibble data frame with metadata associated with podcasts that match the search term

Examples

search_apple_byterm("metal")

Lookup podcasts with Apple-like API

Description

search_apple_lookup() replaces the Apple podcast lookup api but uses the Podcast Index database instead.

Usage

search_apple_lookup(feedid)

Arguments

feedid

integer of the iTunes feed ID to search for.

Value

tibble data frame with metadata associated with podcasts that match the feed ID

Examples

search_apple_lookup(feedid = 1441923632)

Search podcast episodes by person

Description

search_byperson() performs a search of podcast episodes where the specified person is mentioned.

Usage

search_byperson(q, fulltext = FALSE)

Arguments

q

character string of the person to search for

fulltext

boolean to return the full text value of any text fields within the result data. If set to FALSE, all text fields are truncated to 100 words.

Value

tibble data frame with metadata associated with episodes that mention the person specified in the search query.

Examples

# Requires API key and secret

search_byperson(q = "Adam Curry")

Search podcasts

Description

search_byterm() performs a search of the title, author, or owner of podcasts feeds within the PodcastIndex.

Usage

search_byterm(q, val = NULL, aponly = TRUE, clean = TRUE, fulltext = FALSE)

Arguments

q

character string of the term(s) to search for

val

string indicating which value block type to filter search results. Valid entries are any, lightning, hive, or webmonetization.

aponly

boolean to only return feeds with an itunesId present

clean

boolean to only return non-explicit podcast feeds. Meaning feeds where the itunes:explicit flag is set to false.

fulltext

boolean to return the full text value of any text fields within the result data. If set to FALSE, all text fields are truncated to 100 words.

Value

tibble data frame with metadata associated with feeds that match the search terms in the title, author, or owner fields.

Examples

# Requires API key and secret

search_byterm(q = "batman university")

Search podcasts by title

Description

search_byterm() performs a search of the title field of podcasts feeds within the PodcastIndex.

Usage

search_bytitle(q, val = NULL, clean = TRUE, fulltext = FALSE, similar = FALSE)

Arguments

q

character string of the term(s) to search for

val

string indicating which value block type to filter search results. Valid entries are any, lightning, hive, or webmonetization.

clean

boolean to only return non-explicit podcast feeds. Meaning feeds where the itunes:explicit flag is set to false.

fulltext

boolean to return the full text value of any text fields within the result data. If set to FALSE, all text fields are truncated to 100 words.

similar

boolean to include similar matches in search response

Value

tibble data frame with metadata associated with feeds that match (or similar to) the search terms in the title fields.

Examples

# Requires API key and secret

search_bytitle(q = "batman university")

Search music podcasts

Description

search_music() performs a search of the title, author, or owner of podcast feeds within the PodcastIndex where the medium is music.

Usage

search_music(q, val = NULL, aponly = TRUE, clean = TRUE, fulltext = FALSE)

Arguments

q

character string of the term(s) to search for

val

string indicating which value block type to filter search results. Valid entries are any, lightning, hive, or webmonetization.

aponly

boolean to only return feeds with an itunesId present

clean

boolean to only return non-explicit podcast feeds. Meaning feeds where the itunes:explicit flag is set to false.

fulltext

boolean to return the full text value of any text fields within the result data. If set to FALSE, all text fields are truncated to 100 words.

Value

tibble data frame with metadata associated with feeds that match the search terms in the title, author, or owner fields.

Examples

# Requires API key and secret

search_music(q = "metal")