Install
openclaw skills install bitquery-crypto-price-streamReal-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.
openclaw skills install bitquery-crypto-price-streamThis 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
This skill implements a Bitquery WebSocket Bitcoin price stream and uses one external dependency and one credential. Before installing:
BITQUERY_API_KEY even though this skill and its script require it. Ask the publisher or update the registry metadata before installing so installers surface the secret requirement.BITQUERY_API_KEY and the source/publisher are validated, this skill is likely coherent and benign.BITQUERY_API_KEY — your Bitquery API token (required). The token must be passed in the WebSocket URL only as ?token=... (e.g. wss://streaming.bitquery.io/graphql?token=YOUR_KEY); Bitquery does not support header-based auth for this endpoint. Because the token appears in the URL, it can show up in logs, monitoring tools, or browser/IDE history — treat it as a secret and avoid logging or printing the full URL.pip. Install the dependency: pip install 'gql[websockets]'.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.
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())
Each tick includes:
The stream runs until you stop it (Ctrl+C) or use --timeout.
When presenting streamed ticks to the user, use a clear format like:
Bitcoin (BTC) — ethereum network @ 2025-03-06T14:00:00Z
OHLC:
Open: $85,200.00 High: $86,100.00 Low: $84,950.00 Close: $85,780.00
Derived (on stream):
Mean: $85,500.00 SMA: $85,400.00 EMA: $85,520.00
Tick Δ: +0.12% vs previous
Volume (USD): $1,234,567.00
The default subscription uses duration 1 (1-second tick data). The same Trading.Tokens subscription supports other durations in the where clause (e.g. 5, 60, 1440 for 5m, 1h, 1d candles) if the API supports them for subscriptions.
?token= only — do not pass the token in headers)Full field reference is in references/graphql-fields.md. Use it to add filters or request extra fields (e.g. date range) in the subscription.