46trust / 100

Data Aggregate

by Nero Labs Agent Tools in Documents & files

x402 APIFailing, checked 19 h ago

Groups up to 500 JSON rows and works out totals per group: count, sum, average, min, max, median, distinct count, first and last, with date buckets (day, week, month, quarter, year), a pivot table, sorting, top N and a totals row. Returns one row per group plus a summary. $0.001 per row sent, $0.002 minimum. Same engine as nerolabs/dataset-aggregate-pivot.

POST
https://x402-agent-tools.nerolabs.workers.dev/data/aggregate
Price
$0.003
per call in USDC
Uptime
97.8%
last 30 days
Response time
571 ms
1.1 s slowest 5%
Last check
Failed
19 h ago, next any minute now

Run a free test callHow to call it

Reliability

All checks passedSome failedAll failedNot checked

Latest check failed 19 h ago: Timed out

Status and outage history · Atom feed · Watch with other listings

How to call it

POST https://x402-agent-tools.nerolabs.workers.dev/data/aggregate

Each call costs $0.003 in USDC on Base, paid with the request over x402.

Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.

Example request

From the listing.

POST https://x402-agent-tools.nerolabs.workers.dev/data/aggregate
content-type: application/json

{
  "aggregations": [
    {
      "field": "sales",
      "function": "sum"
    },
    {
      "function": "count"
    }
  ],
  "groupByFields": [
    "region"
  ],
  "rows": [
    {
      "region": "North",
      "sales": 120
    },
    {
      "region": "South",
      "sales": 80
    },
    {
      "region": "North",
      "sales": 60
    }
  ]
}

Parameters

ParameterTypeRequiredDescription
aggregationsarray of objectNoWhat to compute per group, for example [{"function":"count","alias":"orders"}, {"field":"amount","function":"sum","alias":"total_amount"}]. Every function except count needs a field. alias is the output column name (defaults to function_field, or "count"). Omitted gives a plain row count per group.…
dateBucketFieldstringNoA date or timestamp field to group by time period, for example "orderedAt". Adds a group column named like "orderedAt_month". Unreadable dates land in an "(invalid date)" group.
dateBucketGranularitystringNoBucket size for dateBucketField: day (2026-08-19), week (2026-W34), month (2026-08, default), quarter (2026-Q3) or year. One of: day, week, month, quarter, year.
groupByFieldsarray of stringNoOne output row per distinct combination of these field values, like SQL GROUP BY, for example ["region"] or ["city", "category"]. Dot paths like "address.city" work. Empty or omitted aggregates every row into a single row.
groupMatchingstringNonormalized (default) ignores letter case and extra whitespace when grouping, so "South" and "south " are one group. exact requires identical values. One of: normalized, exact.
includeTotalsRowbooleanNoAppends a grand-total row labelled "(total)" and adds a _rowType column ("group" or "total").
lenientNumbersbooleanNoOn by default: "$1,234.50", "49 USD", "12%" and "(300)" count as numbers for sum, avg, min, max and median. Set false to accept only real numbers and plain numeric strings.
pivotFieldstringNoTurns this field's distinct values into columns, pivot-table style: group by "region" and pivot on "product" for one row per region with a column per product. Must not also be a group-by field. At most 50 distinct values.
pivotFunctionstringNoHow pivot cell values are combined. Defaults to sum when pivotValueField is set; ignored (row count) without one. One of: count, countDistinct, sum, avg, min, max, median, first, last, list, listDistinct.
pivotValueFieldstringNoThe field whose values fill the pivot cells, for example "amount". Omitted fills each cell with a row count.
rowsarray of objectYesThe records to aggregate, up to 500. Each row is a JSON object; keys may differ between rows.
sortBystringNoAn output column to sort by: a group field, an aggregation alias such as "total_amount", or a pivot column. Omitted sorts by the group fields.
sortDirectionstringNoasc (default) or desc. Use desc with topN for "top N by" questions. One of: asc, desc.
topNintegerNoAfter sorting, keep only the first N groups. The totals row still covers every input row.

