Skip to content

seharb2995/ssb-api-python-examples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssb-api-python-examples

Jupyter notebooks on how to use Python to access Statstics Norways APIs

Statistics Norway has got three external APIs. The most important one is the API:Create your own dataset or PxWebApi. Here are examples on how to use the APIs from Python.

The plan is to give all examples both in Norwegian and in English.

Examples using the API: Readymade datasets

  • The Norsk / in English a very basic example on Index of retail sales towards .
  • Norsk / English Import a readymade CSV dataset, Main Economic Forecasts, to Pandas. Shows basic plots using Pandas plot and Plotly Express.

Examples using http POST to query API:Create your own datasets PxWebApi

  • Norsk / English http POST example, combines two datasets from two Statbank tables using Pandas pivot, and plot them using Matplotlib.

  • Konkurs-datokonv / English shows the use of a general function for converting the time variable from category to date, and the difference of the two in two plots. The table used is on weekly bankruptcies.

  • nr-dateconv-nor / English shows posting of the same query for GDP changes to tables with different frequency, and the use of the function dateconv() which converts from Categories to dateformat and set a Pandas PeriodIndex.

  • text-code / English shows how to get both text and code from JSON-stat. Example using HS-code from monthly Foreign trade by country.

  • Laks-no / English is a basic example on using http POST to query API:Create your own datasets or PxWebApi.

Examples on Statistics Norways Statistical Classifications and Codelists API

  • Klasskommune examples on how to get classifications, versions, changes, correspondence tables and variants.
  • KOSTRA arter og funksjoner hvordan hente og filtrere KOSTRA arter og funksjoner med definisjoner via Klass API (KOSTRA - Municipality-State-Reporting)

Using R? Try our R-package PxWebApiData

About

Examples on how to use Statistics Norways external API in Jupyter notebooks. Examples are both in Norwegian and in English

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 100.0%