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

nepal-bullion-price

v0.3.1

Published

Nepal gold and silver prices — FENEGOSIDA daily rates + live international prices with estimate breakdown

Readme

nepal-bullion-price

npm version license

Nepal gold and silver prices — FENEGOSIDA daily rates + live international prices with estimate breakdown.

Features

  • Nepal daily rates from FENEGOSIDA (3 fallback sources)
  • Live international prices (XAU/XAG → NPR per tola)
  • Estimate breakdown — customs duty, importer margin, dealer margin, estimated adjustment (separate rates for gold & silver)
  • USD/NPR forex from Nepal Rastra Bank (2 fallbacks)
  • News aggregation — gold/silver news from Google News RSS, OnlineKhabar, and GNews API
  • In-memory caching with configurable TTL and stale fallback
  • TypeScript — full type definitions included

Requirements

  • Node.js 18+
  • Server-side only (uses fetch and HTML scraping — not for browsers)

Installation

npm install nepal-bullion-price
pnpm add nepal-bullion-price

Quick Start

import {
  getNepalGoldPrice,
  getNepalSilverPrice,
  getLiveGoldPrice,
  getLiveSilverPrice,
  getAllPrices,
  getNews,
  configure,
} from 'nepal-bullion-price';

// Nepal daily FENEGOSIDA rate
const gold = await getNepalGoldPrice();
// {
//   hallmark: 273900,
//   tajabi: 0,
//   unit: 'tola',
//   perGram10: 234825,
//   previousPrice: 275000,       // yesterday's hallmark (null if unavailable)
//   history: [                   // 7-day chart data (null for fallback providers)
//     { date: '18', price: 275000 },
//     { date: '19', price: 273900 }
//   ],
//   priceDate: 'Chaitra 11',    // Nepali calendar date (BS), not Gregorian
//   source: 'fenegosida.org',
//   date: '2026-03-24',
//   updatedAt: '2026-03-24T04:15:00.000Z',
//   isStale: false
// }

// Nepal daily silver rate
const silver = await getNepalSilverPrice();
// { price: 4505, unit: 'tola', perGram10: 3862, ... }

// Live international price with Nepal estimate breakdown
const live = await getLiveGoldPrice();
// {
//   raw: { usdPerOz: 4569.40, usdToNpr: 150.67 },
//   perTola: {
//     basePrice: 258140,
//     customsDuty: 51628,
//     importerMargin: 1549,
//     dealerMargin: 1557,
//     estimatedAdjustment: 2503,
//     estimatedPrice: 315377
//   },
//   rates: { customsDuty: 0.2, importerMargin: 0.005, dealerMargin: 0.005, estimatedAdjustment: 0.008 },
//   source: 'gold-api.com',
//   updatedAt: '2026-03-25T04:26:12Z',
//   isStale: false
// }

// Live silver
const liveSilver = await getLiveSilverPrice();

// All prices at once (partial failures return null, not throw)
const all = await getAllPrices();
// { gold: { nepal, live }, silver: { nepal, live } }

// Aggregated gold/silver news
const news = await getNews();       // all languages
const npNews = await getNews('np');  // Nepali only
// { items: [{ id, title, summary, url, source, language, publishedAt, category }], fetchedAt }

// Override estimate rates per metal or add API keys
configure({
  rates: {
    gold: { customsDuty: 0.06 },
    silver: { customsDuty: 0.20 },
  },
  apiKeys: { goldApiIo: 'your-key' },
  cacheTtl: 10 * 60 * 1000, // 10 minutes
});

API

| Function | Returns | Description | |----------|---------|-------------| | getNepalGoldPrice() | Promise<NepalGoldPrice> | FENEGOSIDA daily gold rate (hallmark + tajabi) | | getNepalSilverPrice() | Promise<NepalSilverPrice> | FENEGOSIDA daily silver rate | | getLiveGoldPrice() | Promise<LiveMetalPrice> | Live XAU/USD → NPR with estimate breakdown | | getLiveSilverPrice() | Promise<LiveMetalPrice> | Live XAG/USD → NPR with estimate breakdown | | getAllPrices() | Promise<AllPrices> | All four in parallel (null on failure) | | getNews(lang?) | Promise<NewsData> | Aggregated gold/silver news (optional 'en' or 'np' filter) | | configure(opts) | void | Override rates, API keys, or cache TTL | | resetConfig() | void | Restore all settings to defaults | | resetCaches() | void | Clear caches (call after changing TTL) |

configure(options)

Rates are configured per metal via rates.gold and rates.silver:

| Option | Type | Gold Default | Silver Default | Description | |--------|------|-------------|----------------|-------------| | rates.{metal}.customsDuty | number | 0.20 (20%) | 0.20 (20%) | Customs duty rate | | rates.{metal}.importerMargin | number | 0.005 (0.5%) | 0.005 (0.5%) | Importer margin used in the estimate | | rates.{metal}.dealerMargin | number | 0.005 (0.5%) | 0.005 (0.5%) | Dealer margin used in the estimate | | rates.{metal}.estimatedAdjustment | number | 0.008 (0.8%) | 0.030 (3.0%) | Calibration for freight, insurance, local premium, and FENEGOSIDA-vs-spot gaps | | apiKeys.goldApiIo | string | — | — | goldapi.io API key (enables fallback) | | apiKeys.asheshApiKey | string | — | — | Ashesh widget API key (has public default) | | apiKeys.gnewsApiKey | string | — | — | GNews API key (enables news fallback) | | cacheTtl | number | 300000 | 300000 | Cache TTL in ms for live & forex prices |

