New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

glassnode-api

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glassnode-api

Node.js client for the Glassnode API

Source
npmnpm
Version
0.1.4
Version published
Weekly downloads
5
66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Glassnode API

A Node.js client for the Glassnode API.

Installation

npm install glassnode-api

Usage

import { GlassnodeAPI } from 'glassnode-api';

// Create an instance with your API key
const api = new GlassnodeAPI({
  apiKey: 'YOUR_API_KEY',
  // Optional: Override the API URL
  // apiUrl: 'https://api.glassnode.com'
});

// Fetch asset metadata
async function getAssets() {
  try {
    const response = await api.getAssetMetadata();
    console.log(response.data);
  } catch (error) {
    console.error('Error fetching asset metadata:', error);
  }
}

// Fetch metric metadata
async function getMetrics() {
  try {
    const response = await api.getMetricMetadata();
    console.log(response.data);
  } catch (error) {
    console.error('Error fetching metric metadata:', error);
  }
}

Examples

Explore our detailed examples to learn how to use the Glassnode API client effectively. The examples demonstrate:

  • Fetching and validating asset metadata
  • Working with metric lists and metadata
  • Calling metrics with parameters

To run the examples:

  • Navigate to the examples directory
  • Create a .env file with your API key: GLASSNODE_API_KEY=your_key_here
  • Install dependencies with npm install
  • Run an example with npx ts-node metadata.validation.ts

Development

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

# Lint code
npm run lint

# Format code
npm run format

License

MIT

FAQs

Package last updated on 13 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts