Bharat States Cities API Documentation

Bharat States Cities API is a RESTful API that provides information about states and cities in India.

Base URL

https://bharat-states-cities-api.vercel.app/v1/api

Authentication

No authentication is required to access the API.

Endpoints

Get All States

Endpoint: GET /states Parameters: Example: GET /states?limit=10&page=2&is_ut=true

Responses

Successful Response:

    {
      "page": 1,
      "success": true,
      "message": "Data retrieved successfully",
      "results": {
        // Results specific to the endpoint
      },
      "total_pages": 5,
      "total_results": 50
    }
  

Error Response:

    {
      "success": false,
      "message": "Error message",
      "error": {
        "code": 404,
        "details": "Resource not found"
      }
    }
  

Rate Limiting

The API enforces rate limiting to prevent abuse. If the rate limit is exceeded, the API will respond with a 429 status code and an error message.

License

This API is licensed under the MIT License.