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

@irfanokr/currency-api

v2026.5.1

Published

Free currency exchange rates API — 170+ currencies, any base, no API key, no rate limits. Daily updated.

Downloads

180

Readme

Free Currency Exchange Rates API

170+ currencies · Any base currency · No API key · No rate limits · Daily updated

Maintained by irfanokr  ·  Free forever


Why Use This?

| Feature | This API | Fixer.io | Open Exchange Rates | |---|---|---|---| | Free | ✅ | ❌ (paid) | ❌ (limited free) | | No API key | ✅ | ❌ | ❌ | | No rate limits | ✅ | ❌ | ❌ | | Any base currency | ✅ | ❌ (USD only on free) | ❌ (USD only on free) | | Historical data | ✅ | ❌ (paid) | ❌ (paid) | | Open source | ✅ | ❌ | ❌ |


Quick Start

No signup. No API key. Just GET the URL.

Base URL (always latest — updated daily)

https://cdn.jsdelivr.net/gh/irfanokr/currency-api@main/v1/currencies/{base}.json

Currency codes are lowercase: usd, pkr, eur, sar — not USD

Examples:

# USD as base — all currencies priced in USD
curl https://cdn.jsdelivr.net/gh/irfanokr/currency-api@main/v1/currencies/usd.json

# EUR as base
curl https://cdn.jsdelivr.net/gh/irfanokr/currency-api@main/v1/currencies/eur.json

# PKR as base — all currencies priced in Pakistani Rupees
curl https://cdn.jsdelivr.net/gh/irfanokr/currency-api@main/v1/currencies/pkr.json

# SAR — Saudi Riyal
curl https://cdn.jsdelivr.net/gh/irfanokr/currency-api@main/v1/currencies/sar.json

# AED — UAE Dirham
curl https://cdn.jsdelivr.net/gh/irfanokr/currency-api@main/v1/currencies/aed.json

Minified (faster, use in production)

curl https://cdn.jsdelivr.net/gh/irfanokr/currency-api@main/v1/currencies/usd.min.json

List all supported currencies

curl https://cdn.jsdelivr.net/gh/irfanokr/currency-api@main/v1/currencies/currencies.json

Fallback URL (GitHub Pages)

https://irfanokr.github.io/currency-api/v1/currencies/{base}.json

Response Format

{
  "date": "2026-04-29",
  "attribution": "irfanokr | https://github.com/irfanokr/currency-api | Free, no-limit currency API",
  "usd": {
    "aed": 3.6725,
    "aud": 1.5821,
    "btc": 0.0000129,
    "cny": 7.2541,
    "eur": 0.8540,
    "gbp": 0.7399,
    "inr": 83.942,
    "jpy": 159.61,
    "pkr": 278.50,
    "sar": 3.7501,
    "try": 38.42,
    "...": "170+ more currencies"
  }
}

Minified version (faster, smaller)

Add .min.json instead of .json:

curl https://cdn.jsdelivr.net/npm/@irfanokr/currency-api@latest/v1/currencies/usd.min.json

Currency Conversion Formula

To convert 100 USD → PKR:

const base = await fetch('https://cdn.jsdelivr.net/npm/@irfanokr/currency-api@latest/v1/currencies/usd.json')
  .then(r => r.json());

const pkrRate = base.usd.pkr;       // e.g. 278.50
const result  = 100 * pkrRate;      // 27850 PKR

To convert PKR → USD (or any pair):

const base = await fetch('https://cdn.jsdelivr.net/npm/@irfanokr/currency-api@latest/v1/currencies/pkr.json')
  .then(r => r.json());

const usdRate = base.pkr.usd;       // e.g. 0.003590
const result  = 50000 * usdRate;    // 179.5 USD

All Endpoints

| Endpoint | Description | |---|---| | /v1/currencies/currencies.json | List of all supported currency codes | | /v1/currencies/{base}.json | All rates with {base} as the base currency | | /v1/currencies/{base}.min.json | Minified version of the above | | /v1/currencies/latest.json | All bases × all targets in one file |


Supported Currencies (170+)

Includes all major fiat currencies, top cryptocurrencies (BTC, ETH, USDT, BNB…), and precious metals (XAU, XAG).

Currencies relevant to Pakistan & remittance corridors:

| Code | Currency | |---|---| | PKR | Pakistani Rupee | | USD | US Dollar | | SAR | Saudi Riyal | | AED | UAE Dirham | | GBP | British Pound | | EUR | Euro | | CNY | Chinese Yuan | | MYR | Malaysian Ringgit | | QAR | Qatari Rial | | KWD | Kuwaiti Dinar | | BHD | Bahraini Dinar | | OMR | Omani Rial |


Use in Your Project

JavaScript / Node.js

async function convert(amount, from, to) {
  const base = from.toLowerCase();
  const target = to.toLowerCase();
  const url = `https://cdn.jsdelivr.net/gh/irfanokr/currency-api@main/v1/currencies/${base}.min.json`;
  const data = await fetch(url).then(r => r.json());
  return amount * data[base][target];
}

// 100 USD → PKR
convert(100, 'usd', 'pkr').then(console.log);   // ~27850

// 50000 PKR → USD
convert(50000, 'pkr', 'usd').then(console.log);  // ~179.1

// SAR → PKR (remittance)
convert(1000, 'sar', 'pkr').then(console.log);   // ~7427

Python

import urllib.request, json

BASE = "https://cdn.jsdelivr.net/gh/irfanokr/currency-api@main/v1/currencies"

def convert(amount, from_currency, to_currency):
    url = f"{BASE}/{from_currency.lower()}.min.json"
    with urllib.request.urlopen(url) as r:
        data = json.loads(r.read())
    return amount * data[from_currency.lower()][to_currency.lower()]

print(convert(100, "usd", "pkr"))   # ~27850.0
print(convert(1000, "sar", "pkr"))  # ~7427.0

PHP

define('CURRENCY_API', 'https://cdn.jsdelivr.net/gh/irfanokr/currency-api@main/v1/currencies');

function convert($amount, $from, $to) {
    $data = json_decode(file_get_contents(CURRENCY_API . "/{$from}.min.json"), true);
    return $amount * $data[$from][$to];
}

echo convert(100, 'usd', 'pkr');   // ~27850
echo convert(1000, 'sar', 'pkr');  // ~7427

All Available URLs

| CDN | URL Pattern | Status | |---|---|---| | jsDelivr (GitHub) | cdn.jsdelivr.net/gh/irfanokr/currency-api@main/v1/currencies/{base}.json | ✅ Live now | | GitHub Pages | irfanokr.github.io/currency-api/v1/currencies/{base}.json | ✅ Live now | | GitHub Raw | raw.githubusercontent.com/irfanokr/currency-api/main/v1/currencies/{base}.json | ✅ Live now |

Use jsDelivr as primary (fastest CDN). GitHub Pages as fallback. GitHub Raw as last resort.


How It Works

  1. GitHub Actions runs daily at midnight UTC
  2. Python script fetches rates from multiple free data sources
  3. Generates one JSON file per base currency (170+ files)
  4. Publishes as an npm package (@irfanokr/currency-api)
  5. jsDelivr CDN serves the files globally — no server needed, ever

Zero cost. Zero maintenance. Open source.


Attribution

If you use this API in your project, a credit in your README or app is appreciated:

Exchange rates by [irfanokr/currency-api](https://github.com/irfanokr/currency-api) — Free & open source

License

Unlicense — public domain. Use it however you want.


Maintained by irfanokr