We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm getting "Error in open.connection(con, "rb") : HTTP error 401." when I run the following:
getAlbums("3z6Gk257P9jNcZbBXJNX5i", type = "album", market = "US") # this is using the Regina Spektor artist id provided in the readme
Solves a couple issues I found in the getAlbums function:
jsonlite::fromJSON
httr::GET
httr::config(token = token)
getAlbums <- function(id, type = "album", market = "US", token) { require(dplyr) total <- httr::content(httr::GET(paste0("https://api.spotify.com/v1/artists/", id, "/albums?album_type=album"), httr::config(token = token)))$total req <- httr::GET(paste0("https://api.spotify.com/v1/artists/", id, "/albums?offset=0&limit=", total, "&album_type=", type, "&market=", market), httr::config(token = token)) return(lapply(httr::content(req)$items, function(x) data.frame( id = x$id, name = x$name, album_type = x$album_type, available_markets = paste(x$available_markets, collapse = ", "), stringsAsFactors = F)) %>% bind_rows()) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm getting "Error in open.connection(con, "rb") : HTTP error 401." when I run the following:
Solves a couple issues I found in the getAlbums function:
jsonlite::fromJSON
calls tohttr::GET
to allow for thehttr::config(token = token)
argumentThe text was updated successfully, but these errors were encountered: