Skip to main content

Fetch large amounts of historical stock data from Tiingo for free.

Project description

📈 Tiingo Fetcher - A Python Library for Fetching Market Data

📌 About

tiingo_fetcher is a lightweight Python library that allows users to fetch large amounts of historical stock data for free using the Tiingo API.

Unlike other APIs that limit minute-level data to 7 days, Tiingo Fetcher allows you to retrieve up to 9 years of minute, hourly, and daily data efficiently.


📦 Installation

You can install the package using pip:

pip install tiingo-fetcher

🔑 Setup: Get a Tiingo API Key

To use this package, you need a Tiingo API key:

  1. Sign up for a free Tiingo account: https://www.tiingo.com/
  2. Generate your API key from the Account → API Section.
  3. Use the API key directly in your script (no .env file is required).

🚀 Usage

1️⃣ Fetching Historical Stock Data

You can fetch stock data by calling fetch_data() and passing the stock symbol, API key, start date, end date, and frequency:

from tiingo_fetcher.fetch_data import fetch_data

data = fetch_data("AAPL", "your_api_key_here", "2023-01-01", "2023-02-01", "1min")

print(data.head())

Parameters:

  • symbol (str) - Stock ticker symbol (e.g., "AAPL").
  • api_key (str) - Your Tiingo API Key (must be provided directly in the function call).
  • start_date (str) - Start date in YYYY-MM-DD format.
  • end_date (str) - End date in YYYY-MM-DD format.
  • freq (str) - Frequency ('1min', '5min', '15min', '30min', '60min', 'daily').

🏗 Project Structure

tiingo_fetcher/
├── tiingo_fetcher/         # Package folder
│   ├── __init__.py         # Marks it as a package
│   ├── fetch_data.py       # Core data-fetching logic
├── example_usage/          # Example scripts
│   ├── test.py             # Example usage script
├── README.md               # Documentation
├── setup.py                # Package setup
├── requirements.txt        # Dependencies

🔧 Troubleshooting

"ModuleNotFoundError: No module named 'tiingo_fetcher'"

  • Ensure the package is installed:
    pip install --upgrade tiingo-fetcher
    
  • If running locally, try:
    python -m example_usage.test
    

📜 License

This project is licensed under the MIT License. You are free to use, modify, and distribute it.


⭐ Support

If you find this project useful, consider giving it a ⭐ on GitHub!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tiingo_fetcher-0.1.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tiingo_fetcher-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file tiingo_fetcher-0.1.1.tar.gz.

File metadata

  • Download URL: tiingo_fetcher-0.1.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for tiingo_fetcher-0.1.1.tar.gz
Algorithm Hash digest
SHA256 db54db9cbe05fe8f5f1e8e92d16427ed7da4f28ccecd17b5072c7815a318d447
MD5 edb2b2823240ba5eb94c6e0af18dea53
BLAKE2b-256 c17ca4bbcd88f48601780c670b7cb1305b4ce666078e47d6bf03cc061629d70f

See more details on using hashes here.

File details

Details for the file tiingo_fetcher-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tiingo_fetcher-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for tiingo_fetcher-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 067ef637a5a63b5b9a444747c8d282efdccf2ba3756669492e964dab09da2394
MD5 9acdcd8b0280570d89949e955246c293
BLAKE2b-256 be788128f754c5051bd6c618639fdd7e863933736ba608296e6863bc586d2919

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page