Example response

The provider's example. We can't check it without paying.

Example response, 44 lines
{
  "_example_note": "Real output, trimmed: long lists cut to their first items and long text shortened.",
  "rows": [
    {
      "count": 2,
      "region": "North",
      "sum_sales": 180
    },
    {
      "count": 1,
      "region": "South",
      "sum_sales": 80
    }
  ],
  "summary": {
    "aggregations": [
      {
        "alias": "sum_sales",
        "field": "sales",
        "function": "sum"
      },
      {
        "alias": "count",
        "function": "count"
      }
    ],
    "columns": [
      "region",
      "sum_sales",
      "count"
    ],
    "droppedByTopN": 0,
    "groupByFields": [
      "region"
    ],
    "groupCount": 2,
    "inputRowCount": 3,
    "outputRowCount": 2,
    "pivot": null,
    "skippedValues": {},
    "totalsRowIncluded": false,
    "warnings": []
  }
}

Call it from code

The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.003.

curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://x402-agent-tools.nerolabs.workers.dev/data/aggregate' \
  -H 'content-type: application/json' \
  --data-raw '{"aggregations":[{"field":"sales","function":"sum"},{"function":"count"}],"groupByFields":["region"],"rows":[{"region":"North","sales":120},{"region":"South","sales":80},{"region":"North","sales":60}]}'

# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://x402-agent-tools.nerolabs.workers.dev/data/aggregate' \
  -H 'content-type: application/json' \
  --data-raw '{"aggregations":[{"field":"sales","function":"sum"},{"function":"count"}],"groupByFields":["region"],"rows":[{"region":"North","sales":120},{"region":"South","sales":80},{"region":"North","sales":60}]}' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decode
JavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

// Pays at most $0.003 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.003" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.003 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fx402-agent-tools.nerolabs.workers.dev%2Fdata%2Faggregate&method=POST
const res = await pay("https://x402-agent-tools.nerolabs.workers.dev/data/aggregate", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "aggregations": [
      {
        "field": "sales",
        "function": "sum"
      },
      {
        "function": "count"
      }
    ],
    "groupByFields": [
      "region"
    ],
    "rows": [
      {
        "region": "North",
        "sales": 120
      },
      {
        "region": "South",
        "sales": 80
      },
      {
        "region": "North",
        "sales": 60
      }
    ]
  }),
});
console.log(res.status, await res.text());
Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

# Pays at most $0.003 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.003"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))

with x402_requests(client) as session:
    res = session.post(
        "https://x402-agent-tools.nerolabs.workers.dev/data/aggregate",
        json={
            "aggregations": [
                {
                    "field": "sales",
                    "function": "sum",
                },
                {
                    "function": "count",
                },
            ],
            "groupByFields": [
                "region",
            ],
            "rows": [
                {
                    "region": "North",
                    "sales": 120,
                },
                {
                    "region": "South",
                    "sales": 80,
                },
                {
                    "region": "North",
                    "sales": 60,
                },
            ],
        },
    )
    print(res.status_code, res.text)

Security scan

No findings

We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
19 h agoTimed out---
3 days agoTimed out---
4 days agoPassed402132 ms$0.003
5 days agoPassed402117 ms$0.003
5 days agoPassed402746 ms$0.003
Show 10 older checks
6 days agoPassed402199 ms$0.003
7 days agoPassed4021.1 s$0.003
7 days agoPassed402607 ms$0.003
8 days agoPassed402757 ms$0.003
8 days agoPassed402132 ms$0.003
9 days agoPassed402155 ms$0.003
9 days agoPassed402597 ms$0.003
9 days agoPassed402691 ms$0.003
10 days agoPassed402558 ms$0.003
10 days agoPassed402147 ms$0.003

History

22 Oct 2026Payment address changed from 0xbe3942b2519520Ae4F3963273F7D7f0440D67292 to 0xA969a3127DcC74B2989a4b4e45Ae61B81093164A