The Sector Aggregate and Benchmarking API endpoints enables users to retrieve aggregated yearly measures, bucketed data, and comparisons between companies and their respective sectors. This functionality is essential for financial analysis and decision-making.
/sector-measure-yearly-aggregate-composite
Provides aggregated yearly data for measures, allowing comparison between a company and its sector.
measure_year
: The year for which data is requested. Generally, use the previous year for company accounts.nace_code_identifiers
(optional if benchmark_company_identifier is provided): A comma-separated list of NACE codes.company_measure_type_identifier
: A unique identifier or key for the measure type.benchmark_company_identifier
: A company identifier (UUID or org number with schema prefix, e.g., NO123456789
). When provided, automatically sets geo_subdivision_identifiers
and nace_code_identifiers
based on the benchmark company's details if they aren't explicitly set.benchmark_nace_code_hierarchy_level
: The NACE code hierarchy level to use if benchmark_company_identifier
is given. Defaults to 5.benchmark_geo_level_entity_key
: Geographic level (geo_subdivision
, geo_municipality
, or geo_postal_code
) to derive geographic identifiers from the benchmark company. Defaults to geo_subdivision
.organization_type_identifiers
: Defaults to Norwegian organization types (e.g., NO-AS, NO-ASA).geo_country_identifiers
: Country codes to filter by geographic region.geo_subdivision_identifiers
: Subdivision identifiers for finer geographic filtering.geo_municipality_identifiers
: Municipality identifiers for localized data.geo_postal_code_identifiers
: Postal code identifiers for precise geographic data.lower_percentile
: Minimum percentile boundary for bucket calculation. Default: 0.10.upper_percentile
: Maximum percentile boundary for bucket calculation. Default: 0.90.round_digits
: Rounding precision for measure values. Default: 0.number_of_highest_measures_to_include
: Number of top records to include. Default: 3.number_of_lowest_measures_to_include
: Number of bottom records to include. Default: 3.max_number_of_buckets
: Number of buckets for the response. Default: 10.When you provide a benchmark_company_identifier
:
geo_subdivision_identifiers
, geo_municipality_identifiers
, or geo_postal_code_identifiers
are not explicitly provided, they will be derived based on the benchmark company's business address at the geographic level specified by benchmark_geo_level_entity_key
.nace_code_identifiers
are not explicitly provided, they will be derived based on the benchmark company's NACE codes at the specified hierarchy level (benchmark_nace_code_hierarchy_level
).You can override these auto-filled values by explicitly setting the respective parameters.
Request Example with Benchmarking
GET https://api.enin.ai/analysis/v1/sector-measure-yearly-aggregate-composite?company_measure_type_identifier=company_accounts_operating_revenue_per_employee&benchmark_company_identifier=NO987123987&measure_year=2023
This request automatically populates geographic and NACE code filters based on the benchmark company's details.
Request Example
GET https://api.enin.ai/analysis/v1/sector-measure-yearly-aggregate-composite?company_measure_type_identifier=company_accounts_operating_revenue_per_employee&geo_municipality_identifiers=NO-1103&nace_code_identifiers=NO96.020&measure_year=2023&number_of_highest_measures_to_include=5&number_of_lowest_measures_to_include=5
Here we have populated the parameters manually.
Response Example
[
{
"sector_measure_yearly_aggregate": {
"lower_percentile": 334796,
"upper_percentile": 987363,
"total_count": 119,
"not_null_count": 55,
"null_count": 64,
"average_value": 684335.871442181,
"average_zero_imputed": 316289.68848168,
"median_value": 592624.285494065,
"median_zero_imputed": 0,
"min_value": 0,
"max_value": 3898468.11728395,
"standard_deviation": 505738.590359799,
"standard_deviation_zero_imputed": 484378.923064187,
"highest_company_measure_yearly_composites": [
{
"company_measure_yearly": {
"uuid": "a6d1a6cb-7b79-45e4-b16c-6c4fc7fa0cef",
"company_uuid": "fab8d3ef-70e3-4af6-be03-01022c09472d",
"company_measure_type_uuid": "3a369369-0c99-4598-80e8-b8b5e157c10b",
"measure_year": 2023,
"measure_value": 3898468.11728395,
"app_url": null
},
"company": {
"uuid": "fab8d3ef-70e3-4af6-be03-01022c09472d",
"name": "ELVIS INVEST AS",
"org_nr": "999174922",
"org_nr_schema": "NO",
"app_url": null
}
},
...
],
"lowest_company_measure_yearly_composites": [
{
"company_measure_yearly": {
"uuid": "c0f0697b-56c7-4b6f-9eed-728d16dbaddb",
"company_uuid": "bacb8fcc-8043-4df4-952e-b11017a4b3e9",
"company_measure_type_uuid": "3a369369-0c99-4598-80e8-b8b5e157c10b",
"measure_year": 2023,
"measure_value": 0,
"app_url": null
},
"company": {
"uuid": "bacb8fcc-8043-4df4-952e-b11017a4b3e9",
"name": "COZYMOZ AS",
"org_nr": "918824472",
"org_nr_schema": "NO",
"app_url": null
}
},
...
]
},
"company_measure_yearly_buckets": [
{
"bucket_id": -1,
"bucket_name": "null",
"bucket_lower_bound": null,
"bucket_upper_bound": null,
"company_count": 64,
"company_percentage_of_total": 0.53781512605042,
"company_percentage_of_not_null": null
},
{
"bucket_id": 0,
"bucket_name": "underflow",
"bucket_lower_bound": null,
"bucket_upper_bound": 334796,
"company_count": 6,
"company_percentage_of_total": 0.0504201680672269,
"company_percentage_of_not_null": 0.109090909090909
},
{
"bucket_id": 1,
"bucket_name": "1",
"bucket_lower_bound": 334796,
"bucket_upper_bound": 400052.7,
"company_count": 4,
"company_percentage_of_total": 0.0336134453781513,
"company_percentage_of_not_null": 0.0727272727272727
},
...
{
"bucket_id": 10,
"bucket_name": "10",
"bucket_lower_bound": 922106.3,
"bucket_upper_bound": 987363,
"company_count": 2,
"company_percentage_of_total": 0.0168067226890756,
"company_percentage_of_not_null": 0.0363636363636364
},
{
"bucket_id": 11,
"bucket_name": "overflow",
"bucket_lower_bound": 987363,
"bucket_upper_bound": null,
"company_count": 6,
"company_percentage_of_total": 0.0504201680672269,
"company_percentage_of_not_null": 0.109090909090909
}
],
"company_measure_type": {
"uuid": "3a369369-0c99-4598-80e8-b8b5e157c10b",
"company_measure_type_key": "company_accounts_operating_revenue_per_employee",
"company_measure_type_description": null,
"app_url": null
},
"company_measure_yearly_filters": {
"measure_year": 2023,
"nace_code_uuids": [
"30a63045-402b-4fe6-be0b-61868913ee6c"
],
"company_measure_type_uuid": "3a369369-0c99-4598-80e8-b8b5e157c10b",
"organization_type_uuids": [
"d9d5ae4f-fdcd-5df3-abea-f954c4809c83",
"adef2610-b586-5f3a-b02f-c9c82a7113f4"
],
"geo_country_uuid": "c21d1ebf-96b7-4eef-97c4-d9867aa41a0e",
"geo_subdivision_uuids": null,
"geo_municipality_uuids": [
"304c2a4d-eac5-46df-b08b-0b8309cbef32"
],
"geo_postal_code_uuids": null,
"lower_percentile": 0.1,
"upper_percentile": 0.9,
"round_digits": 0,
"number_of_highest_measures_to_include": 5,
"number_of_lowest_measures_to_include": 5,
"number_of_buckets": null
}
}
]
Response Explenation
The response from the /sector-measure-yearly-aggregate-composite
endpoint is structured as an array of objects, each representing a full set of aggregations and metadata for a given query.
Key components of the response:
sector_measure_yearly_aggregate
:
This object contains statistical aggregates and metrics derived from the selected group of companies:
lower_percentile
and upper_percentile
: The actual numeric boundaries used to form the percentile-based buckets.total_count
: Total number of companies in the filtered down dataset.not_null_count
and null_count
: Counts of companies with and without available measure data.average_value
, average_zero_imputed
, median_value
, and median_zero_imputed
: Statistical measures (mean and median) both in their raw form and in a "zero-imputed" form, where missing values are treated as zero. This dual reporting can help analysts understand the impact of missing data on calculations.min_value
and max_value
: The smallest and largest observed values for the measure within the filtered dataset.standard_deviation
and standard_deviation_zero_imputed
: The spread or variance of the data, again shown with and without zero imputation.highest_company_measure_yearly_composites
and lowest_company_measure_yearly_composites
: Arrays listing the companies with the highest and lowest measure values, allowing quick identification of outliers, leaders, and laggards.Each entry in highest_company_measure_yearly_composites
and lowest_company_measure_yearly_composites
includes both:
company_measure_yearly
object: Details about the company-specific measure, such as measure_year
and measure_value
.company
object: Core identity details of the company (e.g., name
, org_nr
).company_measure_yearly_buckets
:
This array breaks down the entire dataset into percentile-based buckets, including:
null
bucket: Companies without data for the requested measure.underflow
and overflow
buckets: Companies below the lower percentile or above the upper percentile thresholds.bucket_id
: 1, 2, ...): Companies that fall within defined percentile ranges.For each bucket, you see:
bucket_lower_bound
and bucket_upper_bound
: Numeric boundaries defining the bucket’s range.company_count
: How many companies fall into that bucket.company_percentage_of_total
: The proportion of the entire dataset represented by this bucket.company_percentage_of_not_null
: The proportion of non-null data companies represented by this bucket (omitted for null buckets).Bucketing helps analysts quickly understand data distribution, identify clustering around certain values, and detect trends in performance. It can be used to visualzie a histogram plot.
company_measure_type
:
Information about the measure being analyzed:
company_measure_type_key
: A textual key describing the type of measure (e.g., company_accounts_operating_revenue_per_employee
).uuid
: Unique identifier for the measure type.company_measure_yearly_filters
:
A recap of the filters and parameters applied to the query:
measure_year
: The year of interest.nace_code_uuids
, organization_type_uuids
, geo_municipality_uuids
: Lists of identifiers used to scope the query by industry codes, organization types, or geographic areas.lower_percentile
, upper_percentile
, round_digits
, top_n
, bottom_n
, and number_of_buckets
: The exact parameters used to determine bucketing, rounding, and how many companies to return in the top and bottom lists.In essence, the response provides a comprehensive snapshot of how a given measure is distributed across a filtered set of companies. It empowers analysts to understand not only the raw statistics of the data but also how these statistics break down across meaningful segments—be it by percentile buckets, top/bottom performers, or industry/geographic filters.
Understanding imputed values
In financial data analysis, we often encounter two types of "missing" data:
We use imputation (specifically zero-imputation) only for the second case. Here's why:
When a company submits financial statements with empty values for certain measures, it typically indicates that the measure equals zero rather than being truly "missing". For example, if a company reports no R&D expenses, it usually means they didn't have any R&D activities that year, not that the data is unknown.
Example:
Consider analyzing "Interest Income" across 100 companies:
In non-imputed calculations (average_value, median_value):
In zero-imputed calculations (average_zero_imputed, median_zero_imputed):
Choose zero-imputed metrics when:
Use non-imputed metrics when:
/company-measure-yearly-composite
Provides yearly measures for specific companies, allowing direct comparison to sector data.
measure_year
: Year for which data is requested.company_measure_type_identifiers
: Comma-separated list of measure type UUIDs or keys.company_identifier
: Unique identifier for the company.Request:
GET https://api.enin.ai/analysis/v1/company-measure-yearly-composite?company_identifier=NO917540640&company_measure_type_identifiers=company_accounts_current_ratio&measure_year=2023
Response:
[
{
"uuid": "e85a001b-c407-40bb-acfc-b39291916d0b",
"company_measure_yearly": {
"uuid": "e85a001b-c407-40bb-acfc-b39291916d0b",
"company_uuid": "f0e01f1e-f977-429f-ac12-0f0418901bfe",
"company_measure_type_uuid": "bad42879-af40-413b-872e-b22a8fa8f158",
"measure_year": 2023,
"measure_value": 2.0370056046957243,
"app_url": null
},
"company_measure_type": {
"uuid": "bad42879-af40-413b-872e-b22a8fa8f158",
"company_measure_type_key": "company_accounts_current_ratio",
"company_measure_type_description": null,
"app_url": null
}
}
]
/company-measure-type
Lists all available measure types.
Request:
GET https://api.enin.ai/analysis/v1/company-measure-type
Response:
[
{
"uuid": "978623bf-1b96-48d5-a646-81877030c88d",
"company_measure_type_key": "registered_employee_count_average",
"company_measure_type_description": null,
"app_url": null
},
{
"uuid": "e5d75164-95a3-4a64-bdd4-b3c607303da8",
"company_measure_type_key": "company_accounts_ebitda",
"company_measure_type_description": null,
"app_url": null
},
...
]
The API supports defining custom ranges for bucketed data analysis.
lower_percentile
.upper_percentile
.Example
lower_percentile
** = 0.10**: Buckets start from the 10th percentile.upper_percentile
** = 0.90**: Buckets end at the 90th percentile.In certain scenarios, it is possible that the chosen lower_percentile
and upper_percentile
values yield the same numeric boundary. This commonly occurs when all data points are identical, causing the percentile calculations to collapse into a single value rather than a range. In such cases, the bucketing system cannot distribute data across multiple buckets between the lower and upper percentiles.
How We Handle This Case
When this situation arises, rather than returning an error or invalid data, the system simplifies the output:
This approach ensures that the API still returns a meaningful and valid response even under extreme conditions of uniform data distribution.
Specify round_digits
to control the bucket start location. This is usefull when buckets percentiles start at a artificially specific value. E.g., if the 5 percentile value is 1433.812 it can be usefull to use a round_digits=-2
so that the first bucket starts at a more visually pleasing 1400.
Examples
round_digits
** = 2**: 1433.812 → 1433.81round_digits
** = -1**: 1433.812 → 1430Refer to the Swagger documentation for detailed endpoint descriptions and parameter configurations.
Swagger URL: https://api.enin.ai/documentation
Retrieve sector-level aggregates and compare them with specific companies using the /company-measure-yearly-composite
endpoint.
Filter results by geographic identifiers like municipalities and postal codes to focus on localized performance.
Use percentile bucketing and rounding options to analyze financial data within specific ranges.
For additional help, reach out to the Enin support team at support@enin.ai or join our Slack channel.