Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🇮🇳 India States & Districts

Complete and up-to-date list of Indian States/UTs + Districts in JSON format.

Use it as:

  • Downloadable data
  • Free public API (via GitHub raw links)
  • Ready code examples in multiple languages

📦 Data Files

File Description Size
data/india_states_districts.json Pretty (readable) ~84 KB
data/india_states_districts.med.json Medium (code + name on same line) ~43 KB
data/india_states_districts.min.json Fully minified ~32 KB

🌐 Live Website (UI)

👉 https://codingmation.github.io/indian-states-districts/

Features:

  • Browse all States & Districts
  • Search / Filter
  • View & Copy code examples of 5 languages
  • Direct API links

🔗 Use as API (Free)

https://raw.githubusercontent.com/codingmation/indian-states-districts/main/data/india_states_districts.min.json

You can also use the medium or pretty version by changing the filename.


🛠 Two Main Functions (All Languages)

Every example provides these two functions:

  1. Get All States → returns list of { code, name }
  2. Get Districts by State → pass state code (e.g. "UP", "MH") and get its districts

Supported Languages

  • JavaScript
  • Python
  • PHP
  • Java
  • C#

See the examples/ folder.


🚀 Quick Start

JavaScript

const states = await getAllStates();
const districts = await getDistrictsByState("UP");

Python

states = get_all_states()
districts = get_districts_by_state("UP")

PHP

$states = getAllStates();
$districts = getDistrictsByState("UP");

📁 Project Structure

indian-states-districts/
├── data/
│   ├── india_states_districts.json
│   ├── india_states_districts.med.json
│   └── india_states_districts.min.json
├── examples/
│   ├── javascript/example.js
│   ├── python/example.py
│   ├── php/example.php
│   ├── java/Example.java
│   └── csharp/Example.cs
├── index.html          ← Website
├── README.md
├── LICENSE
└── .gitignore

📄 License

MIT License – free for personal & commercial use.


❤️ Credits

Created with ❤️ by codingmation

Releases

Packages

Contributors

Languages