{"uid":"cap_BjcGOcZf8A_gIe0Jj08go","slug":"relaystation-groupby-aggregation-9f1e1b58","name":"Relaystation GroupBy Aggregation","description":"$0.0002/MB. Group rows and aggregate — count, sum, avg, min, max — in one call. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny","url":"https://api.relaystation.ai/v1/data/groupby","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","properties":{"by":{"type":"array","items":{"type":"string"},"minItems":1},"to":{"enum":["csv","tsv","json","ndjson"],"type":"string","description":"A tabular file format: csv, tsv, json (array of objects), or ndjson."},"file":{"type":"object","description":"cputools input-source: { inline: <base64 ≤ 4 MiB> } or { inputKey: <scratch key from /v1/cputools/upload-url, ≤ 50 MB> }."},"from":{"enum":["csv","tsv","json","ndjson"],"type":"string","description":"A tabular file format: csv, tsv, json (array of objects), or ndjson."},"aggregate":{"type":"array","items":{"type":"object","required":["fn"],"properties":{"as":{"type":"string","description":"Output column name."},"fn":{"enum":["count","sum","avg","min","max","first","last"],"type":"string"},"column":{"type":"string","description":"Required for every fn except count."}}},"minItems":1}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Nfx9b-Ov8OlS2lViaRPNL","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Groups rows of tabular data and computes aggregations (count, sum, avg, min, max) in a single API call, billed per MB of input data.","exampleAgentPrompt":"Group this sales dataset by region and product category, then give me the count, sum, and average of the revenue column for each group.","exampleUseCases":[{"title":"E-commerce revenue rollup by category","prompt":"Take these order records and group them by product category, then compute the total revenue, average order value, and number of orders per category."},{"title":"Log file error rate by status code","prompt":"I have a list of server log entries with status codes and response times — can you group them by status code and give me the count and average response time for each?"},{"title":"Monthly sales performance summary","prompt":"Group these transaction records by month and sales rep, and calculate the total sales amount, minimum deal size, and maximum deal size for each combination."}],"resultDescription":"Returns grouped result rows where each row represents a unique combination of the grouping columns, along with the requested aggregate values (count, sum, avg, min, max) for the specified numeric columns. Billed at $0.0002/MB of input data with a 1¢ minimum via x402 micropayment; any overpaid amount is auto-credited.","failureModes":["Invalid or malformed input data returns a parsing error","Referencing a column name that doesn't exist in the dataset causes a column-not-found error","Unsupported aggregation function names return a validation error","Extremely large payloads may timeout or exceed size limits","Malformed JSON body returns a 400 bad request","Missing required fields (data rows or grouping keys) returns a schema validation error"],"whenToPreferThis":"Choose this endpoint when you need server-side grouping and multi-aggregate computation in a single call without setting up a database or running local data processing code. It is ideal for agents that receive tabular data and need summarized statistics quickly, especially when the data is already in JSON/array form and you want count, sum, avg, min, and max computed together. Prefer it over general-purpose code execution when you want predictable per-MB pricing and don't want to manage compute infrastructure.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:52:02.294Z","isFirstParty":false}