Bharat States Cities API is a RESTful API that provides comprehensive information about states and cities in India. It offers an easy-to-use interface to access a curated list of Indian states and their respective cities, making it a valuable resource for applications requiring location-based data within the Indian subcontinent.
- Retrieve a list of all Indian states.
- Get detailed information about a specific state by its ID.
- Fetch cities associated with a particular state.
- Obtain a list of all cities across India.
- Support for pagination and query parameters for flexible data retrieval.
- Rate limiting to prevent abuse and ensure fair usage.
- Node.js (version 18.x recommended)
- PostgreSQL database
-
Clone the repository:
git clone https://github.com/AshokWebWorks/Bharat-States-Cities-API.git cd bharat-states-cities-api
-
Install dependencies:
npm install
-
Set up your PostgreSQL database and configure the connection details in
db.js
. -
Start the server:
npm start
GET http://localhost:3000/v1/api/states
GET http://localhost:3000/v1/api/states/1
GET http://localhost:3000/v1/api/states/1/cities
GET http://localhost:3000/v1/api/cities
For detailed information on available endpoints, query parameters, and response formats, refer to the API Documentation.
Contributions are welcome! If you have any improvements, bug fixes, or feature requests, please submit an issue or a pull request.
This project is licensed under the MIT License.