Catalog/data-transform-key-by

Data Transform

Index array by key API

Indexes an array of objects into a map of keyValue -> item (last write wins), turning a list into a lookup table. Answers 'How do I index records by id?', 'How do I build a lookup map from an array?'.

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