Loading markets

Developers

Syncing market data...
Back to BlockMarketScan

BlockMarketScan API

Real-time crypto market data for thousands of tokens. Prices, market caps, trading pairs, and OHLCV data.

Download SDK

Base URL

https://blockmarketscan.com/api

Rate Limits

Public endpoints need no auth. Prices refresh every 60s.

Format

JSON responses. SDK available for JavaScript/Node.js.

Quick Start

Top 10 tokens by market cap in one line:

fetch('https://blockmarketscan.com/api/tokens?limit=10&sort=market_cap&order=desc')
  .then(r => r.json())
  .then(d => console.log(d.data));

Endpoints

CoinMarketCap-compatible market data routes for listings, quotes, metadata, OHLCV, categories, trending assets, simple price lookups, and global metrics.

JavaScript SDK

Download .js file

Copy this SDK into your project or include it via script tag. Works in browsers and Node.js.

Include via CDN
<script src="https://blockmarketscan.com/blockmarketscan-sdk.js"></script>
// BlockMarketScan SDK — copy this into your project
// Or download: https://blockmarketscan.com/blockmarketscan-sdk.js

class BlockMarketScan {
  constructor(baseUrl = 'https://blockmarketscan.com/api') {
    this.baseUrl = baseUrl;
  }

  async _fetch(path, params = {}) {
    const url = new URL(this.baseUrl + path);
    Object.entries(params).forEach(([k, v]) => {
      if (v != null) url.searchParams.set(k, String(v));
    });
    const res = await fetch(url);
    if (!res.ok) throw new Error('BlockMarketScan API: ' + res.status);
    return res.json();
  }

  // CoinMarketCap-compatible endpoints
  async getCryptoMap({ start, limit, sort, symbol } = {}) {
    return this._fetch('/v1/cryptocurrency/map', { start, limit, sort, symbol });
  }

  async getCryptoInfo({ id, slug, symbol, address } = {}) {
    return this._fetch('/v2/cryptocurrency/info', { id, slug, symbol, address });
  }

  async getListingsLatest({ start, limit, sort, sortDir } = {}) {
    return this._fetch('/v3/cryptocurrency/listings/latest', { start, limit, sort, sort_dir: sortDir });
  }

  async getListingsNew({ start, limit } = {}) {
    return this._fetch('/v1/cryptocurrency/listings/new', { start, limit });
  }

  async getQuotesLatest({ id, slug, symbol, address } = {}) {
    return this._fetch('/v3/cryptocurrency/quotes/latest', { id, slug, symbol, address });
  }

  async getMarketPairs({ id, slug, symbol, limit } = {}) {
    return this._fetch('/v2/cryptocurrency/market-pairs/latest', { id, slug, symbol, limit });
  }

  async getOhlcvLatest({ id, slug, symbol } = {}) {
    return this._fetch('/v2/cryptocurrency/ohlcv/latest', { id, slug, symbol });
  }

  async getOhlcvHistorical({ id, slug, symbol, timeStart, timeEnd, count } = {}) {
    return this._fetch('/v2/cryptocurrency/ohlcv/historical', {
      id, slug, symbol, time_start: timeStart, time_end: timeEnd, count,
    });
  }

  async getCategories({ limit } = {}) {
    return this._fetch('/v1/cryptocurrency/categories', { limit });
  }

  async getCategory({ id, start, limit, sort, sortDir } = {}) {
    return this._fetch('/v1/cryptocurrency/category', { id, start, limit, sort, sort_dir: sortDir });
  }

  async getTrendingLatest(limit = 20) {
    return this._fetch('/v1/cryptocurrency/trending/latest', { limit });
  }

  async getGainersLosers(limit = 20) {
    return this._fetch('/v1/cryptocurrency/trending/gainers-losers', { limit });
  }

  async getSimplePrice({ id, slug, symbol } = {}) {
    return this._fetch('/v1/simple/price', { id, slug, symbol });
  }

  async getGlobalMetrics() {
    return this._fetch('/v1/global-metrics/quotes/latest');
  }

  // List tokens with filters
  async getTokens({ page, limit, sort, order, search, chain, newOnly } = {}) {
    const p = { page, limit, sort, order, search, chain };
    if (newOnly) p.new = 'true';
    return this._fetch('/tokens', p);
  }

  // Token detail by slug or UUID
  async getToken(idOrSlug) {
    return this._fetch('/tokens/' + idOrSlug);
  }

  // OHLCV candles
  async getOHLCV(tokenId) {
    return this._fetch('/tokens/' + tokenId + '/ohlcv');
  }

  // Global market stats
  async getStats() {
    return this._fetch('/stats');
  }

  // Search by name, symbol, or contract address
  async search(query) {
    return this._fetch('/tokens', { search: query });
  }

  // Top gainers
  async getTopGainers(limit = 20) {
    return this._fetch('/tokens', { sort: 'percent_change_24h', order: 'desc', limit });
  }

  // Top losers
  async getTopLosers(limit = 20) {
    return this._fetch('/tokens', { sort: 'percent_change_24h', order: 'asc', limit });
  }

  // Newly launched tokens
  async getNewlyLaunched(limit = 50) {
    return this._fetch('/tokens', { new: 'true', limit });
  }

  // Tokens by chain
  async getByChain(chain, limit = 100) {
    return this._fetch('/tokens', { chain, limit });
  }
}

// Usage:
// const bms = new BlockMarketScan();
// const { data } = await bms.getTokens({ limit: 10, sort: 'market_cap' });
// const btc = await bms.getToken('bitcoin');
// const stats = await bms.getStats();

BlockMarketScan API — https://blockmarketscan.com/api

Prices update every 60 seconds. Need higher rate limits? .