GithubHelp home page GithubHelp logo

cmcpro's Introduction

Coinmarketcap Pro API Client

Coinmarketcap Pro API Client written in Golang

Current version: v1

Usage

package main

import (
	"fmt"
	cmc "github.com/NovikovRoman/cmcpro"
	"log"
	"os"
	"time"
)

func main() {
	// true - https://pro-api.coinmarketcap.com/v1, false - https://sandbox-api.coinmarketcap.com/v1
	proxy := ""
	client, err := cmc.New(os.Getenv("API-KEY"), false, proxy, time.Duration(time.Second*15))
	if err != nil {
		log.Fatalf("create client %s", err.Error())
	}
	data, status, err := client.CryptocurrencyListingsLatest(
		10, 3, "name", cmc.SortAsc, cmc.NewConvertByCodes("RUB", "USD"), cmc.All)
	if err != nil {
		log.Fatalf("request %s", err.Error())
	}
	if status.ErrorMessage != "" {
		log.Fatalf("error %s", status.ErrorMessage)
	}
	fmt.Println(data)
}

See also tests

Features

Type Endpoint Done
Cryptocurrency /v1/cryptocurrency/info
Cryptocurrency /v1/cryptocurrency/map
Cryptocurrency /v1/cryptocurrency/listings/latest
Cryptocurrency /v1/cryptocurrency/listings/historical
Cryptocurrency /v1/cryptocurrency/market-pairs/latest
Cryptocurrency /v1/cryptocurrency/ohlcv/latest
Cryptocurrency /v1/cryptocurrency/ohlcv/historical
Cryptocurrency /v1/cryptocurrency/quotes/latest
Cryptocurrency /v1/cryptocurrency/quotes/historical
Exchange /v1/exchange/info
Exchange /v1/exchange/map
Exchange /v1/exchange/listings/latest
Exchange /v1/exchange/listings/historical -
Exchange /v1/exchange/market-pairs/latest
Exchange /v1/exchange/quotes/latest
Exchange /v1/exchange/quotes/historical
Global Metrics /v1/global-metrics/quotes/latest
Global Metrics /v1/global-metrics/quotes/historical
Tools /v1/tools/price-conversion
KeyInfo /v1/key/info

Reference

Coinmarketcap Pro v1

cmcpro's People

Contributors

novikovroman avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.