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:
- Sign up for a free Tiingo account: https://www.tiingo.com/
- Generate your API key from the Account → API Section.
- Use the API key directly in your script (no
.envfile 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 inYYYY-MM-DDformat.end_date(str) - End date inYYYY-MM-DDformat.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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db54db9cbe05fe8f5f1e8e92d16427ed7da4f28ccecd17b5072c7815a318d447
|
|
| MD5 |
edb2b2823240ba5eb94c6e0af18dea53
|
|
| BLAKE2b-256 |
c17ca4bbcd88f48601780c670b7cb1305b4ce666078e47d6bf03cc061629d70f
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
067ef637a5a63b5b9a444747c8d282efdccf2ba3756669492e964dab09da2394
|
|
| MD5 |
9acdcd8b0280570d89949e955246c293
|
|
| BLAKE2b-256 |
be788128f754c5051bd6c618639fdd7e863933736ba608296e6863bc586d2919
|