knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
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.
# 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.
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()
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:
120 requests per 10 seconds
200 requests per 1 minute
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.