What is PxWeb?
The GSS StatsBank API is built on PxWeb technology, a standardized API framework developed by Statistics Sweden and used by statistical agencies worldwide. PxWeb provides a consistent, RESTful interface for accessing statistical databases programmatically.PxWeb is maintained by Statistics Sweden (SCB) and is used by numerous national statistical offices globally, ensuring reliability and adherence to international standards.
How PxWeb Works
PxWeb organizes statistical data using a hierarchical file-system-like structure:Think of the API like a file explorer on your computer: it has a hierarchy of “folders” (Databases and Topics) that eventually lead to “files” (Tables).
Key Characteristics
RESTful Architecture
The PxWeb API follows REST principles:- GET requests retrieve information about available databases, topics, and table metadata
- POST requests retrieve actual data from tables with specified filters and format
Table Identification
Tables in the PxWeb system are identified by the.px extension:
.px, you’ve found a data table rather than a navigation folder.
Standardized Response Format
The API returns JSON responses at each navigation level:Database Level Response
Database Level Response
At the root level, the API returns available databases:
Topic Level Response
Topic Level Response
Within a database, the API returns available topics:
Notice that the root level uses
"dbid" while sub-levels use "id" for identification.Table Metadata Response
Table Metadata Response
When you reach a table, the API returns metadata including available variables:
API Endpoints
The GSS StatsBank API base URL is:Example Endpoint
Official Documentation
For detailed technical specifications of the PxWeb API, refer to the official documentation: PxWeb API Documentation (PDF) The official documentation includes:- Complete API specification
- Advanced query filter options
- Supported response formats
- Error handling guidelines