Lewati ke konten utama
Versi: terbaru

SDG Indicators

The SDG Indicators API provides access to Sustainable Development Goals (SDGs) indicator data from the BPS (Badan Pusat Statistik) API. Each entry represents a statistical indicator variable associated with a specific SDG goal (1–17).

Parameters

ParameterTypeDefaultDescription
domainStringRequiredBPS domain code (e.g. '0000' for national)
goalintRequiredSDG goal number (1–17) to filter indicators
langDataLanguageDataLanguage.idResponse language — DataLanguage.id or DataLanguage.en
pageint1Page number for pagination

Examples

1. Get SDG Indicators for Goal 1

final result = await StadataFlutter.instance.list.sdgIndicators(
domain: '0000',
goal: 1,
);

for (final indicator in result.data) {
print('${indicator.id}: ${indicator.title} (${indicator.unit})');
print('Goal: ${indicator.goalName}');
print('SDGs ID: ${indicator.sdgsId}');
}

2. Get SDG Indicators in English

final result = await StadataFlutter.instance.list.sdgIndicators(
domain: '0000',
goal: 3,
lang: DataLanguage.en,
);

3. Paginated Fetch

final result = await StadataFlutter.instance.list.sdgIndicators(
domain: '0000',
goal: 7,
page: 2,
);

Properties

PropertyTypeDescription
idintUnique identifier of the SDG indicator variable (var_id)
titleStringOfficial title of the SDG indicator variable
goalStringSDG goal code, e.g. "sdgs_1" (sdgs_goal)
goalNameStringHuman-readable SDG goal name, e.g. "1. Tanpa Kemiskinan" (sdgs_goal_name)
sdgsIdStringSDG indicator reference code, e.g. "1.2.1*" (sdgs_id)
subjectIdintIdentifier of the statistical subject this indicator belongs to (sub_id)
subjectNameStringName of the statistical subject (sub_name)
unitStringUnit of measurement for the indicator values
definitionStringDefinition or description of the indicator (def)
notesStringMethodological notes, may contain HTML content
verticalVariableIdintIdentifier linking to the associated vertical variable (vertical)
graphIdintIdentifier for the chart/graph type (graph_id)
graphNameStringName of the chart/graph type, e.g. "bar" (graph_name)
metaActivityString?URL to the activity metadata in SIRUSA (meta_activity), may be null
metaVarString?URL to the variable metadata in SIRUSA (meta_var), may be null

Error Handling

try {
final result = await StadataFlutter.instance.list.sdgIndicators(
domain: '0000',
goal: 1,
);
print('Found ${result.data.length} indicators');
} on SdgException catch (e) {
print('SDG error: ${e.message}');
} catch (e) {
print('Unexpected error: $e');
}

See Also