get_spotify_item: Get Spotify Item

Description Usage Arguments Details Value Author(s) Examples

View source: R/get_spotify_item.R

Description

This function searches spotify item by name

Usage

1
2
3
get_spotify_item(name = NULL, type, limit = 1, offset = 0,
  access_token = DSpoty::get_spotify_access_token(), artist = NULL,
  album = NULL)

Arguments

name

String of item name (artist, album, track...). Default: NULL

type

String of the search type. Possible values are 'artist', 'album' and 'track'.

limit

Integer indicating the max number of artists to return. Defaults to 1, max of 50.

offset

Integer indicating the offset of the first artist to return. Defaults to 0 (Spotify's API default value).

access_token

Spotify Web API token. Defaults to DSpoty::get_spotify_access_token()

artist

String of album's artist name. Default: NULL

album

String of album name. Default: NULL

Details

You have two options to use this function: Search by parameter name or search by parameters artist + album. In this second case, type must always be 'album'.

Value

Returns a data frame with the item's information

Author(s)

Alberto Almuiña

Examples

1
2
3
4
5
6
## Not run: 
get_spotify_item(name = 'Arctic Monkeys', type = 'artist')
get_spotify_item(artist = 'Leiva', album = 'Nuclear', type = 'album')
get_spotify_item(name = 'Do I Wanna Know?', type = 'track')

## End(Not run)

DSpoty documentation built on March 26, 2020, 7:13 p.m.