data

Query Stellar chain data via Stellar RPC and Horizon APIs.

3|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/stellar-zk/stellar-zk --skill data-stellar-zk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: data
Source: https://github.com/stellar-zk/stellar-zk/tree/main/.claude/skills/data
Command: npx skills add https://github.com/stellar-zk/stellar-zk --skill data-stellar-zk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @stellar/stellar-sdk.

What problem does it solve? Reading Stellar blockchain state requires choosing between two API paradigms (Stellar RPC and Horizon), each with different endpoints, history limits, and capabilities, which makes it hard to pick the right method for balances, transactions, events, or historical queries. ## Core Features & Use Cases - Stellar RPC Methods: Covers getLatestLedger, getLedgerEntries, getEvents, simulateTransaction, sendTransaction, and transaction polling with TypeScript examples using @stellar/stellar-sdk. - Horizon REST API: Documents account loading, balances, transactions, operations, payments, effects, pagination, and Server-Sent Events streaming for legacy workflows. - Historical Data & Migration: Explains the 7-day RPC history limit, Hubble BigQuery datasets, Galexie pipelines, the Stellar data lake, third-party indexers, and Horizon-to-RPC migration patterns. - Use Case: When building an analytics dashboard that needs both live contract events and multi-year payment history, use this Skill to combine RPC getEvents for recent data with Hubble or Galexie for deep history. ## Quick Start Ask the assistant to fetch an account's recent transactions and contract events from Stellar testnet using the RPC and Horizon patterns in this skill.

Frequently Asked Questions about data

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query Stellar blockchain data with the RPC API?▼

Create an rpc.Server instance from @stellar/stellar-sdk pointing at a network endpoint, then call methods like getLatestLedger, getLedgerEntries, getEvents, or getTransaction. Testnet uses https://soroban-testnet.stellar.org; mainnet requires a provider endpoint.

Stellar RPC vs Horizon: which API should I use?▼

Use Stellar RPC for new projects, smart contract interactions, simulation, and real-time state. Use Horizon for historical transaction queries, payment streaming, and legacy applications, since most RPC methods only cover the last 7 days.

How do I get Stellar transaction history older than 7 days?▼

Most RPC methods only retain 7 days of history, though getLedgers can reach genesis via Infinite Scroll. For full history, query the Hubble BigQuery dataset, run a Galexie data pipeline, or use third-party indexers like Mercury or SubQuery.

Does Stellar RPC support streaming events like Horizon?▼

No, Stellar RPC has no WebSocket or streaming support; you must poll methods like getEvents or getLatestLedger on an interval. Horizon supports native Server-Sent Events streaming via the .stream() method with onmessage and onerror handlers.

How do I handle rate limits on Stellar RPC and Horizon?▼

Both APIs enforce rate limits, so implement exponential backoff when receiving HTTP 429 responses and cache responses where possible. For high-volume applications, consider running your own RPC or Horizon nodes.