{
	"info": {
		"_postman_id": "sthan-io-api-collection",
		"name": "Sthan.io API",
		"description": "Address and location data APIs for developers.\n\nIncludes address autocomplete, parsing, verification, geocoding, reverse geocoding (USA), address autocomplete (India), and IP geolocation (global).\n\n## Getting Started\n\n1. Set the `profileName` and `profilePassword` variables in the collection (or environment)\n2. Run the **Get Auth Token** request first\n3. The token is automatically saved and used by all other requests\n\nFull docs: https://sthan.io/docs",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"auth": {
		"type": "bearer",
		"bearer": [
			{
				"key": "token",
				"value": "{{access_token}}",
				"type": "string"
			}
		]
	},
	"variable": [
		{
			"key": "baseUrl",
			"value": "https://api.sthan.io",
			"type": "string"
		},
		{
			"key": "profileName",
			"value": "YOUR_PROFILE_NAME",
			"type": "string"
		},
		{
			"key": "profilePassword",
			"value": "YOUR_PROFILE_PASSWORD",
			"type": "string"
		},
		{
			"key": "access_token",
			"value": "",
			"type": "string"
		}
	],
	"item": [
		{
			"name": "Auth",
			"description": "Authenticate and obtain JWT tokens for API access. Run this first — the token is automatically saved for all other requests.",
			"item": [
				{
					"name": "Get Auth Token",
					"event": [
						{
							"listen": "test",
							"script": {
								"type": "text/javascript",
								"exec": [
									"if (pm.response.code === 200) {",
									"    var json = pm.response.json();",
									"    if (json.Result && json.Result.access_token) {",
									"        pm.collectionVariables.set('access_token', json.Result.access_token);",
									"        console.log('Token saved. Expires: ' + json.Result.expiration);",
									"    } else if (json.access_token) {",
									"        pm.collectionVariables.set('access_token', json.access_token);",
									"        console.log('Token saved. Expires: ' + json.expiration);",
									"    }",
									"}"
								]
							}
						}
					],
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "GET",
						"header": [
							{
								"key": "profileName",
								"value": "{{profileName}}",
								"description": "Your profile name (GUID issued at signup)"
							},
							{
								"key": "profilePassword",
								"value": "{{profilePassword}}",
								"description": "Your profile password"
							}
						],
						"url": {
							"raw": "{{baseUrl}}/Auth/Token",
							"host": ["{{baseUrl}}"],
							"path": ["Auth", "Token"]
						},
						"description": "Obtain a JWT Bearer token. The token is automatically saved to the `access_token` collection variable and used by all other requests.\n\nTokens expire after 60 minutes."
					},
					"response": [
						{
							"name": "Success",
							"status": "OK",
							"code": 200,
							"body": "{\n  \"Id\": \"a1b2c3d4-...\",\n  \"Result\": {\n    \"access_token\": \"eyJhbGciOi...\",\n    \"expiration\": \"2026-03-10T15:30:00\"\n  },\n  \"StatusCode\": 200,\n  \"IsError\": false,\n  \"Errors\": []\n}"
						}
					]
				}
			]
		},
		{
			"name": "Address Autocomplete (USA)",
			"description": "Real-time address, city, and ZIP code autocomplete for USA.",
			"item": [
				{
					"name": "Address Autocomplete",
					"request": {
						"method": "GET",
						"url": {
							"raw": "{{baseUrl}}/AutoComplete/USA/Address/123 main st",
							"host": ["{{baseUrl}}"],
							"path": ["AutoComplete", "USA", "Address", "123 main st"]
						},
						"description": "Get address autocomplete suggestions for a partial US address.\n\nReturns a list of matching full addresses."
					},
					"response": [
						{
							"name": "Success",
							"status": "OK",
							"code": 200,
							"body": "{\n  \"Id\": \"a1b2c3d4-...\",\n  \"Result\": [\n    \"123 Main St, Springfield, IL 62701\",\n    \"123 Main St, Anytown, CA 90210\"\n  ],\n  \"StatusCode\": 200,\n  \"IsError\": false\n}"
						}
					]
				},
				{
					"name": "City Autocomplete",
					"request": {
						"method": "GET",
						"url": {
							"raw": "{{baseUrl}}/AutoComplete/USA/City/DisplayType/0/spring",
							"host": ["{{baseUrl}}"],
							"path": ["AutoComplete", "USA", "City", "DisplayType", "0", "spring"]
						},
						"description": "Get city autocomplete suggestions.\n\n**Display types:**\n- `0` — City, StateCode (e.g., Springfield, IL)\n- `1` — City, State (e.g., Springfield, Illinois)"
					}
				},
				{
					"name": "ZIP Code Autocomplete",
					"request": {
						"method": "GET",
						"url": {
							"raw": "{{baseUrl}}/AutoComplete/USA/ZipCode/DisplayType/0/9021",
							"host": ["{{baseUrl}}"],
							"path": ["AutoComplete", "USA", "ZipCode", "DisplayType", "0", "9021"]
						},
						"description": "Get ZIP code autocomplete suggestions.\n\n**Display types:**\n- `0` — ZipCode, City, StateCode\n- `1` — ZipCode, City, State\n- `2` — ZipCode-Zip4, City, StateCode\n- `3` — ZipCode-Zip4, City, State"
					}
				}
			]
		},
		{
			"name": "Address Parser (USA)",
			"description": "Parse freeform US addresses into structured components (street number, street name, city, state, ZIP, etc.).",
			"item": [
				{
					"name": "Parse Address",
					"request": {
						"method": "GET",
						"url": {
							"raw": "{{baseUrl}}/AddressParser/USA/Single/1600 Pennsylvania Ave NW Washington DC 20500",
							"host": ["{{baseUrl}}"],
							"path": ["AddressParser", "USA", "Single", "1600 Pennsylvania Ave NW Washington DC 20500"]
						},
						"description": "Parse a freeform US address into structured components.\n\nReturns street number, street name, city, state, ZIP code, county, and more."
					},
					"response": [
						{
							"name": "Success",
							"status": "OK",
							"code": 200,
							"body": "{\n  \"Id\": \"a1b2c3d4-...\",\n  \"Result\": {\n    \"InputAddress\": \"1600 Pennsylvania Ave NW Washington DC 20500\",\n    \"FullAddress\": \"1600 Pennsylvania Ave NW, Washington, DC 20500\",\n    \"AddressLine1\": \"1600 Pennsylvania Ave NW\",\n    \"AddressNumber\": \"1600\",\n    \"StreetName\": \"Pennsylvania\",\n    \"StreetPostType\": \"Ave\",\n    \"StreetPostDir\": \"NW\",\n    \"City\": \"Washington\",\n    \"StateCode\": \"DC\",\n    \"State\": \"District Of Columbia\",\n    \"ZipCode\": \"20500\",\n    \"County\": \"District Of Columbia\",\n    \"Confidence\": 95,\n    \"AlgorithmUsed\": \"LibPostal+ES+Census\",\n    \"IsError\": false\n  },\n  \"StatusCode\": 200,\n  \"IsError\": false\n}"
						}
					]
				}
			]
		},
		{
			"name": "Address Verification (USA)",
			"description": "Verify US address deliverability with USPS DPV (Delivery Point Validation) confirmation.",
			"item": [
				{
					"name": "Verify Address",
					"request": {
						"method": "GET",
						"url": {
							"raw": "{{baseUrl}}/AddressVerification/Usa/Single/1600 Pennsylvania Ave NW Washington DC 20500",
							"host": ["{{baseUrl}}"],
							"path": ["AddressVerification", "Usa", "Single", "1600 Pennsylvania Ave NW Washington DC 20500"]
						},
						"description": "Verify a US address for deliverability.\n\nReturns USPS-standardized address, DPV confirmation code, carrier route, and delivery point data."
					},
					"response": [
						{
							"name": "Success",
							"status": "OK",
							"code": 200,
							"body": "{\n  \"Id\": \"a1b2c3d4-...\",\n  \"Result\": {\n    \"InputAddress\": \"1600 Pennsylvania Ave NW Washington DC 20500\",\n    \"FullAddress\": \"1600 Pennsylvania Ave NW, Washington, DC 20500-0005\",\n    \"AddressLine1\": \"1600 Pennsylvania Ave NW\",\n    \"City\": \"Washington\",\n    \"StateCode\": \"DC\",\n    \"ZipCode\": \"20500\",\n    \"Zip4\": \"0005\",\n    \"County\": \"District Of Columbia\",\n    \"DpvConfirmation\": \"Y\",\n    \"CarrierRoute\": \"C000\",\n    \"RecordType\": \"H\",\n    \"IsPostalVerified\": true,\n    \"IsError\": false\n  },\n  \"StatusCode\": 200,\n  \"IsError\": false\n}"
						}
					]
				}
			]
		},
		{
			"name": "Geocoding (USA)",
			"description": "Forward and reverse geocoding for USA addresses.",
			"item": [
				{
					"name": "Forward Geocode",
					"request": {
						"method": "GET",
						"url": {
							"raw": "{{baseUrl}}/Geocoding/USA/Forward/1600 Pennsylvania Ave NW Washington DC 20500",
							"host": ["{{baseUrl}}"],
							"path": ["Geocoding", "USA", "Forward", "1600 Pennsylvania Ave NW Washington DC 20500"]
						},
						"description": "Geocode a US address to latitude/longitude coordinates.\n\nReturns coordinates, confidence score, source, and address components."
					},
					"response": [
						{
							"name": "Success",
							"status": "OK",
							"code": 200,
							"body": "{\n  \"Id\": \"a1b2c3d4-...\",\n  \"Result\": {\n    \"InputAddress\": \"1600 Pennsylvania Ave NW Washington DC 20500\",\n    \"FormattedAddress\": \"1600 Pennsylvania Ave NW, Washington, DC 20500\",\n    \"Latitude\": 38.8977,\n    \"Longitude\": -77.0365,\n    \"Source\": \"Census\",\n    \"Confidence\": 95\n  },\n  \"StatusCode\": 200,\n  \"IsError\": false\n}"
						}
					]
				},
				{
					"name": "Reverse Geocode",
					"request": {
						"method": "GET",
						"url": {
							"raw": "{{baseUrl}}/Geocoding/USA/Reverse/38.8977/-77.0365",
							"host": ["{{baseUrl}}"],
							"path": ["Geocoding", "USA", "Reverse", "38.8977", "-77.0365"]
						},
						"description": "Reverse geocode coordinates to a US address.\n\n**Parameters:**\n- `lat` — Latitude (-90 to 90)\n- `lon` — Longitude (-180 to 180)"
					},
					"response": [
						{
							"name": "Success",
							"status": "OK",
							"code": 200,
							"body": "{\n  \"Id\": \"a1b2c3d4-...\",\n  \"Result\": {\n    \"Latitude\": 38.8977,\n    \"Longitude\": -77.0365,\n    \"Address\": \"1600 Pennsylvania Ave NW, Washington, DC 20500\",\n    \"DistanceMeters\": 12.5,\n    \"Source\": \"Census\"\n  },\n  \"StatusCode\": 200,\n  \"IsError\": false\n}"
						}
					]
				}
			]
		},
		{
			"name": "IP Geolocation (Global)",
			"description": "Lookup geolocation data (country, region, city, coordinates, timezone) from IP addresses. Supports both IPv4 and IPv6.",
			"item": [
				{
					"name": "IP Geolocation Lookup",
					"request": {
						"method": "GET",
						"url": {
							"raw": "{{baseUrl}}/IpGeolocation/8.8.8.8",
							"host": ["{{baseUrl}}"],
							"path": ["IpGeolocation", "8.8.8.8"]
						},
						"description": "Lookup geolocation data for an IP address.\n\nSupports both IPv4 (e.g., `8.8.8.8`) and IPv6 (e.g., `2001:4860:4860::8888`).\n\nReturns country, region, city, coordinates, timezone, and postal code."
					},
					"response": [
						{
							"name": "Success",
							"status": "OK",
							"code": 200,
							"body": "{\n  \"Id\": \"a1b2c3d4-...\",\n  \"Result\": {\n    \"IpAddress\": \"8.8.8.8\",\n    \"Country\": \"United States\",\n    \"CountryCode\": \"US\",\n    \"Region\": \"California\",\n    \"City\": \"Mountain View\",\n    \"Latitude\": 37.386,\n    \"Longitude\": -122.0838,\n    \"Continent\": \"North America\",\n    \"Timezone\": \"America/Los_Angeles\",\n    \"PostalCode\": \"94035\"\n  },\n  \"StatusCode\": 200,\n  \"IsError\": false\n}"
						}
					]
				}
			]
		},
		{
			"name": "Address Autocomplete (India)",
			"description": "Real-time city, locality, and PIN code autocomplete for India.",
			"item": [
				{
					"name": "City Autocomplete",
					"request": {
						"method": "GET",
						"url": {
							"raw": "{{baseUrl}}/AutoComplete/Ind/City/DisplayType/0/mumbai",
							"host": ["{{baseUrl}}"],
							"path": ["AutoComplete", "Ind", "City", "DisplayType", "0", "mumbai"]
						},
						"description": "Get Indian city autocomplete suggestions.\n\n**Display types:**\n- `0` — City, State\n- `1` — City, State (full name)"
					}
				},
				{
					"name": "Locality Autocomplete",
					"request": {
						"method": "GET",
						"url": {
							"raw": "{{baseUrl}}/AutoComplete/Ind/Locality/DisplayType/0/bandra",
							"host": ["{{baseUrl}}"],
							"path": ["AutoComplete", "Ind", "Locality", "DisplayType", "0", "bandra"]
						},
						"description": "Get Indian locality autocomplete suggestions."
					}
				},
				{
					"name": "PIN Code Autocomplete",
					"request": {
						"method": "GET",
						"url": {
							"raw": "{{baseUrl}}/AutoComplete/Ind/PinCode/DisplayType/0/400050",
							"host": ["{{baseUrl}}"],
							"path": ["AutoComplete", "Ind", "PinCode", "DisplayType", "0", "400050"]
						},
						"description": "Get Indian PIN code autocomplete suggestions.\n\n**Display types:**\n- `0` — PinCode, City, State\n- `1` — PinCode, City, State (full name)\n- `2` — PinCode, Locality, City, State\n- `3` — PinCode, Locality, City, State (full name)"
					}
				}
			]
		}
	]
}
