> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syrto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Aggregate companies

> Get aggregated financial statistics — count, average, median, min, max — for companies matching sector, region, size, and metric filters.

`syrto_aggregate_companies` returns statistical summaries (count, average, median, min, max) for companies matching your filters. Use it to understand market segments — e.g. "average revenue of medium manufacturing companies in Veneto" or "how many large companies are in sector C".

<Tip>
  This tool returns **aggregate statistics**, not individual company data. To find specific companies matching the same filters, use [`syrto_search_companies`](/mcp/tools/search-companies).
</Tip>

## Use this tool to

* Count companies matching a set of criteria
* Get average, median, or range statistics for a metric across a segment
* Benchmark a company against its market segment

## Arguments

<ParamField query="year" type="integer" required>
  Fiscal year to aggregate.
</ParamField>

<ParamField query="aggregate_metric_slugs" type="string (JSON array)" required>
  JSON array of 1–10 metric slugs to compute statistics for. Use [`syrto_search_metric_definitions`](/mcp/tools/metric-definitions) or [`syrto_list_available_metrics`](/mcp/tools/list-available-metrics) to find valid slugs.

  **Example:** `'["revenues_from_sales_and_services", "ebitda"]'`
</ParamField>

<ParamField query="anagraphic_filters" type="string (JSON object)">
  Company profile filters as a JSON object. All fields are optional:

  | Field                                      | Type   | Description                                                                                                                            |
  | ------------------------------------------ | ------ | -------------------------------------------------------------------------------------------------------------------------------------- |
  | `nace`                                     | string | EU NACE sector code. Auto-detects level: section letter (`A`–`U`), division (2 digits), group (e.g. `"10.1"`), class (e.g. `"10.11"`). |
  | `nuts`                                     | string | EU NUTS region code. Auto-detects level: level 1 (3 chars), level 2 (4 chars), level 3 (5 chars).                                      |
  | `semantic_search`                          | string | Natural language description to search company profiles (max 500 characters).                                                          |
  | `age`                                      | object | Company age filter with `min` and/or `max` in years.                                                                                   |
  | `shareholder_age`                          | object | Average age of shareholders with `min` and/or `max` in years.                                                                          |
  | `beneficial_owner_age`                     | object | Average age of beneficial owners with `min` and/or `max` in years.                                                                     |
  | `executive_officer_age`                    | object | Average age of executive officers (CEOs, managing directors) with `min` and/or `max` in years.                                         |
  | `representation_and_authority_officer_age` | object | Average age of officers with representation and signing authority, with `min` and/or `max` in years.                                   |
  | `target_market`                            | string | One of: `B2B`, `B2C`, `B2G`, `B2B2C`, `B2B2G`, `C2C`, `C2B`, `G2C`, `G2B`.                                                             |
  | `match_cutoff`                             | float  | Minimum semantic similarity score (0.0–1.0) when using `semantic_search`.                                                              |
  | `country_code`                             | string | ISO 3166-1 alpha-2 country code (e.g. `"IT"`).                                                                                         |

  **Example:** `'{"nace": "C", "nuts": "ITH5"}'`
</ParamField>

<ParamField query="size" type="string[]">
  One or more company size classifications: `"XS"`, `"S"`, `"M"`, `"L"` (e.g. `["S", "M"]`).
</ParamField>

<ParamField query="metric_filters" type="string (JSON array)">
  Up to 10 metric value filters to narrow the population. Each object has `slug` (required), `min` (optional), `max` (optional).

  **Example:** `'[{"slug": "revenues_from_sales_and_services", "min": 1000000}]'`
</ParamField>

<ParamField query="employees" type="string (JSON object)">
  Employee count filter with `min` and/or `max`.

  **Example:** `'{"min": 50}'`
</ParamField>

<ParamField query="radar" type="string (JSON object)">
  Aggregate over companies whose position on the Syrto Radar plane (0–100 on both axes) matches the filter. Combines via AND with all other filters. At least one of `size`, `efficiency`, or `polygon` is required.

  | Field        | Type   | Description                                                                                                                                                                                                                                      |
  | ------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | `size`       | object | Inclusive range on the Radar size axis with `min` and/or `max` (0–100). Distinct from the top-level `size` parameter (XS/S/M/L band).                                                                                                            |
  | `efficiency` | object | Inclusive range on the Radar efficiency axis with `min` and/or `max` (0–100).                                                                                                                                                                    |
  | `polygon`    | object | Arbitrary polygon over the (size, efficiency) plane. Has a `vertices` list of 3–64 points, each `{ "size": 0–100, "efficiency": 0–100 }`. Use axis ranges for rectangles or strips; use the polygon for triangles, L-shapes, or concave regions. |

  **Example:** `'{"efficiency": {"min": 70}}'`
</ParamField>

<ParamField query="consolidated" type="boolean">
  Filter by consolidated financial statements. Default: `false` (non-consolidated).
</ParamField>

<ParamField query="language" type="string">
  `"en"` for English (default) or `"it"` for Italian.
</ParamField>

## Returns

<ResponseField name="years" type="object[]">
  One entry per requested year, each containing:
</ResponseField>

<ResponseField name="years[].company_count" type="integer">
  Total number of companies matching the filters.
</ResponseField>

<ResponseField name="years[].employee_stats" type="object">
  Employee count statistics across matching companies:

  * `count` — number of companies with employee data
  * `average`, `median`, `minimum`, `maximum` — statistical summaries
</ResponseField>

<ResponseField name="years[].metric_stats" type="object[]">
  One entry per requested metric slug, each with:

  * `name` — human-readable metric name (use this for display, not `slug`)
  * `slug` — internal identifier
  * `stats.count` — number of companies with data for this metric
  * `stats.average`, `stats.median`, `stats.minimum`, `stats.maximum` — statistical summaries
</ResponseField>

<ResponseField name="years[].radar" type="object">
  Radar score statistics across matching companies:

  * `efficiency_avg`, `efficiency_median` — Efficiency score summaries (0–100)
  * `size_avg`, `size_median` — Size score summaries (0–100)
</ResponseField>

<ResponseField name="note" type="string">
  Context note about data availability and where to find more on syrto.ai.
</ResponseField>

## Example

**Average revenue for large manufacturers in Emilia-Romagna:**

```json theme={null}
{
  "year": 2023,
  "anagraphic_filters": "{\"nace\": \"C\", \"nuts\": \"ITH5\"}",
  "size": "L",
  "aggregate_metric_slugs": "[\"revenues_from_sales_and_services\"]"
}
```

**Response (abbreviated):**

```json theme={null}
{
  "result": {
    "years": [
      {
        "year": 2023,
        "company_count": 3690,
        "employee_stats": {
          "count": 3045,
          "average": 333.15,
          "median": 201.0
        },
        "metric_stats": [
          {
            "name": "Revenues From Sales And Services",
            "slug": "revenues_from_sales_and_services",
            "stats": {
              "count": 3690,
              "average": 214504329.44,
              "median": 88501574.0
            }
          }
        ],
        "radar": {
          "efficiency_avg": 61.54,
          "efficiency_median": 68.25,
          "size_avg": 80.45,
          "size_median": 80.42
        }
      }
    ]
  },
  "note": "This is a preview of Syrto data. ..."
}
```
