npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cfxdevkit/geckoterminal

v0.2.0

Published

A TypeScript library for interacting with Geckoterminal API

Readme

@cfxdevkit/geckoterminal

A TypeScript library for interacting with the GeckoTerminal API, providing easy access to DEX pools, tokens, and trading data on the Conflux Network and other chains.

npm version Build Status Coverage Status npm bundle size License: MIT TypeScript Node Version PRs Welcome

Features

  • 🚀 Full TypeScript support with comprehensive type definitions
  • 📊 Access to GeckoTerminal's DEX pools and token data
  • 💱 Real-time trading information and price data
  • 📈 Built-in data formatting and utility functions
  • 🔍 Detailed error handling and logging
  • 📝 Well-documented API methods
  • ⚡ Modern ES6+ syntax

Installation

npm install @cfxdevkit/geckoterminal

Quick Start

import { GeckoTerminal } from '@cfxdevkit/geckoterminal';

const client = new GeckoTerminal();

// Get all networks
const networks = await client.getNetworks();

// Get DEXes for Conflux network
const dexes = await client.getNetworkDexes('cfx');

// Get top pools for Swappi on Conflux
const pools = await client.getTopPools('cfx', 'swappi');

Examples

Network and DEX Information

const client = new GeckoTerminal();

// Get all supported networks
const networks = await client.getNetworks();

// Get DEXes for a specific network
const dexes = await client.getNetworkDexes('cfx');

Pool Information

// Get top pools for a specific DEX
const topPools = await client.getTopPools('cfx', 'swappi');

// Get trending pools
const trendingPools = await client.getTrendingPools('cfx', '24h');

// Get new pools
const newPools = await client.getNewPools('cfx');

// Get specific pool information
const poolInfo = await client.getPoolInfo('cfx', 'pool_address');

// Get pool OHLCV data
const ohlcv = await client.getPoolOHLCV('cfx', 'pool_address', 'hour', {
    limit: '3'
});

Token Information

// Get token information
const tokenInfo = await client.getTokenInfo('cfx', 'token_address');

// Get pools for a specific token
const tokenPools = await client.getTokenPools('cfx', 'token_address');

// Get multiple token information
const multiTokenInfo = await client.getMultiTokenInfo('cfx', ['token1', 'token2']);

// Get simple token prices
const tokenPrices = await client.getSimpleTokenPrices('cfx', ['token1', 'token2'], true, true);

Search Functionality

// Search for pools
const searchResults = await client.searchPools('WETH', 'cfx');

Formatting Utilities

The library includes various formatting utilities for data presentation:

import { formatUtils } from '@cfxdevkit/geckoterminal';

// Format currency
formatUtils.currency(1234.5678); // "$1,234.57"
formatUtils.compactCurrency(1234567); // "$1.23M"

// Format percentages
formatUtils.percentage(12.345); // "12.35%"
formatUtils.changePercent(-12.345); // "-12.35%"

// Format dates
formatUtils.date(1612137600); // "2021-02-01 00:00:00"
formatUtils.monthYear(new Date("2024-02-15")); // "February 2024"

// Classify volatility
formatUtils.volatility(0.75); // "High"

API Reference

Networks and DEXes

Get Networks

const networks = await client.getNetworks();

Get Network DEXes

const dexes = await client.getNetworkDexes('cfx');

Pools

Get Top Pools

const pools = await client.getTopPools('cfx', 'swappi');

Get Trending Pools

const trending = await client.getTrendingPools('cfx', '24h');

Get Pool Information

const info = await client.getPoolInfo('cfx', 'pool_address');

Tokens

Get Token Information

const token = await client.getTokenInfo('cfx', 'token_address');

Get Token Prices

const prices = await client.getSimpleTokenPrices('cfx', ['token_address']);

Development

Prerequisites

  • Node.js >= 16.0.0
  • npm

Setup

  1. Clone the repository:
git clone https://github.com/cfxdevkit/geckoterminal.git
cd geckoterminal
  1. Install dependencies:
npm install

Available Scripts

  • npm run build - Build the library
  • npm run test - Run tests
  • npm run test:coverage - Run tests with coverage
  • npm run lint - Lint the code
  • npm run format - Format the code
  • npm run example - Run example usage script

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/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Links

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments