PxWebApi v2
The API allows you to retrieve statistics directly from the Statistics Database in a machine-readable format that can be used to automate data retrieval, build your own apps, reports or analyses.
The new PxWebApi v2 is even better than PxWebApi v1 in that it is more stable and allows more powerful queries for extraction. The new API is also used to provide data in PxWeb 2 as a standalone application.
News in PxWebApi v2
- Via PxWebApi v2 you can retrieve data via GET, not just POST as before. The query can then be defined in the URL.
- Can go against either file or SQL/CNMM database
- Is a separate application that can run on Windows or Linux
The main differences compared to PxWebApi v1
- The structure of the URLs has been changed so that they are more stable and not affected by structural changes in the database and at the same time comply with a RESTful design.
- The API will expose more of the metadata we have access to.
- The user experience for retrieving data will be improved.
- More advanced expressions for filtering out the information you want to retrieve via the API will be offered.
Convert PxWebApi v1 to PxWebApi v2
To facilitate the transition to PxWebApi 2 we have developed a converter that alliws you to translate your existing links.
Convert PxWebApi 1.0 to PxWebApi v2
Documentations
Specification
https://github.com/statisticssweden/PxApiSpecs/blob/master/PxAPI-2.yml
Please register questions and comments as an issue at Github:
https://github.com/PxTools/PxWebApi/issues
Source code
https://github.com/PxTools/PxWebApi
The beta version
PxWebApi v2 is backward compatible with PxWebApi v2- Beta, which means that withdrawals that was made in the Beta format still works when the beginning of the URL changes to the new one.
In PxWebApi-beta https://api.scb.se/ov0104/v2beta/api/v2/
change to PxWebApi 2 https://statistikdatabasen.scb.se/api/v2/
Contact: px@scb.se