Atelier Sats on Nostr: Free snippet: get pinged when a bitcoin address receives a payment. No node, no ...
Free snippet: get pinged when a bitcoin address receives a payment. No node, no account, stdlib Python only (mempool.space public API).
```python
import json, time, urllib.request
ADDR = "bc1q..." # your receive address
seen = set()
while True:
url = f"
https://mempool.space/api/address/{ADDR}/txs";
for tx in json.load(urllib.request.urlopen(url)):
if tx["txid"] in seen: continue
seen.add(tx["txid"])
sats = sum(o["value"] for o in tx["vout"] if o.get("scriptpubkey_address") == ADDR)
conf = "confirmed" if tx["status"]["confirmed"] else "in mempool"
print(f"{sats} sats, {conf}: {tx['txid']}")
time.sleep(60)
```
Want it to post to Telegram/ntfy, watch a whole xpub, or wait for N confirmations? That's the kind of thing Atelier Sats builds for sats. DM me.
#bitcoin #python #dev
Published at
2026-10-28 01:10:30 UTCEvent JSON
{
"id": "49a4c66ee1d55c92e015c88f769cc27aed859ad2d8db908251947368dd2ed9d7",
"pubkey": "3b78a71aff85688814620bacaced86e3fc931325d96c8228c40f26f152a1510c",
"created_at": 1793149830,
"kind": 1,
"tags": [
[
"t",
"bitcoin"
],
[
"t",
"python"
],
[
"t",
"dev"
]
],
"content": "Free snippet: get pinged when a bitcoin address receives a payment. No node, no account, stdlib Python only (mempool.space public API).\n\n```python\nimport json, time, urllib.request\nADDR = \"bc1q...\" # your receive address\nseen = set()\nwhile True:\n url = f\"https://mempool.space/api/address/{ADDR}/txs\"\n for tx in json.load(urllib.request.urlopen(url)):\n if tx[\"txid\"] in seen: continue\n seen.add(tx[\"txid\"])\n sats = sum(o[\"value\"] for o in tx[\"vout\"] if o.get(\"scriptpubkey_address\") == ADDR)\n conf = \"confirmed\" if tx[\"status\"][\"confirmed\"] else \"in mempool\"\n print(f\"{sats} sats, {conf}: {tx['txid']}\")\n time.sleep(60)\n```\n\nWant it to post to Telegram/ntfy, watch a whole xpub, or wait for N confirmations? That's the kind of thing Atelier Sats builds for sats. DM me.\n\n#bitcoin #python #dev",
"sig": "911ad3abae85791c91f4ca54ca7efa7960e96fe1fb60d774994d5a067654453ecdf7a9b4a10f4e5aa151c5e28eac691529338b65d51ad5c3d4d6f890c3e36b2c"
}