Skip to content

Commit

Permalink
add ap rankings endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
andreweatherman committed Aug 17, 2024
1 parent 974272b commit bd2bfb2
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export("%>%")
export(cbd_add_net_quad)
export(cbd_all_metrics)
export(cbd_ap_rankings)
export(cbd_bpi_ratings)
export(cbd_create_account)
export(cbd_kenpom_authorization)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# cbbdata (development version, 2024-07-20)
- Added [`cbd_net_archive`](https://cbbdata.aweatherman.com/reference/cbd_net_archive.html) to pull daily NET rankings, along with KenPom and Torvik ratings, from the 2023-24 season. This endpoint will update throughout the 2024-25 season. Prior data might be added in future versions.
- Added [`cbd_ap_rankings`](https://cbbdata.aweatherman.com/reference/cbd_ap_rankings.html)

# cbbdata 0.3.0
- Added [`cbd_bpi_ratings`](https://cbbdata.aweatherman.com/reference/cbd_bpi_ratings.html) to pull current ESPN BPI ratings + rankings, SOR/SOS, and tournament projections.
Expand Down
19 changes: 19 additions & 0 deletions R/cbd_ap_rankings.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#' AP Poll History
#'
#' Pulls AP poll history from 1949-Present
#'
#' @param ... OPTIONAL. To load the complete data set, pass no arguments through
#' to the function. Else, you can filter on `team`, `conf`, or `year`.
#'
#' @examples
#' \donttest{try(cbd_ap_polls(team = "Duke"))}
#' @export
cbd_ap_rankings <- function(...) {

base_url <- 'https://www.cbbdata.com/api/rankings/ap?'

data <- cbbdata:::get_cbd_file(base_url, ...)

return(data)

}
2 changes: 1 addition & 1 deletion R/cbd_net_archive.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @export
cbd_net_archive <- function(...) {

base_url <- 'https://www.cbbdata.com/api/etc/archive-net?'
base_url <- 'https://www.cbbdata.com/api/rankings/net?'

data <- cbbdata:::get_cbd_file(base_url, ...)

Expand Down
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ reference:
- cbd_bpi_ratings
- cbd_all_metrics
- cbd_net_archive
- cbd_ap_rankings
- title: Player Data
desc: Functions for grabbing player-level data
contents:
Expand Down
18 changes: 18 additions & 0 deletions man/cbd_ap_rankings.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bd2bfb2

Please sign in to comment.