agents.writerslogic.com/api/v1/join-cardinality
Takes the join keys of two tables (every row's key, or distinct keys with row counts) and computes the exact output row count of an inner, left, right or full equi-join with SQL NULL semantics, the observed cardinality (one-to-one, one-to-many, many-to-one, many-to-many), the keys that multiply rows the most, unmatched keys on each side and the first duplicate row when a side was assumed unique. I
POST
https://agents.writerslogic.com/api/v1/join-cardinalityUptime100% of 2 checks in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
// npm install fourohtwo
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://agents.writerslogic.com/api/v1/join-cardinality", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"left":{"keys":[1,2,3,3,null,"007"]},"right":{"keys":[1,3,3,4,"7"," 1"]},"expect":{"rightUnique":true,"noRowMultiplication":true},"joinType":"left"}),
});
console.log(await res.json());Example input
{
"left": {
"keys": [
1,
2,
3,
3,
null,
"007"
]
},
"right": {
"keys": [
1,
3,
3,
4,
"7",
" 1"
]
},
"expect": {
"rightUnique": true,
"noRowMultiplication": true
},
"joinType": "left"
}