Data Transform
Dedupe array by key API
Removes duplicate objects from an array keeping the first per key-path value, and reports how many were removed. Answers 'How do I dedupe records by a field?', 'How do I keep one row per id?'.
Price$0.01per request
MethodPOST
Route/v1/data-transform/unique-by
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
data-transformuniquededupedistinctarrayjsonwrangle
API URL
Integration docshttps://x402.hexl.dev/v1/data-transform/unique-byExample request
{
"data": [
{
"id": 1
},
{
"id": 1
},
{
"id": 2
}
],
"key": "id"
}Example response
{
"result": [
{
"id": 1
},
{
"id": 2
}
],
"removed": 1
}Input schema
{
"type": "object",
"required": [
"data",
"key"
],
"properties": {
"data": {
"type": "array",
"examples": [
[
{
"id": 1
},
{
"id": 1
},
{
"id": 2
}
]
]
},
"key": {
"type": "string",
"examples": [
"id"
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}