options(encoding="UTF-8") library(httr) # use rjstat JSON-stat library library(rjstat) # Adress to the very small readymade JSON-Stat dataset for Retail Sales Index url <- "http://data.ssb.no/api/v0/dataset/1066.json?lang=en" d.tmp<-GET(url) # get content from d.tmp as text, using fromJSONstat sbtable <- fromJSONstat(content(d.tmp, "text")) # get only datasett from sbtable ds <- sbtable[[1]] # Show dataset ds # Barplot of the boring type barplot(ds$value, names.arg = ds$`time`) # ====== # Same using the R-package PxWebApiData and the url above library(PxWebApiData) ApiData1(url, getDataByGET = TRUE)