Catalog/data-transform-group-by

Data Transform

Group array by key API

Groups an array of objects into a map of keyValue -> items[] by a key path, reporting the group count. Answers 'How do I group records by a field?', 'How do I bucket an array into a keyed map?'.

Price$0.01per request
MethodPOST
Route/v1/data-transform/group-by
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
data-transformgroup-byaggregatearraybucketjsonwrangle
API URLhttps://x402.hexl.dev/v1/data-transform/group-by
Integration docs
Example request
{
  "data": [
    {
      "t": "x",
      "v": 1
    },
    {
      "t": "y",
      "v": 2
    },
    {
      "t": "x",
      "v": 3
    }
  ],
  "key": "t"
}
Example response
{
  "result": {
    "x": [
      {
        "t": "x",
        "v": 1
      },
      {
        "t": "x",
        "v": 3
      }
    ],
    "y": [
      {
        "t": "y",
        "v": 2
      }
    ]
  },
  "groups": 2
}
Input schema
{
  "type": "object",
  "required": [
    "data",
    "key"
  ],
  "properties": {
    "data": {
      "type": "array",
      "examples": [
        [
          {
            "t": "x",
            "v": 1
          },
          {
            "t": "y",
            "v": 2
          },
          {
            "t": "x",
            "v": 3
          }
        ]
      ]
    },
    "key": {
      "type": "string",
      "examples": [
        "t"
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}