Categorygithub.com/edward-yakop/go-gecko
repository
0.0.0-20241213024407-6e2b219979c8
Repository: https://github.com/edward-yakop/go-gecko.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

CoinGecko API Client for Go

Build Status Coverage Status Go Report CardGoDoc

Simple API Client for CoinGecko written in Go

gogecko

gopher resources from free-gophers-pack

Available endpoint

Refer to CoinGecko official API

EndpointStatusTestingFunction
/ping:heavy_check_mark::heavy_check_mark:Ping
/simple/price:heavy_check_mark::heavy_check_mark:SimplePrice
/simple/supported_vs_currencies:heavy_check_mark::heavy_check_mark:SimpleSupportedVSCurrencies
/coins/list:heavy_check_mark::heavy_check_mark:CoinsList
/coins/markets:heavy_check_mark::heavy_check_mark:CoinsMarkets
/coins/{id}:heavy_check_mark::heavy_check_mark:CoinsID
/coins/{id}/tickers:heavy_check_mark::heavy_check_mark:CoinsIDTickers
/coins/{id}/history:heavy_check_mark::heavy_check_mark:CoinsIDHistory
/coins/{id}/market_chart:heavy_check_mark::heavy_check_mark:CoinsIDMarketChart
/exchanges:heavy_check_mark::heavy_check_mark:Exchanges
/exchanges/{id}:heavy_check_mark::heavy_check_mark:ExchangesID
/exchanges/list:heavy_check_mark::heavy_check_mark:ExchangesList
/exchanges/{id}/tickers:heavy_check_mark::heavy_check_mark:ExchangesTickers
/exchange_rates:heavy_check_mark::heavy_check_mark:ExchangeRate
/global:heavy_check_mark::heavy_check_mark:Global

Usage

Installation with go get.

go get -u github.com/edward-yakop/go-gecko

For usage, checkout Example folder for v3

For production, you might need to set time out for httpClient, here's a sample code:

package main

import (
	"net/http"
	"time"

	coingecko "github.com/edward-yakop/go-gecko/v3"
)

func main() {
	httpClient := &http.Client{
		Timeout: time.Second * 10,
	}
	CG := coingecko.NewClient(httpClient)
}

Convention

refer to https://medium.com/@marcus.olsson/writing-a-go-client-for-your-restful-api-c193a2f4998c

License

MIT