Coder Social home page Coder Social logo

yfinance-rest-api's Introduction

yfinance REST API

yfinance REST API is a REST API built in Python using the Flask framework. yfinance REST API is an extesion of the yfinance project hosted at https://github.com/ranaroussi/yfinance

Getting Started

Install dependencies

cd /path/to/yfinance-rest-api
pip install -r requirements.txt

Build stocks collection

export MONGO_URL=<YOUR_MONGO_CONNECTION_URL>
python setup.py --build

Run app

export FLASK_APP=app
export FLASK_ENV=development
export MONGO_URL=<YOUR_MONGO_CONNECTION_URL>
export NEWS_API_KEY<YOUR_NEWS_API_KEY>
flask run

(Optional) Run stocks collection calculated analysis

export MONGO_URL=<YOUR_MONGO_CONNECTION_URL>
python setup.py --run_analysis

(Optional) Unset any previous stocks collection calculated analysis

export MONGO_URL=<YOUR_MONGO_CONNECTION_URL>
python setup.py --unset_analysis

Usage

Name HTTP Verb API Endpoint Purpose
Ping GET /api/v1/system/ping Check if API is alive
Tickers GET /api/v1/finance/stocks/tickers Get list of tickers
Search GET /api/v1/finance/stocks/search?q=A&limit=25 Search for stocks by ticker
Most Popular GET /api/v1/finance/stocks/most-popular Get a list of the most popular stocks
Fast Moving GET /api/v1/finance/stocks/fast-moving?sort=percentage.asc&limit=100 Get a list of the fastest moving stocks
Info GET /api/v1/finance/stocks/info?ticker=F Get stock info
Historical GET /api/v1/finance/stocks/historical?ticker=DIS&period=5d Get stock historical market data
Dividends GET /api/v1/finance/stocks/dividends?ticker=MSFT Get stock dividends
Splits GET /api/v1/finance/stocks/splits?ticker=FB Get stock splits
Financials GET /api/v1/finance/stocks/financials?ticker=TSLA&term=1y Get stock financials
Major Holders GET /api/v1/finance/stocks/major-holders?ticker=JNJ Get stock major holders
Institutional Holders GET /api/v1/finance/stocks/institutional-holders?ticker=V Get stock institutional holders
Balance Sheet GET /api/v1/finance/stocks/balance-sheet?ticker=AAPL&term=quarter Get stock balance sheet
Cashflow GET /api/v1/finance/stocks/cashflow?ticker=GOOG&term=quarter Get stock cashflow
Earnings GET /api/v1/finance/stocks/earnings?ticker=AMZN&term=quarter Get stock earnings
Sustainability GET /api/v1/finance/stocks/sustainability?ticker=WMT Get stock sustainability
Recommendations GET /api/v1/finance/stocks/recommendations?ticker=BAC Get stock recommendations
Calendar GET /api/v1/finance/stocks/calendar?ticker=MA Get stock calendar
ISIN GET /api/v1/finance/stocks/isin?ticker=HD Get stock isin
Options Expirations GET /api/v1/finance/stocks/options-expirations?ticker=NKE Get stock options expirations
Calls GET /api/v1/finance/stocks/calls?ticker=CRM&date=2021-08-24 Get stock calls
Puts GET /api/v1/finance/stocks/puts?ticker=NFLX&date=2021-08-25 Get stock puts
News Everything GET /api/v1/finance/news/everything?q=$MSFT Search millions of articles

Built With

License

This project is licensed under the MIT license.

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.