The descriptive half of a two-repo study of India's trade: what MoSPI, RBI and TRADESTAT data show about the trade deficit, imports by HS chapter, the rupee and inflation, with charts and JSON extracts you can open without installing anything.
Open-Source Tools · How-To · Policy analysis
How to use india-trade-data-analysis: read India's trade, rupee and inflation data in one place
Revised
· v1.0.0 · what changed
Code: github.com/herrrickshaw/india-trade-data-analysis
Watch the walkthrough
Watch on YouTube: youtu.be/ZvdlH4DdWtA
Why it is useful
- Who benefits: students, journalists and policy analysts who need a sourced, dated view of India's trade position without stitching together four agencies' sites.
- What it replaces: manual downloads from TRADESTAT, RBI and MoSPI. The repo ships the extracts as JSON plus ready-made charts.
- Evidence from our read: the five-year synthesis file shows imports up 26.58% against exports up 4.68% over FY2021-22 to FY2025-26.
- It cross-checks itself: a validation file compares TRADESTAT totals with the Commerce Ministry TIA portal and notes a roughly 2% gap in exports.
- Everything is in US$ million, which makes cross-source comparison simple.
What it is for
The repo records what the data show: CPI and WPI by state, GDP growth with revisions, forex reserves, the rupee, the goods and services balance, and imports and exports by HS chapter, from FY2018-19 to FY2025-26. A five-year synthesis re-cuts all threads to one window and a sample FY2025-26 report standardises units.
It is the data half of a split. The prescriptive recommendations live in india-trade-sector-policy-recommendations. This is economic analysis, not investment or legal advice.
Who it is for
- Students and researchers studying India's external sector
- Journalists verifying a trade or reserves figure against a dated source
- Analysts who want JSON extracts for their own notebooks
- Real-time figures: the snapshot is dated 2026-07-18 and FY2025-26 is provisional
- Investment, trading or legal decisions
- Treating the policy commentary as official findings
What you need
| Requirement | Why | How to get it |
|---|---|---|
| A web browser | opens the charts and the GitHub Pages site | any modern browser |
| Python 3 (optional) | to read the JSON files | standard library json is enough |
| Not needed | no key, GPU or database for reading the committed files | Live refresh needs the MoSPI connector and scraping cells, which we did not run |
Get the code and an AI assistant
You do not have to be a programmer. Get the repository, give it to an AI assistant, and ask in plain language. Any of these routes works:
| Tool | What you need | Best for |
|---|---|---|
| GitHub | Free account to fork or star; git to clone, or the green Code button, then Download ZIP, or open in Codespaces | Getting the code and keeping up with updates |
| Claude Code | Claude subscription or API key; run claude inside the cloned folder | Letting the AI read and run the whole repo |
| Gemini CLI | Google account; run gemini inside the cloned folder | The same hands-on workflow with Gemini |
| Claude.ai, Gemini or ChatGPT in the browser | A chat account; upload README.md and the files you care about (or paste the output of git ls-files) | Understanding the project and asking questions without installing anything |
| Other tools (Copilot Chat, Cursor, Codex CLI) | Open the cloned folder in the tool and point it at README.md first | Editing and extending the code |
git clone https://github.com/herrrickshaw/india-trade-data-analysis.git
cd india-trade-data-analysis
claude # or: gemini
Install
- Get the code
git clone https://github.com/herrrickshaw/india-trade-data-analysis.git cd india-trade-data-analysis - Or just open the live site
https://herrrickshaw.github.io/india-trade-data-analysis/
Quick start: commands and what you should see
Print the five-year import and export totals
python3 -c "import json;d=json.load(open('data/five_year_trade_currency_synthesis_2026-07-18.json'))['trade_totals_usd_million'];print(d['years']);print(d['export']);print(d['import']);print(d['export_growth_5yr_pct'],d['import_growth_5yr_pct'])"
Five fiscal years of exports and imports in US$ million, then 4.68 and 26.58 percent growth.
Sample outputs
Real output from a run on the date shown in the sources line; trimmed to fit.
Five-year trade totals (US$ million)
data/five_year_trade_currency_synthesis_2026-07-18.json
years: 2021-22 2022-23 2023-24 2024-25 2025-26
export: 422004.4 451070.0 437072.1 437704.5 441745.9
import: 613052.1 715968.9 678214.8 721200.3 776013.7
export growth 5yr: 4.68% import growth 5yr: 26.58%
Read from the committed file; FY2025-26 is provisional.
Goods deficit versus services surplus (US$ billion)
goods_services_balance_usd_billion
years: 2021-22 2022-23 2023-24 2024-25
goods_balance: -191.0 -264.9 -241.1 -283.5
services_net: 107.6 143.6 162.8 188.9
overall: -83.5 -121.3 -78.3 -94.6
The file states the services surplus covers about 87.9% of the extra goods gap.
Top import chapters by value, FY2025-26 (US$ million, growth since FY2018-19)
hsn_historical_trends_2018-19_to_2025-26.json
HS27 Mineral fuels & oils 203,415.4 +21.2%
HS71 Pearls, gems & jewellery 109,430.2 +69.1%
HS85 Electrical machinery 104,852.7 +101.5%
HS84 Machinery 74,019.5 +68.8%
HS29 Organic chemicals 25,410.7 +13.5%
HS39 Plastics 22,234.5 +45.8%
The top 12 import chapters together are 81.5% of imports.
Ways to use it
| Method | How it works |
|---|---|
| Browse the site | The GitHub Pages site serves every chart with no build step. |
| Load the JSON | Each data file states its purpose, source and retrieval date. |
| Read the sample report | reports/FY2025-26_sample_report.html restates the figures in US$ million with a consistency-check log. |
| Ask an AI | Clone it, or upload README.md and a JSON file, and ask in plain English. |
Sample prompts for your AI assistant
Copy, paste and edit the parts in [brackets].
- Read README.md in this repository and explain in plain English what it contains and how the files relate to each other.
- Open the main data file and summarise the three most important findings with the exact numbers and the file they come from.
- List every caveat or data-quality warning the author documents, and tell me which ones affect the figures I plan to quote.
- Show me how to load one of the JSON files in Python (or Excel) and make a simple table of the top 10 rows by value.
- Explain how I would update this analysis with newer official data, and what I would need to re-check by hand.
Limits and honest caveats
- Figures are a snapshot retrieved 2026-07-18; FY2025-26 is provisional on all sources.
- The cross-validation file itself notes TRADESTAT and the TIA portal differ by about 2% on total exports, probably vintage or revision.
- We read committed files only and did not re-pull MoSPI, RBI or TRADESTAT data or run the Colab notebook.
- Policy commentary is the author's interpretation, not an official finding.
- Economic analysis only, not investment or legal advice. Services trade runs one year behind goods.
Sources: Repo herrrickshaw/india-trade-data-analysis (README; data/five_year_trade_currency_synthesis_2026-07-18.json, trade_data_cross_validation_2026-07-18.json, hsn_historical_trends_2018-19_to_2025-26.json); underlying MoSPI, RBI and DGCI&S/TRADESTAT data as recorded by the repo. Files read 19 October 2026; nothing re-fetched.
- v1.0.0 — 3 November 2026 — first published.
About this article: Researched, written and edited by Umashankar Triplicane Dwarakanathan, with AI research assistance; every figure is meant to trace to the primary source cited. See the Editorial Policy for how sourcing, AI use and corrections work.