knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

onsr

R-CMD-check Lifecycle: experimental CRAN status R-CMD-check

NOTE: This API is currently in Beta and still being developed. Please be aware that as a result of this there may occasionally be breaking changes.

The goal of onsr is to to provide a client for the 'Office of National Statistics' ('ONS') API https://api.beta.ons.gov.uk/v1.

Installation

# Install release version from CRAN
install.packages("onsr")

You can install the development version of onsr from GitHub.

# install.packages("devtools")
devtools::install_github("kvasilopoulos/onsr")

If you encounter a clear bug, please file a reproducible example on GitHub.

Example

This is a basic example which shows you how to download data with onsr.

library(onsr)

ons_get(id = "ageing-population-estimates")

# All the available id names
ons_ids()

Rate limiting

The ONS API applies rate limiting to ensure a high quality service is delivered to all users and to protect client applications from unexpected loops.

The following rate limits have been implemented:

If you exceed these limits the API will return a 429 Too Many Requests HTTP status code and a Retry-After header containing the number of seconds until you may try your request again.



kvasilopoulos/onsr documentation built on Jan. 25, 2024, 3:27 p.m.