n8n-nodes-destatis
v1.0.3
Published
n8n node for accessing the GENESIS API of the German Federal Statistical Office (Destatis)
Maintainers
Readme
n8n-nodes-destatis
This is an n8n community node that lets you access the GENESIS API of the German Federal Statistical Office (Destatis) and regional statistical offices in your n8n workflows.
GENESIS-Online is the database of the Federal Statistical Office of Germany, providing access to a wide range of statistical data about Germany.
Regionalstatistik provides access to regional statistical data from all German statistical offices at federal and state level.
Important: This node is a community node and NOT an official Destatis node. It is provided as-is and is not supported by Destatis or the regional statistical offices. Read Destatis API Guide and License for more information.
n8n is a fair-code licensed workflow automation platform.
Features
This node provides access to the following resources:
Authentication
- Login Check: Test your API credentials
Catalogue
- List Cubes: Browse available data cubes
- List Tables: Browse available tables
- List Statistics: Browse available statistics
- Search: Full-text search across the catalogue
Data
- Get Table: Download table data in various formats (Excel, CSV, Flatfile CSV)
- Get Cube: Download data cubes
- Get Time Series: Download time series data
Metadata
- Get Cube Metadata: Retrieve metadata for data cubes
- Get Table Metadata: Retrieve metadata for tables
- Get Statistic Metadata: Retrieve metadata for statistics
Transform
- Pivot Table: Transform input data into pivot table format with grouping and aggregation
Installation
Follow the installation guide in the n8n community nodes documentation.
Manual Installation
- Navigate to your n8n installation directory
- Install the package:
npm install n8n-nodes-destatis - Restart n8n
Configuration
Getting API Credentials
For Destatis (Federal Statistics)
- Register for free at GENESIS-Online
- After login, navigate to "Webservice-Schnittstelle (API)"
- Copy your API Token (recommended) or use your username/password
For Regionalstatistik (Regional Statistics)
- Register for free at Regionalstatistik
- After login, navigate to "Webservice-Schnittstelle (API)" or "Mein Account"
- Copy your API Token (recommended) or use your username/password
Note: Regionalstatistik credentials are separate from Destatis credentials. You need to register separately for each service.
Setting up Credentials in n8n
Destatis API Credentials
- In n8n, go to Credentials → New
- Search for Destatis API
- Choose authentication method:
- API Token (recommended): Paste your API token
- Username & Password: Enter your credentials
- The Base URL is pre-configured to
https://www-genesis.destatis.de/genesisWS/rest/2020 - Test the credentials
- Save
Regionalstatistik API Credentials
- In n8n, go to Credentials → New
- Search for Regionalstatistik API
- Choose authentication method:
- API Token (recommended): Paste your API token
- Username & Password: Enter your credentials
- The Base URL is pre-configured to
https://www.regionalstatistik.de/genesisws/rest/2020 - Test the credentials
- Save
Usage
Example 1: Get Consumer Price Index Data
- Add a Destatis node to your workflow
- Select credentials
- Set:
- Resource: Data
- Operation: Get Table
- Code:
61111-0004(Monthly Consumer Price Index) - Language: English or German
- Configure additional options:
- Start Year: 2020
- Format: Excel or Flatfile CSV
- Transpose: true/false
Example 2: Search for Statistics
- Add a Destatis node
- Set:
- Resource: Catalogue
- Operation: Search
- Search Term: "Bevölkerung" (Population)
- Page Length: 50
Example 3: Browse Price Statistics
- Add a Destatis node
- Set:
- Resource: Catalogue
- Operation: List Cubes
- Selection Pattern:
61*(all price statistics) - Page Length: 100
Example 4: Transform Data with Pivot Table
The Transform resource allows you to pivot and aggregate data from any previous node.
- Add a Destatis node to get data (e.g., Get Table)
- Add another Destatis node connected to the first
- Set:
- Resource: Transform
- Operation: Pivot Table
- Row Dimensions:
time(column names, NOT expressions) - Column Dimensions:
statistics_label(or leave empty for simple grouping) - Value Column:
value - Aggregation Function: Sum, Count, Average, or Median
- Filters (optional):
2_variable_label = "Milchkühe"
Important Notes:
- Row Dimensions and Column Dimensions must be column names, not n8n expressions
- ✅ Correct:
time - ❌ Wrong:
{{ $json.time }}(this evaluates to the value, not the column name)
- ✅ Correct:
- Use comma-separated values for multiple dimensions:
time,1_variable_label,2_variable_label - Column Dimensions is optional - leave empty to perform simple grouping without pivoting
- Filters support expressions in the value part:
{{ $json['selected_column'] }} = "value" - All input items are processed together to create the pivot table
How it works:
- Groups data by unique combinations of Row Dimensions
- Creates new columns from Column Dimension values
- Aggregates values according to the selected function
- Returns one row per unique Row Dimension combination
Example Output:
{
"time": "2025-11P1M",
"1_variable_label": "Deutschland insgesamt",
"Viehbestandserhebung Rinder": 374277,
"Andere Statistik": 123456
}Data Formats
The node supports multiple output formats:
- ffcsv (Flatfile CSV): Best for data processing (recommended)
- xlsx (Excel): Best for manual review
- csv (Standard CSV): Compatible with most tools
- html (HTML): For display purposes
Advanced Features
Filtering Data
You can filter table and cube data using:
- Start/End Year: Limit the time range
- Classifying Variables: Filter by classification dimensions
- Regional Variables: Filter by geographic regions
Working with Large Tables
For tables with more than 40,000 values:
- Split requests by year range
- Use the Flatfile CSV format for efficient processing
- Consider using the job queue (requires username/password authentication)
Handling Compressed Data
The Destatis API sometimes returns data as a ZIP archive, even if compression is disabled. If you receive a binary ZIP file:
- Add the Compression node after the Destatis node.
- Set the operation to Decompress.
- Use the Read Binary File node (or similar) to access the extracted CSV.
API Documentation
For detailed API documentation, visit:
Compatibility
- Tested with n8n version 1.0.0+
- Uses GENESIS API version 2020
Resources
- n8n community nodes documentation
- GENESIS-Online (Destatis)
- Regionalstatistik
- Destatis API Documentation
- Regionalstatistik API Documentation
License
Support
For issues and questions:
- Check the GENESIS API documentation
- Open an issue on GitHub
- Visit the n8n community forum
Version History
1.0.3
- Added support for Regionalstatistik API
- New credential type: Regionalstatistik API
- Access to regional statistical data from all German federal states
- Same functionality as Destatis API (authentication, catalogue, data, metadata)
1.1.0
- Added Transform resource with Pivot Table operation
- Pivot functionality supports:
- Row and column dimensions with flexible grouping
- Multiple aggregation functions (Sum, Count, Average, Median)
- Optional filtering with expression support
- Works with any input data, not just Destatis data
1.0.0
- Initial release
- Support for authentication, catalogue browsing, data download, and metadata retrieval
- Multiple output formats (Excel, CSV, Flatfile CSV)
- German and English language support
