📍 My DIGIPIN API

A tool that makes it super easy to switch between GPS coordinates and India's smart location code, DIGIPIN.

What Exactly is a DIGIPIN?

DIGIPIN is a smart location-encoding system from India Post that converts long, complex GPS coordinates into a short, easy-to-share 10-digit code.

Instead of using confusing numbers like 12.9796° N, 77.5907° E, you can use a simple code like 4P3-JK8-52C9 to represent the exact same spot.

It works by dividing a map of India into smaller and smaller grids, with each step adding a new character to the code. This makes it highly accurate, simple to remember, and perfect for sharing locations or improving delivery accuracy across India.

How to Use This API

This API gives you two special links to do the conversion for you, instantly. You just need to add your information to the end of the link.

1. Turn Coordinates into a DIGIPIN (Encode)

Give it a latitude and longitude, and it gives you back the DIGIPIN.

GET /api/en

Information to add to the link:

Example Link:

https://api.digipin.my/api/en?latitude=12.9716&longitude=77.5946

What you get back (Success):

{
  "digipin": "4P3-JK8-52C9"
}

2. Turn a DIGIPIN into Coordinates (Decode)

Give it a DIGIPIN, and it tells you the GPS coordinates for the center of that location's grid.

GET /api/de

Information to add to the link:

Example Link:

https://api.digipin.my/api/de?digipin=4P3-JK8-52C9

What you get back (Success):

{
  "latitude": 12.971597,
  "longitude": 77.594601
}

Frequently Asked Questions (FAQ)

1. Who created DIGIPIN?

DIGIPIN was developed by the Department of Posts, Government of India, as a modern solution for location identification.

2. Why not just use the 6-digit Pincodes?

A Pincode covers a very large area, like an entire neighborhood or several villages. A DIGIPIN is much more precise and can point to a specific building or even its entrance, an area of about 3.2m x 3.2m.

3. Is DIGIPIN an official address?

Not yet. It's a location identifier, not a replacement for your full mailing address. Think of it as a very accurate add-on to your address that helps delivery agents find you faster.

4. Does it work everywhere in India?

This version of DIGIPIN is designed to cover the Indian mainland. It works for latitudes between 2.5° and 38.5°, and longitudes between 63.5° and 99.5°.

5. Do I need internet to use a DIGIPIN?

You need the internet to convert coordinates to a DIGIPIN or vice-versa (using an app or this API). However, once you have the DIGIPIN, you can share it offline via SMS or just by writing it down.

6. Are the dashes (-) in the DIGIPIN important?

For this API, no! You can use 4P3-JK8-52C9 or 4P3JK852C9. Both will work just fine.

7. Is '4p3-jk8-52c9' the same as '4P3-JK8-52C9'?

Yes, the code is case-insensitive. It doesn't matter if you use small letters or capital letters.

8. How accurate is a DIGIPIN?

It's very accurate! A full 10-character DIGIPIN points to a square area of approximately 3.2 meters by 3.2 meters.

9. Why do they use those specific letters and numbers?

The characters in the grid (like F, C, 9, 8) were likely chosen to be easily distinguishable to avoid confusion. For example, the number '0' and the letter 'O' are not used together.

10. Can I use this API for my school project?

Absolutely! This API is free and open for anyone to use. It's a great tool for projects related to geography, computers, or logistics. Have fun building!