Note: cacheTtl applies to live spot prices and forex rates only. Nepal daily prices use an adaptive TTL — 5 minutes during the FENEGOSIDA update window (10 AM–12 PM NPT) and 1 hour otherwise. This is not affected by configure().

Data Sources

Each category tries providers in order. If all fail, cached (stale) data is returned with isStale: true.

Nepal daily prices

| Priority | Source | Auth | |----------|--------|------| | Primary | fenegosida.org | None | | Fallback | ashesh.com.np | None | | Fallback | hamropatro.com | None |

Live spot price (XAU/XAG)

| Priority | Source | Auth | |----------|--------|------| | Primary | gold-api.com | None | | Fallback | Swissquote forex feed | None | | Fallback | goldapi.io | API key via configure() |

USD/NPR forex rate

| Priority | Source | Auth | |----------|--------|------| | Primary | Nepal Rastra Bank | None | | Fallback | fawazahmed0/currency-api | None | | Fallback | open.er-api.com | None |

News

| Priority | Source | Auth | |----------|--------|------| | Primary | Google News RSS (gold, silver, Nepal) | None | | Primary | OnlineKhabar RSS | None | | Fallback | GNews API | API key via configure() |

News items are keyword-filtered for gold/silver relevance, deduplicated, categorized (gold/silver/market), and cached for 1 hour.

Estimate Breakdown

Live prices are converted from USD/oz to NPR/tola (1 tola = 11.6638 g, 1 troy oz = 31.1035 g) using the NRB sell rate (the rate importers pay when buying USD), then Nepal import costs and estimate adjustments are applied sequentially:

basePrice      = round((usdPerOz / 31.1035) × 11.6638 × usdToNpr)
customsDuty    = round(basePrice × customsDutyRate)
afterCustoms   = basePrice + customsDuty
importerMargin      = round(afterCustoms × importerMarginRate)
afterImporter       = afterCustoms + importerMargin
dealerMargin        = round(afterImporter × dealerMarginRate)
afterDealer         = afterImporter + dealerMargin
estimatedAdjustment = round(afterDealer × estimatedAdjustmentRate)
estimatedPrice      = afterDealer + estimatedAdjustment     ← approx. FENEGOSIDA rate

Default rates

| Charge | Gold | Silver | Source | |--------|------|--------|--------| | Customs duty | 20% | 20% | Nepal Budget 2083/84 | | Importer margin | 0.5% | 0.5% | Industry pricing practice | | Dealer margin | 0.5% | 0.5% | Industry pricing practice | | Estimated adjustment | 0.8% | 3.0% | Freight, insurance, local premium, and FENEGOSIDA-vs-spot calibration |

The estimatedPrice approximates what FENEGOSIDA publishes as the daily rate. The estimated adjustment covers freight & insurance costs, local premiums, CIF-based customs amplification, and FENEGOSIDA-vs-spot calibration. The estimated adjustment rates (0.8% for gold, 3.0% for silver) are derived from market back-testing and are not officially published or confirmed figures. The former 2% luxury tax on gold and silver jewellery has been scrapped. A separate 0.5% skill promotion fee may apply at final consumer sale, but it is not included in the published bullion rate estimate.

All rates are configurable per metal via configure({ rates: { gold: { ... }, silver: { ... } } }).

Note: priceDate in Nepal price responses uses the Nepali Bikram Sambat (BS) calendar (e.g. "Chaitra 19"), not Gregorian. The Gregorian date is in the date field. previousPrice and history are only available from the FENEGOSIDA primary source — fallback providers (ashesh, hamropatro) return null for these fields.

MCP Server

This package includes an MCP (Model Context Protocol) server so AI assistants like Claude, Cursor, and Codex can query Nepal bullion prices.

Tools

| Tool | Description | |------|-------------| | get_nepal_gold_price | FENEGOSIDA daily gold rate + yesterday's price | | get_nepal_silver_price | FENEGOSIDA daily silver rate + yesterday's price | | get_live_gold_price | Live XAU/USD → NPR with customs, importer margin, dealer margin, estimated adjustment | | get_live_silver_price | Live XAG/USD → NPR with customs, importer margin, dealer margin, estimated adjustment | | get_all_prices | All prices at once |

Setup

Claude Code:

claude mcp add nepal-bullion -- npx nepal-bullion-price

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "nepal-bullion": {
      "command": "npx",
      "args": ["nepal-bullion-price"]
    }
  }
}

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "nepal-bullion": {
      "command": "npx",
      "args": ["nepal-bullion-price"]
    }
  }
}

License

MIT