phish_dot_in: Query the Phish.in API

Description Usage Arguments Details

Description

The phish.in API contains a vast amount of information. The functions here are specific to each type of query that can be sent to the API - all are prefixed with pi_*

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
pi_get_dates(
  apikey = getOption("phishin_key"),
  date = NULL,
  sort_dir = "descending",
  sort_atr = "name",
  per_page = 20,
  page = 1
)

pi_get_eras(
  apikey = getOption("phishin_key"),
  era = NULL,
  sort_dir = "descending",
  sort_atr = "name",
  per_page = 20,
  page = 1
)

pi_get_shows(
  apikey = getOption("phishin_key"),
  show = NULL,
  sort_dir = "descending",
  sort_atr = "name",
  per_page = 20,
  page = 1,
  sbd_only = FALSE,
  play_show = FALSE
)

pi_get_songs(
  apikey = getOption("phishin_key"),
  song = NULL,
  sort_dir = "descending",
  sort_atr = "name",
  per_page = 20,
  page = 1
)

pi_get_tags(
  apikey = getOption("phishin_key"),
  tag = "all",
  sort_dir = "descending",
  sort_atr = "name",
  per_page = 20,
  page = 1
)

pi_get_tours(
  apikey = getOption("phishin_key"),
  tour = NULL,
  sort_dir = "descending",
  sort_atr = "name",
  per_page = 20,
  page = 1
)

pi_get_tracks(
  apikey = getOption("phishin_key"),
  track = NULL,
  sort_dir = "descending",
  sort_atr = "name",
  per_page = 20,
  page = 1,
  sbd_only = FALSE
)

pi_get_venues(
  apikey = getOption("phishin_key"),
  venue = NULL,
  sort_dir = "descending",
  sort_atr = "name",
  per_page = 20,
  page = 1
)

pi_get_years(
  apikey = getOption("phishin_key"),
  year,
  sort_dir = "descending",
  sort_atr = "name",
  per_page = 20,
  page = 1
)

pi_get_random_show(apikey = getOption("phishin_key"), play_show = FALSE)

Arguments

apikey

Your key for the Phish.net API. This can also be stored as an option using options('phishin_key') <- 'your_api_key'. See details for more information on how to obtain one.'

date

The date you wish to get show info for. Format either as 'MM-DD' or code'month-DD' (e.g. '10-31' or 'october-31')

sort_dir

direction to sort result in. The direction is used to sort on sort_atr.

sort_atr

the attribute to sort on. "date", "name", etc

per_page

The number of results per page. The API's default is 20, but this can be set to larger or smaller numbers.

page

The page of results to return. For some functions, this may be overridden as there's only 1 page available.

era

The era you wish to get years for

show

Either an integer show ID (obtainable through pi_get_tours, pi_get_songs, etc) OR a specific date as a character string with "YYYY-MM-DD" format.

sbd_only

Logical indicating whether or not to only return information for shows with soundboards (e.g. tag = sbd).

play_show

logical indicating whether to navigate to the phish.in url and start playing the show. Default is FALSE. Must supply a show for this to be TRUE

song

Either the name of a song or "all". It appears that the API does not support requests for more than one song at a time, so looping over names is required. When song = "all", a data frame of song names and the number of times played is returned. When song = "some song name", a data frame of dates played, show song positions, set positions, durations, number of likes, and a list column of any tags associated with the perforamnce is returned.

tag

The integer ID, tag name, or slug entry for a tag. Defaults to "all", returning a list of all tags w/ ID numbers, tag names, corresponding slugs, descriptions, and a list of tracks that it's used for. The latter only applies to specific tags, as the API doesn't return that information when tag = "all"

tour

The tour you wish to get information for. Either NULL or the name of a tour. It is usually best to get names for a specific tour from a call using NULL, as they can be tricky to guess correctly sometimes.

track

The integer ID for a track. Refers to a specific version of a song.

venue

The venue you wish to get information for. Either NULL or the name of a venue.

year

The desired year. use year = 'all' to get a show counts for every year they toured. Enter a specific year to get a data frame with dates, venue and location data, and complete setlists information for each show in a year (set list data is the same format as pi_get_song).

Details

API keys can be obtained using the contact form on the API's website. Once obtained, use it in the apikey argument to each pi_* function. Alternatively, you can set a option(phishin_key = '<your-key'>) in your .Rprofile.

Note that for all Phish.in API calls that include year information, 1983 - 1987 are lumped together as a single entity. Specific dates are still available for shows and songs played in this time period.


MayaGans/phishr documentation built on April 6, 2020, 3:35 a.m.