knitr::opts_chunk$set( collapse = TRUE, comment = "#>", eval = FALSE )
You can also take advantage of the static (read-only) API on github through githubusercontent
.
endpoint
: https://raw.githubusercontent.com/lancs-macro/hopi/master/data
GET /{release}/{frequency}/{category}/
release
: format %YYYY-Q%q (e.g. 2019-Q4).frequency
: one of "annual", "quarterly" or "monthly" (TBA "weekly", "daily").category
: one of "nuts1", "nuts2", "nuts3", "aggregate", "all".GET /classifications.csv
library(readr) ukhp_get <- function(release = "2020-Q3", frequency = "monthly", classification = "nuts1") { endpoint <- "https://raw.githubusercontent.com/lancs-macro/hopi/master/data" query <- paste(endpoint, release, frequency, paste0(classification, ".csv"), sep = "/") readr::read_csv(query) } ukhp_get() ukhp_get(frequency = "quarterly")
import pandas as pd def ukhp_get(release = "latest", frequency = "monthly", classification = "nuts1"): endpoint = "https://lancs-macro.github.io/uk-house-prices" query_elements = [endpoint, release, frequency, classification + ".json"] query = "/".join(query_elements) print(pd.read_csv(query)) ukhp_get()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.