Static Tables
The Static Tables API provides access to structured statistical data tables from BPS (Badan Pusat Statistik) Indonesia. Static tables are pre-compiled data presentations that contain statistical information organized in tabular format, covering various statistical domains including demographics, economics, social indicators, and administrative data.
These tables represent finalized statistical outputs that are regularly published by BPS offices at national, provincial, and regency/city levels. Static tables are essential resources for researchers, analysts, policymakers, and data journalists who need access to official statistical data in structured, downloadable formats.
Understanding Static Tables
Static tables serve as the primary data dissemination format for BPS statistics:
- Official Data Publications: Formally released statistical tables with verified data
- Time Series Data: Historical data spanning multiple periods for trend analysis
- Cross-sectional Analysis: Comparative data across regions, demographics, or categories
- Thematic Coverage: Tables organized by statistical subjects and domains
- Multiple Formats: Available in HTML display and Excel download formats
Table Organization Structure
BPS static tables are systematically organized:
- Domain Classification: Tables grouped by geographic areas (national, provincial, local)
- Subject Categories: Organized by statistical themes and topics
- Temporal Categorization: Filtered by publication year and month
- Content Indexing: Searchable by keywords and table titles
- Format Options: HTML preview and Excel download capabilities
Parameters
| Parameter | Type | Description |
|---|---|---|
domain | String | Domain code (region) for retrieving static tables (required) |
lang | DataLanguage | Language for static table data (default: DataLanguage.id) |
page | int | Page number (default: 1) |
keyword | String? | Keyword for searching static tables (optional) |
month | int? | Month for filtering static tables (optional - 1..12) |
year | int? | Year for filtering static tables (optional) |
Examples
1. Get All Static Tables for a Domain
// Fetch static tables from Central Java BPS
final staticTableResult = await StadataFlutter.instance.list.staticTable(
domain: '3300', // Central Java domain code
lang: DataLanguage.id,
);
final staticTableList = staticTableResult.data;
final pagination = staticTableResult.pagination;
// Print pagination information
print('Current Page: ${pagination.page}');
print('Total Pages: ${pagination.pages}');
print('Data Count in This Page: ${pagination.count}');
print('Per Page: ${pagination.perPage}');
print('Total: ${pagination.total}');
print('------------------------');
// Print retrieved static table data
for (final staticTable in staticTableList) {
print('Table ID: ${staticTable.id}');
print('Title: ${staticTable.title}');
print('Subject: ${staticTable.subject ?? 'Not specified'}');
print('Size: ${staticTable.size}');
print('Updated: ${staticTable.updatedAt}');
print('Excel Download: ${staticTable.excel}');
print('------------------------');
}
2. Search Tables by Keyword
// Search for population-related static tables
final populationTables = await StadataFlutter.instance.list.staticTable(
domain: '0000', // National level
lang: DataLanguage.id,
keyword: 'penduduk', // Search for population tables
);
// Process search results
for (final table in populationTables.data) {
print('Population Table: ${table.title}');
print('Subject: ${table.subject ?? 'General'}');
print('File Size: ${table.size}');
print('Last Updated: ${table.updatedAt}');
// Check if Excel download is available
if (table.excel.isNotEmpty) {
print('Excel Download: ${table.excel}');
}
// Preview HTML table content if available
if (table.table != null && table.table!.isNotEmpty) {
print('Has HTML preview available');
}
print('------------------------');
}
3. Filter Tables by Year and Month
// Get static tables published in December 2023
final recentTables = await StadataFlutter.instance.list.staticTable(
domain: '3200', // West Java
lang: DataLanguage.id,
year: 2023,
month: 12, // December
);
// Analyze recent publications
print('=== December 2023 Publications ===');
for (final table in recentTables.data) {
print('Recent Table: ${table.title}');
print('Subject Area: ${table.subject ?? 'Unspecified'}');
print('Created: ${table.createdAt ?? 'Unknown'}');
print('File Size: ${table.size}');
// Calculate days since publication
if (table.createdAt != null) {
final daysSince = DateTime.now().difference(table.createdAt!).inDays;
print('Published $daysSince days ago');
}
print('------------------------');
}
4. Browse Tables with Pagination
// Systematically browse through all available tables
class StaticTableBrowser {
static Future<void> browseAllTables(String domain) async {
int currentPage = 1;
bool hasMorePages = true;
final allTables = <StaticTable>[];
while (hasMorePages) {
final pageResult = await StadataFlutter.instance.list.staticTable(
domain: domain,
lang: DataLanguage.id,
page: currentPage,
);
allTables.addAll(pageResult.data);
print('Page $currentPage: ${pageResult.data.length} tables');
hasMorePages = currentPage < pageResult.pagination.pages;
currentPage++;
// Add delay to respect API rate limits
await Future.delayed(Duration(milliseconds: 500));
}
print('Total tables collected: ${allTables.length}');
// Analyze table distribution by subject
final subjectGroups = <String, int>{};
for (final table in allTables) {
final subject = table.subject ?? 'Unspecified';
subjectGroups[subject] = (subjectGroups[subject] ?? 0) + 1;
}
print('\\n=== Tables by Subject ===');
subjectGroups.forEach((subject, count) {
print('$subject: $count tables');
});
}
}
5. Advanced Table Discovery and Analysis
// Comprehensive table analysis with multiple filters
class TableAnalyzer {
static Future<void> analyzeTableAvailability(String domain) async {
try {
// 1. Get overview of all tables
final allTables = await StadataFlutter.instance.list.staticTable(
domain: domain,
lang: DataLanguage.id,
);
print('Total tables in domain $domain: ${allTables.pagination.total}');
// 2. Analyze tables by year availability
final currentYear = DateTime.now().year;
final years = [currentYear - 2, currentYear - 1, currentYear];
for (final year in years) {
final yearlyTables = await StadataFlutter.instance.list.staticTable(
domain: domain,
lang: DataLanguage.id,
year: year,
);
print('$year: ${yearlyTables.pagination.total} tables');
}
// 3. Search for economic data tables
final economicTables = await StadataFlutter.instance.list.staticTable(
domain: domain,
lang: DataLanguage.id,
keyword: 'ekonomi',
);
print('Economic tables: ${economicTables.data.length}');
// 4. Find largest tables by file size
final largeTables = allTables.data
.where((table) => table.size.contains('MB'))
.toList()
..sort((a, b) => b.size.compareTo(a.size));
print('\\n=== Largest Tables ===');
for (final table in largeTables.take(5)) {
print('${table.title} - ${table.size}');
}
} catch (e) {
print('Error analyzing tables: $e');
}
}
}
Properties (StaticTable)
| Property | Type | Description |
|---|---|---|
id | int | Unique identifier of the static table |
title | String | Official title or name of the table |
subjectId | int | Subject identifier associated with the table |
subject | String? | Subject name or thematic category (optional) |
size | String | File size of the table data |
table | String? | HTML representation of the table for preview (optional) |
updatedAt | DateTime | Date and time when the table was last updated |
createdAt | DateTime? | Date and time when the table was created (optional) |
excel | String | Direct download URL for the Excel version of the table |