Python
All examples are using Python Pandas
CSV examples, using API: Readymade datasets
- Get a small dataset, Index on Retail Sales, and plot it
- Main Economic Forecasts, Shows basic plots using Pandas plot and Plotly Express.
JSON-Stat examples using the library pyjstat and Http POST towards PxWebApi
- simple pyjstat example - export of salmon
- two-datasets-in-one-chart combines two datasets from two Statbank tables using Pandas pivot, and plot using Matplotlib
- National accounts - monthly, quarterly yearly volume change
- Get both Code and Text - Foreign trade HS-code example
- stats-to-pandas From StatBank to pandas (old)
These Python examples as Jypyter Notebooks
R
Statistics Norway has made two packages:
- PxWebApiData: Function to read PxWeb(StatBank) data into R via API. Example of use
- PxWebApiData call creator Simplifies the use og PxWebApiData
- KlassR : R package for standard classifications at Statistics Norway. Introduction
Statbank examples, using libraries rjstat for JSON-Stat og httr
- Simple example using readymade dataset (GET)
- API: Create your own dataset example (POST)
- Simple example using Eurostat API (GET)
Javascript / Highcharts
Examples using the library JSON-Stat Toolkit together with Highcharts and Jquery.
- A very simple line chart based on a very small dataset
- Simple line chart using http POST query and the filter top
- CPI line chart using POST and filter all
- More Highcharts examples
Excel / Power BI
Check out the service: Q4OpenData - Query for OpenData, which generate script-code.
Select: Statistics Norway from the menu, or see short video
SAS
- getstatbanktable SAS-macro to get Statbank tables
Tableau
Other
The JSON-stat Explorer is a useful tool for understanding JSON-stat.
- Utilising our external APIs - Paper Nordic statstical meeting 2022 (pdf)
- Experiences serving API to External users - presentation Int. PX-meeting 2022 (pdf)
- List of tools and tips for utilizing the PxWebApi (xslx)