Skip to main content
POST
/
v1
/
lca
/
export-xlsx
/
{lca_id}
Export LCA to Excel
const options = {
  method: 'POST',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': '<content-type>'
  },
  body: JSON.stringify({
    category_impacts: [{}],
    recursive: true,
    max_depth: 123,
    view: '<string>',
    output_product_id: '<string>'
  })
};

fetch('https://api.dcycle.io/v1/lca/export-xlsx/{lca_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "download_url": "<string>"
}

Export LCA to Excel

Exports the environmental impact results of an LCA portfolio to an Excel file. The file is uploaded to S3 and a presigned download URL is returned.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa
Content-Type
string
required
Must be application/json

Path Parameters

lca_id
string
required
UUID of the LCA portfolio to exportExample: 550e8400-e29b-41d4-a716-446655440000

Body Parameters

category_impacts
array
required
List of impact categories to include in the export (max 50)
recursive
boolean
default:"false"
Include child processes recursively in the export
max_depth
integer
default:"10"
Maximum depth of the process tree to include (1-10)
view
string
default:"system"
Visualization mode for the export
ValueDescription
systemAbsolute impact of the whole system (no allocation)
product_totalImpact allocated to one co-product (requires output_product_id)
product_unitPer-unit impact of one co-product (requires output_product_id)
output_product_id
string
UUID of the co-product for product_total or product_unit views. Required when view is not system.

Response

download_url
string
Presigned S3 URL to download the Excel file. The URL expires after a limited time.

Example

curl -X POST "https://api.dcycle.io/v1/lca/export-xlsx/${LCA_ID}" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{
    "category_impacts": [
      {"key": "gwp", "name": "Global Warming Potential"},
      {"key": "ap", "name": "Acidification"}
    ],
    "recursive": true,
    "max_depth": 5,
    "view": "system"
  }'

Successful Response

{
  "download_url": "https://dcycle-exports.s3.eu-west-1.amazonaws.com/org-id/Results%20LCA%20My%20Product.xlsx?X-Amz-Algorithm=..."
}

Co-product View Example

To export impacts allocated to a specific co-product:
{
  "category_impacts": [
    {"key": "gwp", "name": "Global Warming Potential"}
  ],
  "recursive": true,
  "view": "product_total",
  "output_product_id": "c3d4e5f6-a7b8-9012-cdef-345678901234"
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}

403 Forbidden

Cause: The authenticated user is not a member of the organization
{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}

404 Not Found

Cause: LCA portfolio not found or doesn’t belong to your organization
{"detail": "LCA Portfolio not found"}

422 Unprocessable Entity

Cause: Invalid view value or missing output_product_id for co-product views
{
  "detail": [
    {
      "loc": ["body", "view"],
      "msg": "view must be one of ['product_total', 'product_unit', 'system']",
      "type": "value_error"
    }
  ]
}

Get LCA Impacts

Calculate impacts before exporting

LCA Dashboard

View aggregated impact results in the UI

Get LCA Portfolio

View portfolio details