← Back to Skills Marketplace
divyn

Reliable Bitcoin Price Feed

by Divyasshree · GitHub ↗ · v1.0.4 · MIT-0
cross-platform ✓ Security Clean
394
Downloads
0
Stars
0
Active Installs
5
Versions
Install in OpenClaw
/install bitquery-crypto-price-stream
Description
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 derive...
README (SKILL.md)

Bitcoin 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

What to consider before installing

This skill implements a Bitquery WebSocket Bitcoin price stream and uses one external dependency and one credential. Before installing:

  1. Registry metadata: The registry may not list 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.
  2. API key in URL: The API key must be passed in the WebSocket URL as a query parameter, which can leak to logs or histories. Avoid printing the full URL, store the key in a secure environment variable, and rotate it if it may have been exposed.
  3. Sandbox first: Review and run the included script in a sandboxed environment (e.g. a virtualenv) to confirm behavior and limit blast radius.
  4. Source and publisher: If the skill’s homepage or source is unknown, consider verifying the publisher or using an alternative with a verified source. If the registry metadata declares BITQUERY_API_KEY and the source/publisher are validated, this skill is likely coherent and benign.

Prerequisites

  • Environment: 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.
  • Runtime: Python 3 and pip. Install the dependency: pip install 'gql[websockets]'.

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

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

Interval (subscription)

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.

Error handling

  • Missing BITQUERY_API_KEY: Tell user to export the variable and stop
  • WebSocket connection failed / 401: Token invalid or expired (auth is via URL ?token= only — do not pass the token in headers)
  • Subscription errors in payload: Log the error message and stop cleanly (send complete, close transport)
  • No ticks received: Check token and network; Bitquery may need a moment to send the first tick

Reference

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.

Usage Guidance
This skill appears to do exactly what it says: open a Bitquery WebSocket subscription and stream 1s Bitcoin ticks. Before installing: (1) confirm the publisher/source since the registry metadata currently omits the required BITQUERY_API_KEY; (2) store BITQUERY_API_KEY securely (env secret manager) and do not print the full WebSocket URL (the token is passed as ?token= and can appear in logs); (3) run the included script in a sandbox/virtualenv to validate behavior; (4) rotate the key if you suspect it was exposed while testing; and (5) if you prefer not to grant autonomous invocation broadly, control when the agent is allowed to pick this skill even though the skill itself is not requesting extra privileges.
Capability Analysis
Type: OpenClaw Skill Name: bitquery-crypto-price-stream Version: 1.0.4 The skill is a legitimate tool for streaming real-time Bitcoin price data from the Bitquery GraphQL API. The Python script (scripts/stream_bitquery.py) and instructions (SKILL.md) correctly implement WebSocket subscriptions and include proactive security warnings regarding the exposure of API keys in URLs, which is a known characteristic of the Bitquery streaming endpoint.
Capability Assessment
Purpose & Capability
The skill name/description (real-time Bitcoin price feed) matches the included script (scripts/stream_bitquery.py) and SKILL.md. The script legitimately requires a Bitquery API key to open a WebSocket subscription. Minor inconsistency: registry metadata does not declare the required BITQUERY_API_KEY even though SKILL.md and the script require it; the registry omission should be corrected before installation.
Instruction Scope
SKILL.md and the script narrowly instruct the agent to read BITQUERY_API_KEY, install a single Python dependency, and connect to Bitquery's WebSocket stream to subscribe to Trading.Tokens for bid:bitcoin. The instructions do not ask the agent to read unrelated files, other credentials, or post data to third-party endpoints beyond Bitquery. SKILL.md does include a strong 'ALWAYS use this skill when…' trigger guidance for selection, which is a policy for invocation rather than a technical I/O concern.
Install Mechanism
No install spec that writes arbitrary code to disk; this is instruction-only plus a single small Python script and requirements.txt. Dependency is a standard Python package (gql[websockets]) available on PyPI — reasonable and proportionate to the task. No downloads from untrusted URLs or archive extraction are present.
Credentials
The only secret required is BITQUERY_API_KEY, which is appropriate for a Bitquery stream. However, the skill must pass the key as a query parameter in the WebSocket URL (wss://streaming.bitquery.io/graphql?token=...), which can expose the token in logs, monitoring, or history. SKILL.md acknowledges this and advises treating the token as a secret. The registry failing to declare the env requirement is an administrative gap to fix.
Persistence & Privilege
The skill does not request permanent presence (always:false), does not modify other skills or system configuration, and does not require config paths or extra privileges. Autonomous invocation is allowed (platform default) but does not combine with other high-risk behaviors here.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install bitquery-crypto-price-stream
  3. After installation, invoke the skill by name or use /bitquery-crypto-price-stream
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.4
- Added a "What to consider before installing" section with security, environment, and publisher verification guidance. - Warns that the registry may not list the required `BITQUERY_API_KEY` and advises on surfacing secret requirements. - Recommends sandbox testing and publisher/source verification before use. - No functional changes to usage, streaming behavior, or API example code.
v1.0.3
- Added explicit instructions that the Bitquery API key must be passed in the WebSocket URL as a query parameter (`?token=...`), not in headers. - Revised the prerequisites and error handling sections to clarify Bitquery's authentication requirements. - Included a security note reminding users to treat the token-in-URL as a secret due to its visibility in logs and monitoring tools. - No changes to code or runtime; documentation only.
v1.0.2
**This version introduces live, real-time Bitcoin price streaming with derived metrics via WebSocket.** - Renamed skill and refocused purpose: now provides a real-time Bitcoin price feed (stream), not just polling API queries. - Added WebSocket streaming script (`scripts/stream_bitquery.py`) for live OHLC, volume, and moving averages/percents directly from Bitquery. - Updated documentation: new usage, streaming examples, and stricter trigger criteria for streaming market data (not polling). - Updated and clarified dependency handling (`requirements.txt` added for WebSocket support). - Cleaned up old polling/query script; removed unused sample and legacy files.
v1.0.1
- Documentation expanded for broader and more explicit usage: always use this skill for any crypto price or trading data requests, even if "Bitquery" is not mentioned. - Getting started and error-handling steps are streamlined and shown with clear code examples (Python, curl) for querying Bitquery. - Token ID formats and common tokens are now presented in a summary table for quick reference. - Output formatting instructions are clarified for consistency and readability. - Candlestick interval options are explained in a new table. - General language and instructions improved for clarity and directness.
v1.0.0
Bitquery Crypto Price Stream Skill v1.0.0 — Initial Release - Adds real-time and historical crypto token data querying via the Bitquery streaming GraphQL API. - Supports fetching token prices, OHLC candlesticks, trading volume, and token metadata. - Includes clear setup instructions for the required Bitquery API key environment variable. - Provides helper script usage (`scripts/query_bitquery.py`) for authentication and API calls. - Outlines error handling steps for common API response issues. - Offers output formatting guidelines for clear, user-friendly crypto market data display.
Metadata
Slug bitquery-crypto-price-stream
Version 1.0.4
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 5
Frequently Asked Questions

What is Reliable 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 derive... It is an AI Agent Skill for Claude Code / OpenClaw, with 394 downloads so far.

How do I install Reliable Bitcoin Price Feed?

Run "/install bitquery-crypto-price-stream" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Reliable Bitcoin Price Feed free?

Yes, Reliable Bitcoin Price Feed is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Reliable Bitcoin Price Feed support?

Reliable Bitcoin Price Feed is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Reliable Bitcoin Price Feed?

It is built and maintained by Divyasshree (@divyn); the current version is v1.0.4.

💬 Comments