India PIN Code Autocomplete API

Autocomplete Indian PIN Codes as users type

Send the first digits, get matching PIN Codes with their city and state, as 400001, Mumbai, Maharashtra, or with each post office area. One REST call for any PIN Code field.

✓ 10,000 requests/month free ✓ No credit card ✓ Cancel anytime
Try it · live
- ms 0 used today 500 left today
One request, one list

What comes back

PIN Codes that start with the digits sent, each with its city and state, and with the post office area in formats 2 and 3.

Format 0 · PIN, City, State · “4000”
"400001, Mumbai, Maharashtra"
"400002, Mumbai, Maharashtra"
"400003, Mumbai, Maharashtra"
"400004, Mumbai, Maharashtra"
"400005, Mumbai, Maharashtra"
Format 2 · PIN, Area, City, State · “4000”
"400001, Bazargate, Mumbai, Maharashtra"
"400001, Mpt, Mumbai, Maharashtra"
"400001, Mumbai Gpo, Mumbai, Maharashtra"
"400001, Mumbai, Mumbai G.P.O., Mumbai, Maharashtra"
Built for forms

What you get

A valid PIN Code with its city and state, picked from a list instead of typed by hand.

Four formats

with or without the post office area, with the full state name or the state code.

Post office areas

formats 2 and 3 list each area under a PIN Code, such as Bazargate and Mumbai Gpo for 400001.

From the first digits

suggestions start with two digits and narrow as the user types.

One plan, three lookups

the India plan covers City, Locality and PIN Code autocomplete.
Where teams use it

Common use cases

Delivery and checkout formsFill PIN Code, city and state in one pick.
Serviceability checksCheck a PIN Code before promising delivery.
Regional filtersFilter orders or listings by PIN Code.
Clean data at entryStore valid PIN Codes from the start.
Copy, paste, ship

Two calls, any language

Get a token, then send what the user typed. Every example is a complete program, tested against the live API.

# Step 1: Get your auth token (uses jq to read Result.access_token)
TOKEN=$(curl -s "https://api.sthan.io/Auth/Token" \
  -H "profileName: YOUR_PROFILE_NAME" \
  -H "profilePassword: YOUR_PROFILE_PASSWORD" | jq -r '.Result.access_token')

# Step 2: Make the API call
curl -s "https://api.sthan.io/AutoComplete/Ind/PinCode/DisplayType/0/4000" \
  -H "Authorization: Bearer $TOKEN"
// Node.js 18+ (save as example.mjs, run: node example.mjs)
// Step 1: Get your auth token
const auth = await fetch("https://api.sthan.io/Auth/Token", {
  headers: { profileName: "YOUR_PROFILE_NAME", profilePassword: "YOUR_PROFILE_PASSWORD" }
});
if (!auth.ok) throw new Error(`Auth failed: ${auth.status}`);
const { access_token } = (await auth.json()).Result;

// Step 2: Make the API call
const response = await fetch("https://api.sthan.io/AutoComplete/Ind/PinCode/DisplayType/0/4000", {
  headers: { Authorization: `Bearer ${access_token}` }
});
console.log(await response.json());
import requests

# Step 1: Get your auth token
auth = requests.get(
    "https://api.sthan.io/Auth/Token",
    headers={"profileName": "YOUR_PROFILE_NAME", "profilePassword": "YOUR_PROFILE_PASSWORD"},
    timeout=10,
)
auth.raise_for_status()
token = auth.json()["Result"]["access_token"]

# Step 2: Make the API call
response = requests.get("https://api.sthan.io/AutoComplete/Ind/PinCode/DisplayType/0/4000", headers={"Authorization": f"Bearer {token}"}, timeout=10)
response.raise_for_status()
print(response.json())
// .NET 6+ console app (Program.cs)
using System.Net.Http.Headers;
using System.Text.Json;

using var client = new HttpClient();

// Step 1: Get your auth token
var authRequest = new HttpRequestMessage(HttpMethod.Get, "https://api.sthan.io/Auth/Token");
authRequest.Headers.Add("profileName", "YOUR_PROFILE_NAME");
authRequest.Headers.Add("profilePassword", "YOUR_PROFILE_PASSWORD");
using var authResponse = await client.SendAsync(authRequest);
authResponse.EnsureSuccessStatusCode();
using var authJson = JsonDocument.Parse(await authResponse.Content.ReadAsStringAsync());
var token = authJson.RootElement.GetProperty("Result").GetProperty("access_token").GetString();

// Step 2: Make the API call
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var response = await client.GetStringAsync("https://api.sthan.io/AutoComplete/Ind/PinCode/DisplayType/0/4000");
Console.WriteLine(response);
// Java 11+, no extra libraries. Save as Example.java, run: java Example.java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();

        // Step 1: Get your auth token
        HttpRequest authRequest = HttpRequest.newBuilder(URI.create("https://api.sthan.io/Auth/Token"))
            .header("profileName", "YOUR_PROFILE_NAME")
            .header("profilePassword", "YOUR_PROFILE_PASSWORD")
            .build();
        String authBody = client.send(authRequest, HttpResponse.BodyHandlers.ofString()).body();
        // The token is at Result.access_token (read it with your JSON library, or like this)
        Matcher m = Pattern.compile("\"access_token\"\\s*:\\s*\"([^\"]+)\"").matcher(authBody);
        if (!m.find()) throw new IllegalStateException("No token in: " + authBody);
        String token = m.group(1);

        // Step 2: Make the API call
        HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.sthan.io/AutoComplete/Ind/PinCode/DisplayType/0/4000"))
            .header("Authorization", "Bearer " + token)
            .build();
        System.out.println(client.send(request, HttpResponse.BodyHandlers.ofString()).body());
    }
}
<?php
// PHP 7.4+ with the curl extension

// Step 1: Get your auth token
$ch = curl_init("https://api.sthan.io/Auth/Token");
curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER => ["profileName: YOUR_PROFILE_NAME", "profilePassword: YOUR_PROFILE_PASSWORD"],
    CURLOPT_RETURNTRANSFER => true,
]);
$auth = json_decode(curl_exec($ch), true);
$token = $auth["Result"]["access_token"];

// Step 2: Make the API call
$ch = curl_init("https://api.sthan.io/AutoComplete/Ind/PinCode/DisplayType/0/4000");
curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER => ["Authorization: Bearer " . $token],
    CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch), PHP_EOL;
require "net/http"
require "json"

# Step 1: Get your auth token
uri = URI("https://api.sthan.io/Auth/Token")
req = Net::HTTP::Get.new(uri)
req["profileName"] = "YOUR_PROFILE_NAME"
req["profilePassword"] = "YOUR_PROFILE_PASSWORD"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
token = JSON.parse(res.body)["Result"]["access_token"]

# Step 2: Make the API call
uri = URI("https://api.sthan.io/AutoComplete/Ind/PinCode/DisplayType/0/4000")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{token}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts JSON.parse(res.body)
package main

import (
	"encoding/json"
	"fmt"
	"io"
	"net/http"
)

func main() {
	// Step 1: Get your auth token
	authReq, _ := http.NewRequest("GET", "https://api.sthan.io/Auth/Token", nil)
	authReq.Header.Set("profileName", "YOUR_PROFILE_NAME")
	authReq.Header.Set("profilePassword", "YOUR_PROFILE_PASSWORD")
	authResp, err := http.DefaultClient.Do(authReq)
	if err != nil {
		panic(err)
	}
	defer authResp.Body.Close()
	var auth struct {
		Result struct {
			AccessToken string `json:"access_token"`
		}
	}
	if err := json.NewDecoder(authResp.Body).Decode(&auth); err != nil {
		panic(err)
	}

	// Step 2: Make the API call
	req, _ := http.NewRequest("GET", "https://api.sthan.io/AutoComplete/Ind/PinCode/DisplayType/0/4000", nil)
	req.Header.Set("Authorization", "Bearer "+auth.Result.AccessToken)
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }
//             tokio = { version = "1", features = ["full"] }, serde_json = "1"
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();

    // Step 1: Get your auth token
    let auth: serde_json::Value = client
        .get("https://api.sthan.io/Auth/Token")
        .header("profileName", "YOUR_PROFILE_NAME")
        .header("profilePassword", "YOUR_PROFILE_PASSWORD")
        .send()
        .await?
        .error_for_status()?
        .json()
        .await?;
    let token = auth["Result"]["access_token"].as_str().ok_or("no token in response")?;

    // Step 2: Make the API call
    let body = client
        .get("https://api.sthan.io/AutoComplete/Ind/PinCode/DisplayType/0/4000")
        .bearer_auth(token)
        .send()
        .await?
        .text()
        .await?;
    println!("{body}");
    Ok(())
}
// Kotlin (JVM 11+), no extra libraries
import java.net.URI
import java.net.http.HttpClient
import java.net.http.HttpRequest
import java.net.http.HttpResponse

