Giter Club home page Giter Club logo

mwindholtz / yahoo_finanza Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thiagoa/yahoo_finanza

0.0 0.0 0.0 64 KB

This is a simple Yahoo Finance module capable of getting current data for several symbols in bulk as well as individually. It also has an historical data method which fetches historical data about a symbol. Additional features include getting stock symbols filtered by country and stock market.

License: MIT License

Elixir 100.00%

yahoo_finanza's Introduction

YahooFinanza

Build Status

This is a simple Yahoo Finance module capable of getting current data for several symbols in bulk as well as individually. Additional features include getting stock symbols filtered by stock market.

Installation

  1. Add yahoo_finanza to your list of dependencies in mix.exs:

    def deps do [{:yahoo_finanza, "~> 0.2.3"}] end

  2. Ensure yahoo_finanza is started before your application:

    def application do [applications: [:yahoo_finanza]] end

Usage

Getting symbol list for a market

YahooFinanza.Symbol.symbols "market" ## => {:ok, ["symbol1", "symbol2", ..., "symboln"]}

Note: The available markets are: "amex", "nyse", "sp_500", "dow_jones", "nasdaq" To add a new market or listing simply add the csv file to the markets directory and add the market or listing name to the markets.csv file.

Getting stock quote for a single symbol

{:ok, quotes} = YahooFinanza.Quote.fetch(["AAPL"]) ## => {:ok, [%{"Symbol" => "AAPL", ... }]}

It's properties can be accessed like so:

quote = quotes |> List.first
quote["Ask"] ## => 12.0

Getting stock quote for multiple symbols

{:ok, quotes} = YahooFinanza.Quote.fetch(["AAPL", "FB"]) ## => {:ok, [%{"Symbol" => "AAPL", ... }, %{"Symbol" => "FB", ... }]}

Each quote can be accessed like so:

apple = quotes |> List.first ## => %{"Symbol" => "AAPL", ... }

Combining the Symbol and Quote Modules

{:ok, nyse_symbols} = YahooFinanza.Symbol.symbols "nyse"
{:ok, nyse_quotes} = nyse_symbols |> Enum.take(100) |> YahooFinanza.Quote.fetch

Contributing

  1. Fork it ( https://github.com/[my-github-username]/yahoo_finanza/fork )
  2. Create your feature branch (git checkout -b feature/my_new_feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Special Thanks To:

  1. Daniel Berkompas (@danielberkompas)
  2. Benjamin Tan Wei Hao
  3. Johnny Mejias (@datajohnny)

yahoo_finanza's People

Contributors

waasi 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.