Get a text when Bitcoin hits your price

Yes. Homing Pigeon (homingpigeon.dev) lets a short Python script check the Bitcoin price every few minutes and text your phone when it crosses your line. It texts once a day while the price stays past it, and your coding agent can write it for the coin and price you are watching.

What to tell your agent

Use Homing Pigeon to text me when Bitcoin goes above $60,000.

Your agent asks for your number, you read back the six-digit code, and it does the rest.

How it works in code

After pip install homingpigeondev, save this as btc_alert.py, with your own price. It uses only the standard library to read the price, so there is nothing else to install:

import datetime, json, urllib.request
import homingpigeondev

target = 60000
url = "https://api.coinbase.com/v2/prices/BTC-USD/spot"

req = urllib.request.Request(url, headers={"User-Agent": "btc-alert"})
with urllib.request.urlopen(req, timeout=20) as res:
    price = float(json.load(res)["data"]["amount"])

if price >= target:
    today = datetime.date.today().isoformat()
    homingpigeondev.send(
        f"Bitcoin is at ${price:,.0f}, above your ${target:,} line.",
        idempotency_key=f"btc-above-{target}-{today}",
    )

Then run it every five minutes from cron:

*/5 * * * * cd /home/me/btc-alert && /usr/bin/python3 btc_alert.py

Good to know

  • The text reads like "Bitcoin is at $61,240, above your $60,000 line." The date in the idempotency key means you get one text that day, even though the script checks every five minutes. If the price is still above your line tomorrow, you get one more text as a reminder.
  • The target is in the key too, so when you move your line, the new one can text you the same day.
  • To hear when the price falls below your line instead, change >= to <=, and "above" to "below" in the message and the key.
  • The price comes from Coinbase's public spot price for BTC-USD, which the script reads without an account or a key. For another coin, change BTC-USD in the address, such as ETH-USD, and the name in the message.
  • If the price cannot be read, the script stops with an error instead of texting you a wrong number.
  • A price that jumps past your line and back between two checks can be missed. Treat the text as a heads-up and not as a trade signal, because delivery is not guaranteed.
  • Cron runs with a short PATH, so use the full path to Python. Run which python3 to find yours. Verify your phone as the same user the cron job runs as, with python3 -m homingpigeondev verify +15551234567, then again with the six-digit code it texts you.
  • Messages are limited to 480 characters and go only to the US mobile number you verified. Keep them plain, with no links.

Get started

Add Homing Pigeon to Claude Code, then ask for what you want:

claude mcp add homingpigeondev -- npx -y homingpigeondev mcp

You get 50 free texts every month, on US mobile numbers. See more use cases.