Giter Site home page Giter Site logo

yahoo-options-scraper's Introduction

Yahoo Options Scraper

A tool to monitor/collect basic data on options using Yahoo Finance.

Instructions

  1. clone the repository and install dependencies
$ git clone https://github.com/EliMLevy/Yahoo-Options-Scraper.git
$ cd Yahoo-Options-Scraper
$ pip3 install -r requirements.txt
  1. Run the main file and input the desired symbols as command line arguments
python3 main.py <symbols>
  1. Input the desired output directory (if the directory entered doesnt exist, it will be created) or press enter for the default "data" directory
Data output directory? (data)

Note: the collected data will be stored within a directory with todays date. In other words, if you plan on collecting data over several days, you can reuse an output directory.

Folder structure:

Yahoo-Options-Scraper
|
│   Project Files   
│
└───{Output directory}
│   │
│   └───{dd-mm-yy}
│       │   {symbol1}_calls.csv
│       │   {symbol1}_puts.csv
│       │   {symbol2}_calls.csv
│       │   {symbol2}_puts.csv
│       │   ...
|       ...

Note: The script waits 10 seconds between each HTTP request. Furthermore, a new HTTP request is made to collect data on each expiration period of an underlying. Therefore, an underlying with many expirations (or a set of underlyings) may take several minutes to complete data collection.

Output Format

For each symbol entered, the script will (if Yahoo Finance has the data) create two csv files, one for the calls contracts and one for the puts. Both types follow the same format:

Contract1 Contract2 ...
Strike Price 15.00 18.00 ...
Last Price 10.3 6.3 ...
Bid 11.1 5.6 ...
Ask 11.3 6.25 ...
Open Interest 6.0 30.0 ...
Implied Volatility 490.63 384.38 ...

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.