Git Product home page Git Product logo

marketstack's Introduction

.NET Marketstack API

NuGet version (Marketstack)

marketstack is a JSON-based REST API for real-time, intraday and historical stock market data, supporting 125,000+ stock ticker symbols from 72+ worldwide stock exchanges. The API was built upon powerful apilayer cloud infrastructure, handling any volume with ease - from a few API requests per day all the way to millions of calls per minute.

Give a Star! โญ

If you like or are using this project please give it a star. Thanks!

Supported Stock Market Data

  • 125.000+ Stock Tickers
  • 72+ Stock Exchanges
  • 50+ Countries

In-depth Documentation

An in-depth API documentation, including interactive code examples and extensive descriptions can be found at marketstack.com/documentation

Usage

Initialize MarketstackService:

    var options = Options.Create(new MarketstackOptions() { ApiToken = "apiToken"});
    var marketstackService = new MarketstackService(options, NullLogger<MarketstackService>.Instance);    

GetExchanges:

    var exchanges = await marketstackService.GetExchanges();

GetExchangeStocks:

    var nasdaqMic = "XNAS";
    var stocks = await marketstackService.GetExchangeStocks(nasdaqMic);

GetStockEodBars:

    var appleSymbol = "AAPL";
    var fromDate = DateTime.Now.AddDays(-200);
    var toDate = DateTime.Now;
    var bars = await marketstackService.GetStockEodBars(appleSymbol, fromDate, toDate);      

Parallel Requests:

Parallel requests are supported using the Throttling Libary that allows limiting the number of requests per second.

    var options = Options.Create(new MarketstackOptions() { ApiToken = apiKey, MaxRequestsPerSecond = 3, Https = true });
    var marketstackService = new MarketstackService(options, NullLogger<MarketstackService>.Instance);
    List<string> symbols = new List<string>() { "AAPL", "MSFT", "GOOG", "VOD", "NVDA", "NFLX", "PEP", "NOW", "VEEV", "MOH" };
    var fromDate = new DateTime(2017, 9, 1);
    var toDate = DateTime.Now;
    var tasks = symbols.Select(async (symbol) => await marketstackService.GetStockEodBars(symbol, fromDate, toDate));
    var stocksBars = await Task.WhenAll(tasks);

Tests

Before running the tests, the ApiToken should be set using:

setx ASPNETCORE_MarketstackApiToken {Your_Api_Token} /M

Legal

All usage of the marketstack website, API, and services is subject to the marketstack Terms & Conditions and all annexed legal documents and agreements.

marketstack's People

Contributors

fredrik-c avatar jenscaasen avatar orshe4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

marketstack's Issues

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.