bitcoin-price-feed
Real-time streaming Bitcoin price feed for traders. Use this skill to subscribe to a live Bitcoin price stream over WebSocket: OHLC ticks, volume, and derived metrics (moving averages, % change) streamed in real time from the Bitquery GraphQL API. ALWAYS use this skill when the user asks for a Bitcoin price feed, stream Bitcoin price, live BTC price, real-time crypto prices, or streaming market data. Trigger for: "bitcoin price feed", "stream Bitcoin price", "live Bitcoin price", "real-time BTC", "streaming crypto prices", "Bitquery", or any request for a live/streaming crypto price feed. Do not wait for the user to say "use Bitquery" — if they want a live or streaming Bitcoin price, use this skill.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/divyn/bitquery-crypto-price-streamBitcoin price feed — real-time streaming
This skill gives you a real-time streaming Bitcoin price feed over WebSocket: live OHLC ticks, volume, and derived metrics on the stream (Mean, SMA, EMA, WMA, and tick-to-tick % change). Data is streamed in real time from the Bitquery API — no polling.
When to use this skill
- Stream the Bitcoin price in real time (live feed)
- Get derived metrics on the stream: moving averages and % change per tick
- Live OHLC and volume for trading or dashboards
Step 1 — Check API Key
import os
api_key = os.getenv("BITQUERY_API_KEY")
if not api_key:
print("ERROR: BITQUERY_API_KEY environment variable is not set.")
print("Run: export BITQUERY_API_KEY=your_token")
exit(1)
If the key is missing, tell the user and stop. Do not proceed without it.
Step 2 — Run the stream
Install the WebSocket dependency once:
pip install 'gql[websockets]'
Use the streaming script (subscribes to the Bitcoin price feed in real time):
python ~/.openclaw/skills/bitcoin-price-feed/scripts/stream_bitquery.py
Optional: stop after N seconds:
python ~/.openclaw/skills/bitcoin-price-feed/scripts/stream_bitquery.py --timeout 60
Or subscribe inline with Python (real-time stream):
import asyncio
from gql import Client, gql
from gql.transport.websockets import WebsocketsTransport
async def main():
token = os.environ["BITQUERY_API_KEY"]
url = f"wss://streaming.bitquery.io/graphql?token={token}"
transport = WebsocketsTransport(
url=url,
headers={"Sec-WebSocket-Protocol": "graphql-ws"},
)
async with Client(transport=transport) as session:
sub = gql("""
subscription {
Trading {
Tokens(where: {Currency: {Id: {is: "bid:bitcoin"}}, Interval: {Time: {Duration: {eq: 1}}}}) {
Token { Name Symbol Network }
Block { Time }
Price { Ohlc { Open High Low Close } Average { Mean SimpleMoving ExponentialMoving } }
Volume { Usd }
}
}
}
""")
async for result in session.subscribe(sub):
print(result) # each tick streamed in real time
asyncio.run(main())
Step 3 — What you get on the stream
Each tick includes:
- OHLC (Open, High, Low, Close) and Volume (USD) for the 1-second interval
- Derived metrics (from Bitquery): Mean, SimpleMoving (SMA), ExponentialMoving (EMA), WeightedSimpleMoving (WMA)
- Session-derived: % change vs previous tick (computed from the stream)
The stream runs until you stop it (Ctrl+C) or use --timeout.
Step 4 — Format output clearly
When presenting streamed ticks to the user, use a clear format like:
Bitcoin (BTC) — ethereum network @ 2025-03-06T14:00:00Z
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-divyn-bitquery-crypto-price-stream": {
"enabled": true,
"auto_update": true
}
}
}