Skip to content

gauravkg11/api-automation-script-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Automation Script (Portfolio Demo)

Minimal, production-lean script to demonstrate real REST API integration using Python 3.11+, requests, and pandas. Fetches the latest ~30 daily candles from a public REST endpoint, converts timestamps to IST, saves to CSV, and prints a sample to the terminal. Provider-agnostic by design (no SDKs).

Requirements

  • Python 3.11+
  • Packages: requests, pandas

Install packages:

python -m pip install --upgrade pip
python -m pip install requests pandas

How to run

python api_automation.py --symbol BTCUSDT --interval 1d --limit 30 --output results/data.csv
  • Default values: symbol=BTCUSDT, interval=1d, limit=30, output=results/data.csv.
  • The script creates results/ if not present.
  • Timestamps are saved in IST (Asia/Kolkata).

What it does

  1. Calls a real REST API (baseline: Binance klines) via HTTP GET (no SDKs).
  2. Parses JSON into a typed pandas DataFrame with columns: open_time, open, high, low, close, volume, close_time.
  3. Converts timestamps to timezone-aware IST.
  4. Validates basic data quality (row count, nulls, monotonic time).
  5. Saves to CSV and prints a head() preview.

Switching providers

  • Change the base URL and query parameters.
  • Update the response-to-columns mapping in the script where indicated.
  • All other steps (validation, timezone conversion, CSV save, printing) remain the same.

Portfolio screenshots to capture

  • Terminal run showing the printed head() preview.
  • A CSV preview (first ~10 rows) from your editor/spreadsheet viewer.

Notes

  • This demo intentionally excludes indicators, backtests, databases, and schedulers to stay minimal and focused on API + data handling.

About

A Python script that automates data collection from a financial API and saves it for analysis.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages