Socket API
Socket provides real-time cryptocurrency data through Server-Sent Events (SSE). It streams live transactions and blocks from multiple cryptocurrency networks.
Endpoint
GET https://sock-v1.freedom.st/sse?q={base64-encoded-query}
Query Language
The socket uses a MongoDB-like query syntax to filter events in real-time. Your JSON query is base64-encoded and passed as the q parameter. Only events matching your filter criteria will be streamed.
Query Operators
Supported query operators for filtering:
- $eq - Equal to
- $in - Matches any value in array
- $gt, $lt - Greater/less than
- $gte, $lte - Greater/less than or equal
- $ne - Not equal
Event Types
- tx - New transactions
- block - New blocks
Cryptocurrencies
- btc - Bitcoin
- bch - Bitcoin Cash
- ltc - Litecoin
- doge - Dogecoin
- dash - Dash
Query Examples
All events for all coins
{}
Bitcoin transactions only
{
"crypto": "btc",
"type": "tx"
}
All blocks
{
"type": "block"
}
Multiple specific coins
{
"crypto": { "$in": ["btc", "ltc"] }
}
Transactions to a specific address
{
"data.out.script.address": "bc1qevqpcf5hy03qvkcra5lu43cg6waakrm56d5rw4"
}
Transactions equal to or over 1KB in size
{
"type": "tx",
"data.tx.size": { "$gte": 1000 }
}
Bitcoin transactions with an output over 1 BTC
{
"crypto": "btc",
"type": "tx",
"data.out.value": { "$gt": 1 }
}
Event Data Structure
Transaction Example
{
"time": 1756262683448,
"type": "tx",
"crypto": "btc",
"data": {
"tx": {
"hash": "2415dcf1aa44ecaad67caef3bb83cf008f2aaace345b67e8046d480c45f4e5ad",
"block": null,
"size": 222,
"version": 2,
"lock": 911881,
"fee": 0.00000423
},
"in": [
{
"txid": "73558a6cf0d2b0d06d1871b91b4d14e89802d620c888f25472638c7c9bb613a2",
"vout": 0,
"value": 0.00110914,
"address": "bc1qe6j7m4cgf8n2e3yn7mutgnfue4dwrrms9n53vx",
"sequence": 4294967293
}
],
"out": [
{
"value": 0.00017957,
"n": 0,
"script": {
"asm": "0 d587a7a1748590e35639121037f120d246e80939",
"desc": "addr(bc1q6kr60gt5skgwx43ezggr0ufq6frwszfezgwee9)#9j3f3789",
"hex": "0014d587a7a1748590e35639121037f120d246e80939",
"type": "witness_v0_keyhash",
"address": "bc1q6kr60gt5skgwx43ezggr0ufq6frwszfezgwee9"
}
},
{
"value": 0.00092534,
"n": 1,
"script": {
"asm": "0 d8d02cf05d843175ff53d56d0245cc88c053538a",
"desc": "addr(bc1qmrgzeuzasschtl6n64ksy3wv3rq9x5u2xhm0pu)#d4p0l76g",
"hex": "0014d8d02cf05d843175ff53d56d0245cc88c053538a",
"type": "witness_v0_keyhash",
"address": "bc1qmrgzeuzasschtl6n64ksy3wv3rq9x5u2xhm0pu"
}
}
]
}
}
Block Example
{
"time": 1756262883324,
"type": "block",
"crypto": "btc",
"data": {
"hash": "00000000000000000001294db11ddce9925b2e1c463fe85b6562c9914bb1a5e7",
"confirmations": 1,
"height": 911882,
"version": 1073676288,
"versionHex": "3fff0000",
"merkleroot": "943a4a185065a6c8eb4c7ccdd14a658c1dd51bd4101f551e9cf7d4bc53ffcdca",
"time": 1756262854,
"mediantime": 1756261179,
"nonce": 2631980229,
"bits": "17022b91",
"difficulty": "129699156960680.9",
"chainwork": "0000000000000000000000000000000000000000dd77caad72e49e568ae1bb8a",
"nTx": 4315,
"previousblockhash": "0000000000000000000129026c5957c2a768c949ef59b0c6fa590815850d20f6",
"strippedsize": 787459,
"size": 1635887,
"weight": 3998264,
"tx": [
"b7ffcc4f2de262f4a32814ce33e3c9d9fac34aaa3745005ce6f89b8c66b558d8",
"8c7f6dce78543d5bdaca12515996392849a484bd69840165d6e0f77ac211beb2",
"2c509de6b24d50c1f7f9026aea395c1b3b3a692d10e3b0eb99de1d94ba0077e7"
/* ... */
]
}
}