Skip to main content
Version: latest

Statistical Classification (KBKI & KBLI)

This method is used to retrieve the list of Indonesian Standard Industrial Classification (KBLI) & Indonesian Standard Commodity Classification (KBKI) from the BPS API. It enables users to access information regarding classification codes and their descriptions.

Enums

There are two enum classes that can be used as parameters.

ClassificationType

ClassificationType is the base class for determining the type of classification. This class is then extended by KBLIType and KBKIType. Each of these classes has the following options.

  • KBLIType

    EnumValueDescription
    KBLI.y2009kbli2009KBLI year 2009
    KBLI.y2015kbli2015KBLI year 2015
    KBLI.y2017kbli2017KBLI year 2017
    KBLI.y2020kbli2020KBLI year 2020

    To make a request to the detail endpoint, the KBLI code needs to be formatted in the kbli_year_code format. This class also facilitates this formatting process through the urlParamGenerator method which accepts the code parameter.

    Example:

    final url = KBLIType.y2009.urlParamGenerator('24');
    /// result: kbli_2009_24
    final value = KBLIType.y2009.value;
    /// result: kbli2009
    final year = KBLIType.y2009.year;
    /// result: 2009
  • KBKIType

    EnumValueDescription
    KBKI.y2015kbki2015KBKI year 2015

    To make a request to the detail endpoint, the KBKI code needs to be formatted in the kbki_year_code format. This class also facilitates this formatting process through the urlParamGenerator method which accepts the code parameter.

    Example:

    final url = KBKIType.y2015.urlParamGenerator('24');
    /// result: kbki_2015_24
    final value = KBKIType.y2015.value;
    /// result: kbki2015
    final year = KBKIType.y2015.year;
    /// result: 2015

ClassificationLevel

ClassificationLevel is the base class for determining the group/level of classification. This class is then extended by KBLILevel and KBKILevel. Each of these classes has the following options.

  • KBLILevel

    EnumValueDescription
    KBLILevel.categorycategoryRepresents the main classification. Marked with a single alphabet.
    KBLILevel.primaryGroupprimary groupDetailed description from category, each coded with two digits.
    KBLILevel.groupgroupFurther details from the primary group, each coded with three digits. The first two indicate the primary group and the last digit the economic activity.
    KBLILevel.subGroupsubgroupFurther detail from a group's economic activities, coded with four digits. The first three indicate the group and the last digit specifies the sub-group.
    KBLILevel.clusterclusterDistinguishes activities within a subgroup into more homogeneous activities, coded with five digits.

    This class also facilitates the KBLI code validation process through the validateCode method.

    Example:

    final isValid = KBLILevel.category.validateCode('A');
    /// result: true
    final value = KBLILevel.category.value;
    /// result: category
  • KBKILevel

    EnumValueDescription
    KBKILevel.sectionsectionGeneral classification outline, 1-digit code, 5 sections, 0-4.
    KBKILevel.divisiondivisionDetailed description from section, 2-digit code.
    KBKILevel.groupgroupFurther details from division, 3-digit code.
    KBKILevel.classesclassesFurther details from group, 4-digit code.
    KBKILevel.subClasssubclassDetailed from classes, 5-digit code.
    KBKILevel.commodityGroupcommodity groupDetailed from sub-classes, 7-digit code for commodity group.
    KBKILevel.commoditycommodityDetailed from commodity group, 10-digit code for commodities.

    This class also facilitates the KBLI code validation process through the validateCode method.

    Example:

    final isValid = KBKILevel.section.validateCode('A');
    /// result: false
    final value = KBKILevel.section.value;
    /// result: section

Parameters

ParameterTypeDescription
typeClassificationTypeSpecifies the classification type from the KBLIType or KBKIType enum.
levelClassificationLevel?Specifies the classification level from the KBLILevel or KBKILevel enum. (optional)
langDataLanguageThe language used for KBLI/KBKI data (default: DataLanguage.id).
pageintPage number (default: 1).
perPageintNumber of data per page (default: 10).

Example

Here is an example of usage:

// Fetch KBLI/KBKI data from the BPS API
final result = await StadataFlutter.instance.list.statisticClassifications(
type: KBLIType.y2015,
level: KBLILevel.category,
);
final statisticClassificationsList = result.data;
final pagination = result.pagination;

// Display page information
print('Current Page: ${pagination.page}');
print('Total Pages: ${pagination.pages}');
print('Data Count on This Page: ${pagination.count}');
print('Per Page: ${pagination.perPage}');
print('Total: ${pagination.total}');
print('------------------------');

// Display the retrieved statuc classification data
for (final statisticClassifications in statisticClassificationsList) {
print('Statistic Classification ID: ${statisticClassifications.id}');
print('Source: ${statisticClassifications.source}');
print('Title: ${statisticClassifications.title}');
print('Description: ${statisticClassifications.description}');
print('Last Update: ${statisticClassifications.lastUpdate}');
print('Release Date: ${statisticClassifications.releaseDate}');
print('Previous Classification Items: ${statisticClassifications.previous}');
print('Derived Classification Items: ${statisticClassifications.derived}');
print('Flag: ${statisticClassifications.flag}');
print('Tags: ${statisticClassifications.tags}');
print('Type: ${statisticClassifications.type}');
print('Level: ${statisticClassifications.level}');
print('ISBN: ${statisticClassifications.isbn}');
print('ISSN: ${statisticClassifications.issn}');
print('Catalogue Number: ${statisticClassifications.catalogueNumber}');
print('Publication Number: ${statisticClassifications.publicationNumber}');
print('Location: ${statisticClassifications.location}');
print('URL: ${statisticClassifications.url}');
print('MFD: ${statisticClassifications.mfd}');
}

Properties

  • StatisticClassification
PropertyTypeDescription
idStringUnique identifier for KBLI/KBKI.
typeClassificationType?Classification type.
levelClassificationLevel?Classification level.
sourceStringData source.
titleStringTitle.
descriptionStringDescription.
isbnString?ISBN number.
issnString?ISSN number.
catalogueNumberString?Catalogue number.
publicationNumberString?Publication number.
lastUpdateDateTimeLast update date.
releaseDateDateTimeRelease date.
locationString?Location.
urlString?URL.
mfdString?MFD information.
previousList<ClassificationItem>List of previous classification items.
derivedList<ClassificationItem>List of derived classification items.
flagboolFlag.
tagsList<String>List of tags.
  • ClassificationItem
PropertyTypeDescription
codeStringCode.
titleStringTitle.
descriptionStringDescription.