Capturing Stock Prices into a Local Database
Goal
Tools and Services used
- SQL Server 2019
- Visual Studio Code
- SQL Server Database Project
- Python 3.9
- Jupyter plugin in Visual Studio Code
- SQL Server Management Studio 18
- IEX Cloud / Apperate
API Service Chosen
API Call Response Structure
"close": 0.99,
"fclose": 0.99,
"fhigh": 0.99,
"flow": 0.99,
"fopen": 0.99,
"fvolume": 0,
"high": 0.99,
"low": 0.99,
"open": 0.99,
"priceDate": "2023-01-12",
"symbol": "BTG-AO",
"uclose": 0.99,
"uhigh": 0.99,
"ulow": 0.99,
"uopen": 0.99,
"uvolume": 0,
"volume": 0,
"id": "HISTORICAL_PRICES",
"key": "BTG-AO",
"subkey": "",
"date": 1673481600000,
"updated": 1673503202000
}
]
Database Table Structure
Some things to take a note of.
- The schema APPERATE is created because that is the name of service the data is coming from putting grouping all tables and procedures used in association with that service under the same schema allows for easy convention structure to quickly know about those database objects.
- All the incoming data from the API Call is stored as strings so that it reduces the chances of running into an error when loading in the data into the database.
- This is only the first step of loading in the data. It will be converted into the actual data types like Dates and Decimals in another step.
- The other columns that are for keeping meta data about the data being loaded.
Loading Data with Python
Next is the Python file to do the API call then do some slight transformation and load into the SQL Database.


This article explains how to build a local stock market database by retrieving daily stock prices from the IEX Cloud API and storing them in SQL Server using Python. Integrating APIs with relational databases enables automated financial data collection, making it easier to perform historical analysis, backtesting, and quantitative research.
ReplyDeleteBuilding automated financial data pipelines requires skills in Python, databases, REST APIs, and data processing. Students interested in developing intelligent financial analytics systems can explore Big Data Projects, where scalable data ingestion, storage, and large-scale analytics are implemented using modern data engineering technologies.
ReplyDeleteWorking with financial APIs and SQL databases also strengthens practical data engineering skills used in real-world applications. Readers can enhance their expertise through RESTful API Training, which covers API integration, data retrieval, and backend communication techniques for enterprise applications.
ReplyDeleteFor readers interested in exploring practical implementations of large-scale data processing and analytics, 15 Big Data Projects for Final Year Students showcases real-world project ideas involving data pipelines, analytics, and modern big data technologies.
ReplyDelete