Skip to content
Utilerio
All endpoints

Pivot Table Generator

POST/api/v1/tools/pivot-table-generator

Summarize an Excel or CSV file into a pivot table — pick row, column and value fields and an aggregation.

Authentication

Requires an API key in the X-API-Key header.

Try it

POST/api/v1/tools/pivot-table-generator

Parameters

rowsstringrequired

Rows as an array of objects.

rowFieldstringrequired

Column used to group rows.

colFieldstringrequired

Column used to group columns.

valueFieldstringrequired

Column whose values are aggregated.

aggregationstringoptional

Aggregation function. Default sum.

sumcountavgminmax

Request body

{
  "rows": [
    {
      "region": "West",
      "product": "A",
      "amount": 100
    },
    {
      "region": "West",
      "product": "B",
      "amount": 50
    },
    {
      "region": "East",
      "product": "A",
      "amount": 75
    }
  ],
  "rowField": "region",
  "colField": "product",
  "valueField": "amount",
  "aggregation": "sum"
}

Response codes

  • 200Success.
  • 400Invalid request — check your body or parameters.
  • 401Missing or invalid API key.
  • 403The API key is not scoped to this endpoint.
  • 429Rate limit exceeded — retry after a short wait.

Language

cURL

Request

curl -X POST https://utilerio.com/api/v1/tools/pivot-table-generator \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rows":[{"region":"West","product":"A","amount":100},{"region":"West","product":"B","amount":50},{"region":"East","product":"A","amount":75}],"rowField":"region","colField":"product","valueField":"amount","aggregation":"sum"}'

Response

{ "rowKeys": ["East", "West"], "colKeys": ["A", "B"], "cells": { "East": { "A": 75, "B": 0 }, "West": { "A": 100, "B": 50 } }, "rowTotals": { "East": 75, "West": 150 }, "colTotals": { "A": 175, "B": 50 }, "grandTotal": 225 }