glassnode-api - v1.0.0
    Preparing search index...

    Type Alias MetricMetadata

    MetricMetadata: {
        bulk_supported?: boolean;
        descriptors?: {
            data_sharing_group?: string;
            description?: Record<string, string>;
            group?: string;
            name?: string;
            short_name?: string;
            tags?: string[];
        };
        is_pit?: boolean;
        modified?: number;
        parameters?: Record<string, string[]>;
        parameters_defaults?: Record<string, string[]>;
        path: string;
        queried?: Record<string, any>;
        refs?: {
            docs?: string;
            metric_variant?: { base?: string; bulk?: string; pit?: string };
            studio?: string;
        };
        tier: number;
        timerange?: { max: number; min: number };
    }

    Metric metadata type

    Type Declaration

    • Optionalbulk_supported?: boolean

      Whether bulk queries are supported for this metric

    • Optionaldescriptors?: {
          data_sharing_group?: string;
          description?: Record<string, string>;
          group?: string;
          name?: string;
          short_name?: string;
          tags?: string[];
      }

      Human-readable descriptors (name, tags, description)

    • Optionalis_pit?: boolean

      Whether this is a point-in-time metric

    • Optionalmodified?: number

      When the metric's metadata was last updated, in unix seconds (as sent by the API, like every other time field). undefined when the API omits it. Convert with new Date(modified * 1000).

    • Optionalparameters?: Record<string, string[]>

      All allowed parameters of the metric and their values, keyed by parameter name (e.g. { a: ['BTC', 'ETH', …], i: ['24h', …] }). Optional, with no {} default: undefined when the API omits it, so read it with ?. (e.g. meta.parameters?.a ?? []).

    • Optionalparameters_defaults?: Record<string, string[]>

      Default values of the parameters that have one, keyed by parameter name (e.g. { e: ['aggregated'] }: without e, the metric is served for aggregated). Only sent for metrics with a defaulted parameter, so undefined for most metrics.

    • path: string

      Metric path

    • Optionalqueried?: Record<string, any>

      The request's parameters as the API echoes them back (e.g. { path: '/market/price_usd_close' }, plus a when an asset was passed). Optional: undefined when the API omits it, so read it with ?..

    • Optionalrefs?: {
          docs?: string;
          metric_variant?: { base?: string; bulk?: string; pit?: string };
          studio?: string;
      }

      Reference links for this metric (docs, Studio, variant paths). Optional: undefined when the API omits it, so read it with ?. (e.g. meta.refs?.docs).

    • tier: number

      Access tier required for this metric, as a non-negative integer (e.g. 2). Type it as MetricMetadata['tier'].

    • Optionaltimerange?: { max: number; min: number }

      Available time range for this metric. Both bounds are unix timestamps in seconds (numbers, not Dates) — convert with new Date(min * 1000).

      • max: number

        Latest available data point, in unix seconds (number)

      • min: number

        Earliest available data point, in unix seconds (number)