Aggregating Data

Created by Roanne Jane Jane Jaype, Modified on Mon, 1 Aug, 2022 at 3:35 PM by Roanne Jane Jane Jaype

You can make aggregations to columns using the /agg/<operation> suffix.

This can be a useful way to extract data directly from our API, without having to calculate it yourself.


OperationDescription
sumSum the value for each column
prodMultiply the value for each column
maxExtract the maximum value for each column
minExtract the minimum value for each column
meanExtract the mean/average value for each column
medianExtract the median value for each column
stdExtract the standard deviation value for each column
varExtract the variance value for each column
anyTrue if any row contain a a value, False otherwise
allTrue if all rows contain a a value, False otherwise

Maximum column value extraction

https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf/agg/max

Max Aggregation Example

Sum all columns

https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf/agg/sum

Values that cannot be summed are not displayed

Sum Aggregation Example

Average/Mean for all columns

https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf/agg/mean

Values that cannot be averaged are not displayed

Average/Mean Aggregation Example



_______________________


Shell

# Get the maximum value for each column in the sheet
curl 'https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf/agg/max'

# Get the minimum value for each column in the sheet
curl 'https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf/agg/min'
HTML

Python

import requests

# Get the maximum value for each column in the sheet
requests.get('https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf/agg/max')

# Get the minimum value for each column in the sheet
requests.get('https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf/agg/min')
HTML

Javascript

// Get the maximum value for each column in the sheet
fetch(
  "https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf/agg/max"
);

// Get the minimum value for each column in the sheet
fetch(
  "https://sheet.best/api/sheets/cf969697-682a-40e3-bad4-d54803eeeacf/agg/min"
);

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article