Giter Site home page Giter Site logo

coinpaprikaapi's Introduction

Coinpaprika API Client

Async C# Client for the CoinPaprika API. The current version supports CoinPaprika API v1.5.

CoinPaprika delivers full market data to the world of crypto: coin prices, volumes, market caps, ATHs, return rates and more.

Build status

Install

CoinPaprika API Client is availabe on Nuget.

Dependencies

The library depends on JSON.net, which is just simply the best Json-library for .NET; It should get installed automatically (with the Nuget package), but depending on your project, you may have to install it manually via Nuget Package Manager/CLI.

This library is using .NET Standard 2.0, you can check compatibility of your project here.

Getting started

CoinpaprikaAPI.Client client = new CoinpaprikaAPI.Client();

Generic return type

All requests return a CoinPaprikaEntity with a generic type (TPaprikaEntity). The CoinPaprikaEntity provides these properties:

  • Value, based on the type specified by the API call
  • Raw , json value returned by the API)
  • Error, may be an HTTP-Error or an API-Error (check the ErrorMessage property for details)
  • RawError , json value of the Error property

If the call was succesfull, Error is null and Value provides the returned data from the API.

API

Get global information
var globals = await client.GetClobalsAsync();

returns single CoinPaprikaEntity of Type Global

Get all coins listed on Coinpaprika
var coins = await client.GetCoinsAsync();

returns CoinPaprikaEntity with a List of objects of Type CoinInfo

Get coin details by Id
var coins = await client.GetCoinByIdAsync("btc-bitcoin");

returns single CoinPaprikaEntity of Type ExtendedCoinInfo

Get twitter timeline for coin Id
var coins = await client.GetTwitterTimelineForCoinAsync("btc-bitcoin");

returns CoinPaprikaEntity with a List of objects of Type CoinTweetInfo

Get coin events by coin Id
var coins = await client.GetEventsForCoinAsync("btc-bitcoin");

returns CoinPaprikaEntity with a List of objects of Type CoinEventInfo

Get exchanges by coin Id
var coins = await client.GetExchangesForCoinAsync("btc-bitcoin");

returns CoinPaprikaEntity with a List of objects of Type ExchangeInfo

Get markets by coin Id
var coins = await client.GetMarketsForCoinAsync("btc-bitcoin");

returns CoinPaprikaEntity with a List of objects of Type MarketInfo

Get latest Open/High/Low/Close values with volume and market_cap by coin Id
var coins = await client.GetLatestOhlcForCoinAsync("btc-bitcoin", "USD");

returns CoinPaprikaEntity with a List of objects of Type OhlcValue

Get historical Open/High/Low/Close values with volume and market_cap by coin Id
var firstOfMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
var end = DateTime.Now.Subtract(TimeSpan.FromDays(1));

var ohlcvHistorical = await _client.GetHistoricalOhlcForCoinAsync("btc-bitcoin", new DateTimeOffset(firstOfMonth), end, 200, "USD");

returns single CoinPaprikaEntity with a List of objects of Type OhlcValue

Get today's Open/High/Low/Close values with volume and market_cap by coin Id
var coins = await client.GetTodayOhlcForCoinAsync("btc-bitcoin", "USD");

returns CoinPaprikaEntity with a List of objects of Type OhlcValue

Get ticker information for all coins (including quotes)
var tickers = await client.GetTickers(new[] { "USD", "CHF", "BTC" });

returns CoinPaprikaEntity with a List of objects of Type TickerWithQuotesInfo

Get ticker information for specific coin
var ticker = await client.GetTickerForCoin("btc-bitcoin");

returns single CoinPaprikaEntity of Type TickerInfo

Get historical ticker information for specific coin
var ticker = await _client.GetHistoricalTickerForIdAsync(id, new DateTimeOffset(DateTime.Now.Subtract(TimeSpan.FromDays(1))), DateTimeOffset.Now, 1000, "USD", TickerInterval.OneHour);

returns CoinPaprikaEntity with a List of objects of Type HistoricalTickerInfo

Get a list of exchanges by quotes
var exchanges = await client.GetExchangesAsync(new[] { "USD", "CHF", "BTC" });

returns CoinPaprikaEntity with a List of objects of Type ExtendedExchangeInfo

Get exchange by id
var ticker = await client.GetExchangeByIdAsync("binance", new[] { "USD", "CHF", "BTC" });

returns single CoinPaprikaEntity of Type ExtendedExchangeInfo

Get a list markets of exchange by Id
var markets = await client.GetMarketsByExchangeIdAsync("binance");

returns CoinPaprikaEntity with a List of objects of Type ExchangeMarketInfo

Get people by Id
var person = await client.GetPeopleByIdAsync("vitalik-buterin");

returns single CoinPaprikaEntity of Type PersonInfo

Get a list of tags
var tags = await client.GetTagsAsync(new[] { "coins", "icos" });

returns CoinPaprikaEntity with a List of objects of Type TagInfo

Get tag info by Id
var tag = await client.GetTagByIdAsync("smart-contracts", new[] { "coins", "icos" });

returns single CoinPaprikaEntity of Type TagInfo

Search for currencies/icos/people/exchanges/tags
var searchterms = "coin";
//passing in null searches all categories
var searchResult = await client.SearchAsync(searchTerms, 10, null);

returns CoinPaprikaEntity of Type SearchResult

Convert currencies
var converionResult = await _client.ConvertAsync("btc-bitcoin", "eth-ethereum", 1.5);

returns CoinPaprikaEntity of Type PriceConversionInfo

License

CoinPaprika C# Client is availabe unter the MIT license, see also the LICENSE file.

coinpaprikaapi's People

Contributors

msicc avatar

Watchers

James Cloos 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.