Indian Datasets
Indian Cities API
API documentation for fetching and managing city data from Indian states using JSONly API.
🇮🇳 Indian Cities API
This documentation explains how to use the Indian Cities API to retrieve and manage city information.
All endpoints return JSON responses, making them simple to use with JavaScript, Python, or any HTTP client.
🔗 Base URL
https://jsonly.vercel.app/api/india/cities⚙️ Query Parameters (GET)
Prop
Type
Fetch All Cities of a State
Endpoint:
GET /api/india/cities?state=rajasthanIn URLs, spaces are encoded as %20. Example: himachal pradesh → himachal%20pradesh.
Output Example
{
"success": true,
"state": "Rajasthan",
"total": 5,
"cities": ["Jaipur", "Jodhpur", "Udaipur", "Bikaner", "Ajmer"]
}Pagination (Limit & Offset)
Endpoint:
GET /api/india/cities?state=haryana&limit=2&offset=1Output Example
{
"success": true,
"state": "Haryana",
"total": 10,
"limit": 2,
"offset": 1,
"count": 2,
"cities": ["Gurgaon", "Rohtak"],
"hasMore": true
}🛠️ Mutations (Full CRUD)
Mutations are currently in-memory and will revert to the original state upon server restart.
1. Add a City (POST)
Adds a new city to an existing state.
POST /api/india/cities
Content-Type: application/json
{
"state": "Haryana",
"city": "New Cyber City"
}2. Update a City (PUT/PATCH)
Rename a city within a state.
PATCH /api/india/cities
Content-Type: application/json
{
"state": "Haryana",
"oldCity": "New Cyber City",
"newCity": "Modern Cyber City"
}3. Delete a City (DELETE)
Remove a city from a state.
DELETE /api/india/cities?state=Haryana&city=Modern Cyber CityLooking for state names? Use the Indian States API.