Skip to content

always-be-shipping/chainlink-feeds-api

Repository files navigation

Chainlink Feeds API 🚢

A RESTful API for accessing Chainlink price feed data across multiple blockchain networks

By Always be Shipping

Live Demo TypeScript Next.js

📖 Overview

The Chainlink Feeds API provides a simple, fast, and reliable way to query Chainlink oracle price feed data across multiple blockchain networks. Whether you're building a DeFi application, analytics dashboard, or research tool, this API gives you programmatic access to thousands of price feeds.

Live API: https://chainlink-feeds.alwaysbeshipp.ing

✨ Features

  • 🌐 Multi-Chain Support - Access feeds from Ethereum, Polygon, Arbitrum, Base, Optimism, and more
  • 🔍 Flexible Filtering - Query by base asset, quote asset, or both
  • Fast & Cached - Edge cache provided by Vercel
  • 📊 Rich Metadata - Get contract addresses, decimals, heartbeat, and more
  • 🎨 Clean API Design - RESTful endpoints with JSON responses
  • 🔒 TypeScript First - Full type safety and IntelliSense support

🚀 Quick Start

API Endpoints

Get All Feeds for a Chain

GET /api/feeds/[chain]

Example:

curl https://chainlink-feeds.alwaysbeshipp.ing/api/feeds/ethereum

Filter by Base Asset

GET /api/feeds/[chain]?base=[asset]

Example:

curl https://chainlink-feeds.alwaysbeshipp.ing/api/feeds/ethereum?base=eth

Filter by Base and Quote Assets

GET /api/feeds/[chain]?base=[asset]&quote=[asset]

Example:

curl https://chainlink-feeds.alwaysbeshipp.ing/api/feeds/ethereum?base=eth&quote=usd

Supported Chains

  • ethereum - Ethereum Mainnet
  • polygon - Polygon (Matic)
  • arbitrum - Arbitrum One
  • base - Base
  • optimism - Optimism
  • linea - Linea
  • andromeda - Metis Andromeda
  • mantle - Mantle
  • moonbeam - Moonbeam
  • moonriver - Moonriver
  • bob - BOB (Build on Bitcoin)
  • botanix - Botanix
  • hyperevm - Hyperliquid EVM

... and more! See lib/feeds.ts for the complete list.

Response Format

{
  "status":  "ok",
  "chain":  "ethereum",
  "feed": {
    "name": "ETH / USD",
    "pair": ["ETH", "USD"],
    "assetName": "ETH / USD",
    "feedType": "Crypto",
    "contractAddress": "0x...",
    "proxyAddress": "0x...",
    "decimalPlaces": 8,
    "heartbeat": 3600,
    "threshold": 0.5,
    "docs": {
      "baseAsset": "ETH",
      "quoteAsset": "USD",
      "blockchainName": "Ethereum",
      "assetClass": "Crypto",
      // ...additional metadata
    }
  }
}

🛠️ Local Development

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/always-be-shipping/chainlink-feeds-api.git
    cd chainlink-feeds-api
  2. Install dependencies

    bun install
    # or
    npm install
  3. Set up Convex

    npx convex dev

    Follow the prompts to create a new Convex project and set up your environment.

  4. Configure environment variables

    Create a .env.local file:

    NEXT_PUBLIC_CONVEX_URL=your_convex_deployment_url
  5. Start the development server

    bun dev
    # or
    npm run dev

    This runs both the Next.js dev server and Convex backend concurrently.

  6. Open your browser

    Navigate to http://localhost:3000

Development Scripts

# Run both Next.js and Convex in development mode
bun dev

# Run only Next.js
bun dev-next

# Run only Convex
bun dev-convex

# Build for production
bun build

# Start production server
bun start

# Run linter
bun lint

📁 Project Structure

chainlink-feeds-api/
├── app/
│   ├── api/
│   │   └── feeds/
│   │       └── [chain]/
│   │           └── route.ts      # API route handler
│   ├── page.tsx                  # Homepage
│   ├── layout.tsx                # Root layout
│   └── globals. css               # Global styles
├── components/
│   └── providers/
│       └── convex. tsx            # Convex provider
├── convex/
│   └── _generated/               # Convex generated code
├── lib/
│   └── feeds.ts                  # Feed fetching logic
├── types/
│   └── feeds. d.ts                # TypeScript types
└── public/                       # Static assets

🔧 Technology Stack

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

This project is part of the Always be Shipping organization. Check the repository for specific license details.

🔗 Links

🙏 Acknowledgments


Note: This is an unofficial API for accessing Chainlink feed data. For production applications, always verify data directly from on-chain sources.

About

API for Chainlink Feeds

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors