---
title: "Get aggregated emissions data"
method: POST
path: "/export/emission/aggregated"
tags: ["Analytics & Reporting"]
---

# Get aggregated emissions data

`POST /export/emission/aggregated`

## Request

- Base URL: `https://api.unravelcarbon.com/api/v1`
- URL: `https://api.unravelcarbon.com/api/v1/export/emission/aggregated`
- Auth: HTTP bearer

Retrieve aggregated and summarized emissions data with advanced filtering, grouping, and analytics capabilities.

This endpoint provides powerful data aggregation features:

- **Flexible column selection**: Choose from available fields including derived fields like month, year, quarter
- **Advanced filtering**: Filter by emission scope (1, 2, 3), data type, facilities, files, dates, and more
- **Multiple export formats**: Get results in JSON or CSV format
- **Async processing**: Large CSV exports are processed asynchronously with status tracking
- **Sorting and pagination**: Sort results and paginate through large datasets

Perfect for creating dashboards, reports, and analytics applications.

## Headers

- `Authorization` string, required

## Request body

- DataAggregationRequest
  - `columns` string[], required: Columns to include in response
  - `format` 'json' | 'csv': Export format
  - `per_page` integer: Number of records per page
  - `page` integer: Page number for pagination
  - `sort_by` 'total_emission' | 'scope_category' | 'data_type' | 'date' | 'file_name' | 'uploader' | 'month' | 'year' | 'quarter' | 'business_facility_name' | 'city' | 'country' | 'company': Field to sort by
  - `sort_order` 'asc' | 'desc': Sort order
  - `scope` integer[]: Filter by emission scope (1, 2, 3)
  - `data_type` string[]: Filter by data type
  - `scope_category` string[]: Filter by scope category
  - `business_facility_name` string[]: Filter by business facility name
  - `subfacility_code` string[]: Filter by subfacility code
  - `file_name` string[]: Filter by file name
  - `uploader` string[]: Filter by uploaded from email
  - `date_from` string, date: Filter by start date
  - `date_to` string, date: Filter by end date

## Response `200`

Aggregated emissions data

- DataAggregationResponse
  - `data` DataAggregationRecord[]: Array of aggregated emission records
    - `date` string, date: Date of the emission record
    - `year` integer: Year derived from date
    - `month` string: Month derived from date (YYYY-MM format)
    - `quarter` integer: Quarter derived from date (1-4)
    - `file_name` string: Original file name
    - `business_facility_name` string: Business facility name
    - `company` string: Company name
    - `uploader` string: Email of user who uploaded the file
    - `total_emission` number: Total emission value
    - `data_type` string: Data type of the emission record
    - `scope_category` string: Scope category
    - `city` string, nullable: City name
    - `country` string: Country name
    - `subfacility_code` string, nullable: Subfacility code
  - `count` integer: Total number of records
  - `page` integer: Current page number
  - `per_page` integer: Number of records per page
  - `format` string: Response format

## Other responses

- `400`: Invalid request or parameters
- `401`: Authentication failed

---

[API](https://skmtc.dev/unravelcarbon/apis/unravel-carbon-public-api.md) - [All operations](https://skmtc.dev/unravelcarbon/apis/unravel-carbon-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/unravelcarbon/apis/unravel-carbon-public-api/revisions/310d3bb09dbe?raw)