fun main() {
    val client = HttpClient.newHttpClient()

    // Step 1: Get your auth token
    val authRequest = HttpRequest.newBuilder(URI.create("https://api.sthan.io/Auth/Token"))
        .header("profileName", "YOUR_PROFILE_NAME")
        .header("profilePassword", "YOUR_PROFILE_PASSWORD")
        .build()
    val authBody = client.send(authRequest, HttpResponse.BodyHandlers.ofString()).body()
    // The token is at Result.access_token (read it with your JSON library, or like this)
    val token = Regex("\"access_token\"\\s*:\\s*\"([^\"]+)\"").find(authBody)?.groupValues?.get(1)
        ?: error("No token in: $authBody")

    // Step 2: Make the API call
    val request = HttpRequest.newBuilder(URI.create("https://api.sthan.io/AutoComplete/Ind/PinCode/DisplayType/0/4000"))
        .header("Authorization", "Bearer $token")
        .build()
    println(client.send(request, HttpResponse.BodyHandlers.ofString()).body())
}
# Run as a script: elixir example.exs
# (in a Mix project, add {:req, "~> 0.5"} to deps and drop the next line)
Mix.install([{:req, "~> 0.5"}])

# Step 1: Get your auth token
auth =
  Req.get!("https://api.sthan.io/Auth/Token",
    headers: [{"profileName", "YOUR_PROFILE_NAME"}, {"profilePassword", "YOUR_PROFILE_PASSWORD"}]
  )

token = auth.body["Result"]["access_token"]

# Step 2: Make the API call
response = Req.get!("https://api.sthan.io/AutoComplete/Ind/PinCode/DisplayType/0/4000", auth: {:bearer, token})
IO.inspect(response.body)
Response
{
  "Result": [
    "400001, Mumbai, Maharashtra",
    "400002, Mumbai, Maharashtra",
    "400003, Mumbai, Maharashtra",
    "400004, Mumbai, Maharashtra",
    "400005, Mumbai, Maharashtra"
  ],
  "StatusCode": 200,
  "IsError": false
}

Full reference in the docs

Simple pricing

Start free, scale when you need to

10,000 free requests a month (up to 1,000 a day), no credit card. Paid plans start at $2 a month for 50,000 requests.

Start here
Free
$0
10,000 requests / month
No credit card
Basic
$2 /mo
50,000 requests
Starter
$7 /mo
200,000 requests

One India plan covers City, Locality and PIN Code autocomplete. Free tier limits: 120 a minute, 500 an hour, 1,000 a day. Higher volumes and annual discounts on the plans page.

Good to know

Questions developers ask

PIN Codes that start with the digits you send, each with its city and state, in the format you choose.
Format 0 returns 400001, Mumbai, Maharashtra; 1 uses the state code (MH); 2 and 3 add the post office area (400001, Bazargate, Mumbai, Maharashtra). Put the number in the URL: /AutoComplete/Ind/PinCode/DisplayType/0/4000.
Yes. The India plan covers all three autocomplete APIs.
10,000 requests a month with no credit card, up to 120 a minute, 500 an hour and 1,000 a day.

Add PIN Code autocomplete in two minutes

Sign up, copy your key, make the call. 10,000 requests a month, free.

Get your free API key