India Regions API
Power state, district and locality dropdowns. States use ISO 3166-2:IN codes; common older codes (TS, OR, UT, CT) are accepted as input.
All states and union territories
GEThttps://superapi.fly.dev/v1/states
Parameters
None.
Sample request
curl "https://superapi.fly.dev/v1/states" \
-H "X-Api-Key: YOUR_API_KEY"import requests
resp = requests.get(
"https://superapi.fly.dev/v1/states",
params={},
headers={"X-Api-Key": "YOUR_API_KEY"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())const params = new URLSearchParams({});
const resp = await fetch(`https://superapi.fly.dev/v1/states?${params}`, {
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
});
if (!resp.ok) throw new Error((await resp.json()).error);
console.log(await resp.json());req, _ := http.NewRequest("GET", "https://superapi.fly.dev/v1/states", nil)
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))Sample response
[
{
"name": "Andaman and Nicobar Islands",
"code": "AN",
"districts": 3,
"offices": 102
},
{
"name": "Andhra Pradesh",
"code": "AP",
"districts": 13,
"offices": 10334
},
{
"name": "Arunachal Pradesh",
"code": "AR",
"districts": 15,
"offices": 295
}
]Try it
Districts in a state
GEThttps://superapi.fly.dev/v1/districts
Parameters
| Name | Type | Description |
|---|---|---|
state required | string | State or union territory name, or its ISO code (e.g. Telangana or TG). |
Sample request
curl "https://superapi.fly.dev/v1/districts?state=TG" \
-H "X-Api-Key: YOUR_API_KEY"import requests
resp = requests.get(
"https://superapi.fly.dev/v1/districts",
params={"state": "TG"},
headers={"X-Api-Key": "YOUR_API_KEY"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())const params = new URLSearchParams({"state":"TG"});
const resp = await fetch(`https://superapi.fly.dev/v1/districts?${params}`, {
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
});
if (!resp.ok) throw new Error((await resp.json()).error);
console.log(await resp.json());req, _ := http.NewRequest("GET", "https://superapi.fly.dev/v1/districts?state=TG", nil)
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))Sample response
[
{
"name": "Adilabad",
"state": "Telangana",
"state_code": "TG"
},
{
"name": "Hyderabad",
"state": "Telangana",
"state_code": "TG"
},
{
"name": "K.V.Rangareddy",
"state": "Telangana",
"state_code": "TG"
}
]Try it
Localities (post offices) in a district
GEThttps://superapi.fly.dev/v1/localities
Parameters
| Name | Type | Description |
|---|---|---|
state required | string | State or union territory name, or its ISO code (e.g. Telangana or TG). |
district required | string | District name within the state (case-insensitive). |
Sample request
curl "https://superapi.fly.dev/v1/localities?state=Karnataka&district=Bangalore" \
-H "X-Api-Key: YOUR_API_KEY"import requests
resp = requests.get(
"https://superapi.fly.dev/v1/localities",
params={"state": "Karnataka", "district": "Bangalore"},
headers={"X-Api-Key": "YOUR_API_KEY"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())const params = new URLSearchParams({"state":"Karnataka","district":"Bangalore"});
const resp = await fetch(`https://superapi.fly.dev/v1/localities?${params}`, {
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
});
if (!resp.ok) throw new Error((await resp.json()).error);
console.log(await resp.json());req, _ := http.NewRequest("GET", "https://superapi.fly.dev/v1/localities?state=Karnataka&district=Bangalore", nil)
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))Sample response
[
{
"locality": "A F Station Yelahanka",
"office_name": "A F Station Yelahanka S.O",
"pincode": "560063"
},
{
"locality": "Adugodi",
"office_name": "Adugodi S.O",
"pincode": "560030"
},
{
"locality": "Agara",
"office_name": "Agara B.O",
"pincode": "560034"
}
]Try it
Authentication
Send your API key in the X-Api-Key header (or as Authorization: Bearer <key>). Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and, on metered plans, X-Quota-Limit and X-Quota-Remaining.
Errors
Errors return a JSON body of the form {"error": "message"}.
| Status | Meaning |
|---|---|
| 400 | A parameter is missing or invalid. The message says which. |
| 401 | Missing, invalid or revoked API key. |
| 429 | Rate limit or monthly quota exceeded. Honour Retry-After. |
| 5xx | Server error. Safe to retry with backoff. |