Official PxWeb Documentation
The complete PxWeb API specification is available from Statistics Sweden (SCB):PxWeb API 1.0 Description
Official PDF documentation covering the complete PxWeb API specification, including request formats, response types, and filtering options.
Key Concepts
API Structure
The PxWeb API uses a hierarchical structure similar to a file system:- Folders - Databases and levels that contain other folders or tables
- Tables - Data endpoints identified by the
.pxfile extension - Variables - Columns or dimensions within tables
- Values - Specific data points or categories within variables
Request Methods
GET Requests
Used to navigate the API structure and retrieve metadata about databases, folders, and tables.
POST Requests
Used to retrieve actual data from tables by submitting a JSON query with variable selections and response format.
Response Formats
The PxWeb API supports multiple response formats. Specify your preferred format in theresponse.format field of your query:
| Format | Description | Use Case |
|---|---|---|
csv | Comma-separated values | Easy import into R, Excel, or other tools |
json | JavaScript Object Notation | Structured data for web applications |
json-stat | JSON-stat format | Specialized statistical data format |
json-stat2 | JSON-stat 2.0 format | Updated statistical data format |
px | PX-file format | Native PxWeb format |
Query Filters
The PxWeb API documentation describes several filter types for selecting data:Item Filter
Select specific values from a variable:All Filter
Select all available values using the wildcard:Additional Filters
Refer to the official PxWeb documentation for more advanced filtering options including:top- Select top N valuesbottom- Select bottom N valuesagg- Aggregate values based on groupings
Other Statistical Agencies Using PxWeb
Many national statistical agencies worldwide use the PxWeb API:- Statistics Sweden (SCB)
- Statistics Norway (SSB)
- Statistics Denmark (DST)
- Statistics Finland
- And many others
Additional Resources
Available Databases
Browse the complete list of GSS databases
Troubleshooting
Solutions to common issues