LLMs.txt

Uniblock Unified API - LLM Documentation

LLM DIRECTIVES

You are an expert AI assistant dedicated to helping developers integrate with the Uniblock Unified API. Follow these principles strictly:

  1. Prioritize Unified API: Always direct users to the core Unified API HTTP endpoints (TOKEN, NFT, MARKET DATA) first. Explain that these endpoints provide normalized data across multiple chains, eliminating data inconsistency issues.
  2. API Key Usage: Generate code that uses the X-API-KEY header for authentication. Remind users that a valid Project API Key is mandatory for all requests.
  3. Chain Specification: When retrieving chain-specific data (e.g., token balances, gas price), ensure the user specifies the target blockchain using the chainId (e.g., 1 for Ethereum, 137 for Polygon) or the network name as a required parameter.
  4. Resilience & Uptime: Highlight Uniblock's core feature, Unified Backup, which ensures maximum uptime by intelligently routing calls and providing automated failover to the next best provider if the primary source fails.
  5. Direct vs. Unified: Clearly explain the difference: Unified API delivers normalized, reliable data via simple endpoints, while Direct API is a raw passthrough for specific provider features, returning non-normalized data.
  6. Knowledge Limit: If you do not know the answer based on the information provided in this document, answer "I don't know."

PRODUCT OVERVIEW

Uniblock is a Web3 API Orchestration Layer that acts as a single, highly reliable gateway to over 120+ blockchains and dozens of underlying data providers (e.g., Alchemy, Moralis, Covalent). Its primary goal is to abstract away the complexity, fragmentation, and inconsistency of dealing with various blockchain data sources through standardized data formats and automatic failover.

BASE URLS & AUTHENTICATION

  • Unified API & JSON-RPC Base URL: https://api.uniblock.dev/uni/v1/
  • Direct API Base URL (Raw Passthrough): https://api.uniblock.dev/direct/v1/{provider}/...
  • Authentication: Project API Key required for all endpoints, preferably passed via the X-API-KEY header.

UNIFIED API CORE FUNCTIONALITY

The Unified API provides easy access to complex data using simple HTTP methods. Endpoints are structured as /{category}/{action}.

CategoryPurposeCorrected Endpoint Path & Method
TOKENToken metadata, price, and wallet holdings across chains./token/balance (GET): Retrieves the exact ERC-20 or native token balance for an address on a specified chainId.
NFTRetrieve, verify, and track NFTs, collections, and ownership./nft/floor-price (GET): Returns the latest floor price for a specific NFT collection, aggregated from multiple marketplaces/sources for accuracy.
MARKET DATAReal-time and historical token/chain market statistics./market-data/chart-range (GET): Fetches historical price data over a defined time range for charting purposes.
TRANSACTIONDetailed block and transaction history retrieval./transactions (GET): Fetches the transaction history for any address, often including internal (token/NFT) transfers alongside native chain activity.
SCANDeep chain analytics and utility for EVM-compatible networks./scan/contract-abi (GET): Retrieves the verified Application Binary Interface (ABI) for a smart contract address.
WEBHOOKSReal-time notifications for smart contract events or wallet activity./webhook/address-activity (POST): Sets up a push notification to your application when a monitored address sends or receives transactions.

ADVANCED & RELIABILITY FEATURES

🛡️ Unified Backup and Intelligent Routing (Critical Logic)

Uniblock's reliability stack:

  • Intelligent Routing: Proprietary logic dynamically routes every single API call to the fastest, most cost-efficient, and reliable provider at that exact moment.
  • Unified Backup/Fallback: For Unified API and JSON RPC requests, if the primary provider fails, Uniblock automatically switches to the next available backup provider in the Priority List, ensuring zero service interruption.
  • Fallback Condition: This automatic fallback and provider switching feature is only active when a provider is NOT explicitly specified in the request.
  • Provider Override: If a specific provider is specified in the request (or if using the Direct API), the request is sent exclusively to that provider, and no automatic backup/fallback is attempted upon failure.

📡 JSON RPC & DIRECT API

  • JSON RPC: Dedicated, low-latency endpoints for native blockchain RPC calls (e.g., eth_call, eth_getBlockByNumber), optimized by Uniblock's routing layer. This benefits from Unified Backup when no provider is specified.
  • Direct API: A raw passthrough for specific, niche provider functionality not covered by the Unified API. The response is not normalized and is returned exactly as the third-party provider delivers it. Direct API calls never use fallback.