This guide is for statisticians, analysts, and data managers who want to use StatBus to manage and analyze business registry data.
- Getting Started
- Accessing Your StatBus Instance
- Loading Data
- Integrating with StatBus
- User Management
- Cloud Testing Environment
StatBus is a statistical business registry system that tracks business activity throughout history using temporal tables. It allows you to:
- Manage classifications (activity categories, regions, sectors, legal forms)
- Track legal units and establishments over time
- Query data at any point in history
- Generate reports and export data
- Access data via web interface, REST API, or direct PostgreSQL connection
StatBus has four user roles:
- admin_user: Full system access - can manage users, settings, and all data
- regular_user: Can enter and edit data - but not change setup/classifications
- restricted_user: Can only insert/edit data for selected regions or activity categories
- external_user: Read-only access - can view everything but not change anything
Contact your StatBus administrator to get your username and password.
-
Open your StatBus URL in a web browser (provided by your administrator)
- Example:
https://statbus.example.com
- Example:
-
Log in with your username and password
-
Dashboard: After logging in, you'll see the main dashboard with:
- Summary statistics
- Recent activity
- Quick actions menu
Press Ctrl+Shift+K (or Cmd+Shift+K on Mac) to open the command palette. This provides quick access to:
- Data loading functions
- Report generation
- History statistics report
- Database management (admin only)
- User management (admin only)
StatBus requires data to be loaded in a specific order to maintain referential integrity. Use the command palette (Ctrl+Shift+K) to access data loading options.
Follow this order when loading data for the first time:
Choose your country's activity classification system:
- NACE: European standard (StatBus includes Norwegian translations)
- ISIC: International standard
- Custom: Your own classification system or customized addons to ISIC or NACE
Load classifications in this order:
a) Regions (geographic areas)
- Download sample CSV from "What is Region file?" in the command palette
- Format: code, name, parent_code (for hierarchical regions)
- Example:
NO-03, Oslo, NO(Oslo region, parent Norway)
b) Sectors (institutional sectors)
- Download sample CSV
- Format: code, name, description
- Example:
S11, Non-financial corporations
c) Legal Forms (company types)
- Download sample CSV
- Format: code, name, description
- Example:
AS, Aksjeselskap, Norwegian stock company
d) Custom Activity Categories (optional)
- Contains translations and local variations of activity codes
- Useful for adding Norwegian translations to NACE codes
- Format: code, name, description, parent_code
After classifications are loaded, upload your business units:
a) Legal Units (companies, organizations)
- Must reference valid: regions, sectors, legal forms, activity categories
- Sample data uses Norwegian regions and NACE codes
- Format: tax_ident, name, birth_date, death_date, etc.
b) Establishments (physical locations)
- Must reference valid legal units
- Sample data uses Norwegian regions and NACE codes
- Format: tax_ident, legal_unit_id, name, address, etc.
- Start small: Test with a small sample (10-100 units) before loading full dataset
- Validate classifications: Ensure all referenced codes exist before loading units
- Check data format: Download sample CSV files to see expected format
- Backup regularly: Use the export functionality before making major changes
- Incremental loading: You can add more data after initial load
StatBus includes sample data files for testing and demonstration:
- Activity Categories: Sample data uses ISIC (International Standard Industrial Classification) as most StatBus countries use this standard
- Regions: Demo files show how to define region hierarchies in CSV format
- Units: Sample legal units and establishments for testing
To use demo data:
- Open command palette (Ctrl+Shift+K)
- Select data loading options
- Download sample CSV files from the prompts
- Upload sample files to see StatBus in action
- You can delete and reload data as needed for testing
To start over with a clean database:
- Open command palette (Ctrl+Shift+K)
- Select "Reset all data" (admin only)
- Confirm the operation
- Reload classifications and units
StatBus provides multiple ways to access and integrate data:
Best for web applications and scripting (Python, R, JavaScript).
Learn more: See Integration Guide
Quick example (Python):
import requests
# Get your API key from: https://your-statbus-url/rest/api_key?select=token
api_url = "https://your-statbus-url"
api_key = "your-api-key-here"
headers = {"Authorization": f"Bearer {api_key}"}
response = requests.get(f"{api_url}/rest/legal_unit?limit=10", headers=headers)
units = response.json()Best for SQL tools, data analysis, and bulk operations.
Learn more: See Integration Guide
Quick example (psql):
# Set connection parameters
export PGHOST=your-statbus-domain.com
export PGPORT=5432
export PGDATABASE=statbus
export PGUSER=your_username
export PGPASSWORD=your_password
export PGSSLNEGOTIATION=direct
export PGSSLMODE=verify-full
export PGSSLSNI=1
# Connect
psql
# Query data
SELECT * FROM public.legal_unit LIMIT 10;Supported tools:
- psql: PostgreSQL command-line client
- pgAdmin: Graphical administration tool
- DBeaver: Universal database tool
- Python: psycopg2, psycopg3, SQLAlchemy
- R: RPostgres, DBI
- Node.js: pg, pg-promise
StatBus includes pg_graphql for GraphQL queries.
Endpoint: https://your-statbus-url/rest/rpc/graphql
- Log in to StatBus web interface
- Click your username in the top right
- Select "Change Password"
- Enter current password and new password
- Click "Update"
- Log in to StatBus web interface
- Visit:
https://your-statbus-url/rest/api_key?select=token - Copy the token value
- Store it securely (treat it like a password)
Administrators can manage users through:
- Web interface: User Management section
- Command palette: "Manage Users"
- Direct SQL:
SELECT * FROM admin.users;
Before deploying StatBus locally or for production, we recommend testing in the cloud environment:
- No installation required: Test immediately without setup
- Country-specific: Get a dedicated domain for your country
- Pre-configured: Standard classifications already loaded
- Validation: Verify the data model fits your needs
- Training: Learn the system before committing to deployment
Contact Statistics Norway (SSB) to request:
- A dedicated testing domain (e.g.,
your-country.statbus.org) - Admin credentials for your instance
- Sample data tailored to your country's classifications
- Get access: Request your testing instance
- Load sample data: Use provided sample files for your country
- Test classifications: Verify activity codes, regions match your needs
- Test workflows: Try data loading, querying, reporting
- Evaluate: Determine if StatBus meets your requirements
- Deploy locally: Once validated, proceed with local installation
- Detailed guides: https://www.statbus.org/files/Statbus_faq_load.html
- Contact SSB: Visit https://www.statbus.org for contact information
- Integration Guide: REST API and PostgreSQL connection examples
- Service Architecture: Technical architecture details
- Deployment Guide: For administrators deploying single instance
- Cloud Guide: For SSB staff managing multi-tenant cloud
- Development Guide: For developers contributing to StatBus
- Issue Tracker: https://github.com/statisticsnorway/statbus/issues
- Website: https://www.statbus.org
- Email: Contact your StatBus administrator or SSB
Q: Can I export data to Excel?
A: Yes, use the export functionality or connect Excel directly via PostgreSQL ODBC driver.
Q: How do I query historical data?
A: Use temporal queries with valid_from/valid_to dates. Example: SELECT * FROM legal_unit WHERE '2023-01-01' BETWEEN valid_from AND valid_to;
Q: What happens if I upload duplicate data?
A: StatBus will reject duplicates based on unique identifiers (tax_ident). Update existing records instead.
Q: Can multiple users edit data simultaneously?
A: Yes, StatBus supports concurrent editing with row-level locking.
Q: How do I backup my data?
A: Contact your administrator for database backup procedures. Users can export data via REST API or PostgreSQL.