cryptologo
v0.1.0
Published
TypeScript client for crypto-logo.com — 413 cryptocurrency logos in SVG, PNG, WebP, ICO
Maintainers
Readme
cryptologo
TypeScript client for crypto-logo.com — the cryptocurrency logo database with 413 coins in SVG, PNG, WebP, JPEG, and ICO formats. Zero dependencies (native fetch API).
Every logo is available as a scalable SVG vector and pre-generated raster derivatives in 13 standard sizes (16px to 2000px). Logos are served from Cloudflare R2 CDN with immutable cache headers. The dataset covers Bitcoin, Ethereum, Solana, and 410+ other cryptocurrencies ranked by market cap.
Browse logos at crypto-logo.com — Bitcoin logo, Ethereum logo, API docs
Table of Contents
- Install
- Quick Start
- What You Can Do
- Cryptocurrency Logo Standards
- API Reference
- TypeScript Types
- Also Available
- License
Install
npm install cryptologoQuick Start
import { CryptoLogo } from "cryptologo";
const client = new CryptoLogo();
// List all 413 coins sorted by market cap
const coins = await client.listCoins();
coins.slice(0, 3).forEach((coin) => {
console.log(`${coin.name} (${coin.ticker}) — rank #${coin.market_cap_rank}`);
});
// Download Bitcoin SVG logo
const svg = await client.getLogo("bitcoin-btc", "svg");
// Generate CDN URL for embedding
const url = client.getCdnUrl("ethereum-eth", "webp", 128);
// https://cdn.crypto-logo.com/logos/ethereum-eth/128x128/transparent.webpWhat You Can Do
List All Coins
Returns all 413 active coins with metadata including name, ticker, slug, format availability, localized search terms in 14 languages, and market cap ranking.
import { CryptoLogo } from "cryptologo";
const client = new CryptoLogo();
const coins = await client.listCoins();
// Filter coins with SVG logos
const svgCoins = coins.filter((c) => c.has_svg);
console.log(`${svgCoins.length} coins have SVG logos`);
// Find by ticker
const btc = coins.find((c) => c.ticker === "BTC");
console.log(`${btc?.name}: rank #${btc?.market_cap_rank}`);Fetch Logos
Fetch logo image data as ArrayBuffer. SVG requires no size parameter. Raster formats require a width.
import { CryptoLogo } from "cryptologo";
const client = new CryptoLogo();
// SVG vector — scalable, ideal for web
const svg = await client.getLogo("bitcoin-btc", "svg");
// PNG at 256x256
const png = await client.getLogo("ethereum-eth", "png", { width: 256 });
// OG image with white background (1200x630 for social sharing)
const og = await client.getLogo("bitcoin-btc", "png", {
width: 1200,
height: 630,
bg: "FFFFFF",
});
// Save to file (Node.js)
import { writeFileSync } from "node:fs";
writeFileSync("bitcoin.svg", Buffer.from(svg));Generate CDN URLs
Build URLs for direct embedding in HTML. The CDN serves pre-generated derivatives from Cloudflare R2 — no server overhead.
import { CryptoLogo } from "cryptologo";
const client = new CryptoLogo();
// CDN URL for fast display (recommended for <img> tags)
const url = client.getCdnUrl("bitcoin-btc", "webp", 128);
// https://cdn.crypto-logo.com/logos/bitcoin-btc/128x128/transparent.webp
// API URL (for downloads with Content-Disposition header)
const apiUrl = client.getLogoUrl("bitcoin-btc", "png", { width: 512 });
// https://crypto-logo.com/api/logo/bitcoin-btc.png?w=512&h=512Cryptocurrency Logo Standards
SVG vs PNG
| Use Case | Format | Reason | |----------|--------|--------| | Website/app UI | SVG | Scales to any resolution, ~2-15KB | | Exchange listing | PNG 512x512 | CoinGecko/CoinMarketCap standard | | Mobile app icon | PNG 128-256px | iOS/Android require raster | | Social media OG | PNG 1200x630 | Open Graph standard | | Documentation | SVG or PNG 64-128px | SVG preferred for quality |
Standard Sizes
crypto-logo.com pre-generates 13 sizes: 16, 32, 48, 64, 96, 120, 128, 200, 256, 400, 512, 1024, 2000 pixels (square), plus 1200x630 OG images.
API Reference
| Method | Returns | Description |
|--------|---------|-------------|
| listCoins() | Promise<Coin[]> | All 413 coins with metadata |
| getLogo(slug, fmt, opts?) | Promise<ArrayBuffer> | Logo image data |
| getLogoUrl(slug, fmt, opts?) | string | API URL for logo |
| getCdnUrl(slug, fmt?, width?) | string | CDN URL for embedding |
| getAsset(filePath) | Promise<ArrayBuffer> | Variant/history file |
TypeScript Types
interface Coin {
name: string;
ticker: string;
slug: string;
has_png: boolean;
has_svg: boolean;
search_terms: string[];
market_cap_rank: number | null;
}
type LogoFormat = "svg" | "png" | "webp" | "jpeg" | "ico";
interface GetLogoOptions {
width?: number;
height?: number;
bg?: string;
}Also Available
| Platform | Package | Install |
|----------|---------|---------|
| PyPI | cryptologo | pip install cryptologo |
| Go | cryptologo-go | go get github.com/dobestan/cryptologo-go |
| Rust | cryptologo | cargo add cryptologo |
| Ruby | cryptologo | gem install cryptologo |
License
MIT
