Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coinmarketcap-js

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coinmarketcap-js

Javascript SDK for CoinMarketCap

  • 1.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
332
decreased by-14.65%
Maintainers
1
Weekly downloads
 
Created
Source

coinmarketcap-js

A javascript SDK for interacting with the free version of the CoinMarketCap API.

Install

npm install coinmarketcap-js

Setup Client

import { restClient } from "coinmarketcap-js";

const rest = restClient("API KEY");

// Can now use API
const idMapResult = await rest.crypto.idMap({ limit: 1 });
const infoResult = await rest.crypto.info({ symbol: "BTC" });

API Methods

  • Cryptocurrency
  • Fiat
  • Exchange
  • Global

Cryptocurrency

categories

Returns paginated data about all coin categories.

Options Object?:

id?String
start?Number
limit?Number
slug?String
symbol?String

Example:

import { restClient } from "coinmarketcap-js";

const rest = restClient("API KEY");

try {
  const result = await rest.crypto.categories({ limit: 1, symbol: "BTC" });
} catch (error) {
  console.log(error);
}

category

Returns data about a single coin category.

Options Object:

idString
start?Number
limit?Number
convert?String
convertId?String

Example:

import { restClient } from "coinmarketcap-js";

const rest = restClient("API KEY");

try {
  const category = await rest.crypto.category({
    id: "categoryID",
    limit: 1,
  });
} catch (error) {
  console.log(error);
}

idMap

Returns all or a paginated list of cryptocurrencies.

Options Object?:

listingStatus?String
start?Number
limit?Number
sort?String
symbol?String
aux?String

Example:

import { restClient } from "coinmarketcap-js";

const rest = restClient("API KEY");

try {
  const result = await rest.crypto.idMap({ limit: 100 });
} catch (error) {
  console.log(error);
}

info

Returns static data for one or many cryptocurrencies.

Options Object?:

id?String
slug?String
symbol?String
address?String
aux?String

Example:

import { restClient } from "coinmarketcap-js";

const rest = restClient("API KEY");

try {
  const result = await rest.crypto.info({ symbol: "BTC" });
} catch (error) {
  console.log(error);
}

latestListings

Returns paginated list of all active cryptocurrencies along with latest market data.

Options Object?:

start?Number
limit?Number
priceMin?Number
priceMax?Number
marketCapMin?Number
marketCapMax?Number
volume24hMin?Number
volume24hMax?Number
circulatingSupplyMin?Number
circulatingSupplyMax?Number
percentChange24hMin?Number
percentChange24hMax?Number
convert?String
convertId?String
sort?String
sortDir?String
cryptocurrencyType?String
tag?String
aux?String

Example:

import { restClient } from "coinmarketcap-js";

const rest = restClient("API KEY");

try {
  const result = await rest.crypto.latestListings({ limit: 50 });
} catch (error) {
  console.log(error);
}

latestQuotes

Returns the latest market quote data for one or many cryptocurrencies.

Options Object?:

id?Number
slug?String
symbol?String
convert?String
convertId?String
aux?String
skipInvalid?Boolean

Example:

import { restClient } from "coinmarketcap-js";

const rest = restClient("API KEY");

try {
  const result = await rest.crypto.latestQuotes({ symbol: "BTC" });
} catch (error) {
  console.log(error);
}

Fiat

idMap

Returns data about fiat currencies with unique CoinMarketCap ids.

Options Object?:

start?Number
limit?Number
sort?String
includeMetals?Boolean

Example:

import { restClient } from "coinmarketcap-js";

const rest = restClient("API KEY");

try {
  const result = await rest.fiat.idMap({ limit: 1 });
} catch (error) {
  console.log(error);
}

Exchange

info

Returns static data for one or more exchanges.

Options Object?:

id?String
slug?String
aux?String

Example:

import { restClient } from "coinmarketcap-js";

const rest = restClient("API KEY");

try {
  const result = await rest.exchange.info({ id: "270" });
} catch (error) {
  console.log(error);
}

idMap

Returns a paginated list of all active cryptocurrency exchanges per CoinMarketCap ID

Options Object?:

listingStatus?String
slug?String
start?Number
limit?Number
sort?String
aux?String
cryptoId?String

Example:

import { restClient } from "coinmarketcap-js";

const rest = restClient("API KEY");

try {
  const result = await rest.exchange.idMap({ limit: 1 });
} catch (error) {
  console.log(error);
}

Global

latestQuotes

Returns the latest global cryptocurrency market metrics.

Options Object?:

convert?String
convertId?String

Example:

import { restClient } from "coinmarketcap-js";

const rest = restClient("API KEY");

try {
  const result = await rest.global.latestQuotes();
} catch (error) {
  console.log(error);
}

Keywords

FAQs

Package last updated on 19 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc