Get detailed geographical data for a specific locality, such as a pincode. For example, for a pincode value of 400603, the service returns its parent locations, including city, state, and country details.
Arguments
locality
LocalityEnum!Required
Enter if locality is 'pincode' or 'sector'.
localityValue
String!Required
Name of the locality.
city
StringName of the city.
country
StringName of the country.
state
StringState or the province.
Response
display_name
StringUser-friendly version of the geographical data, which may be more descriptive or formatted differently.
id
StringA unique identifier for the locality.
name
StringThe actual geographical data, such as country names (India), state names (Maharashtra), pin codes (400603), city names (Dubai), or local sectors (Deira).
parent_ids
[String]Identifiers for the parent of the current locality.
type
StringSpecifies the category of the address component, such as pincode, state, city, country, or sector.
localities
[LocalityParent]Representing the localities that are associated with or contained within the current locality.It provides detailed information about the parent localities, including their names, identifiers, and hierarchical relationships.
custom_meta
JSONCustom meta to store custom json against hierarchy.
parent_uid
StringUnique Identifiers for the parent of the current locality.
meta
JSONSpecifies the meta information for the current locality.
code
StringSpecifies the code for the locality.
Query
1query locality(2 $locality: LocalityEnum!3 $localityValue: String!4 $city: String5 $country: String6 $state: String7) {8 locality(9 locality: $locality10 localityValue: $localityValue11 city: $city12 country: $country13 state: $state14 ) {15 display_name16 id17 name18 parent_ids19 type20 localities {21 id22 name23 display_name24 parent_ids25 type26 custom_meta27 }28 custom_meta29 parent_uid30 meta31 code32 }33}
Try it
Input Variables
1{2 "locality": "pincode",3 "localityValue": "localityValue",4 "city": "Montreal",5 "country": "Canada",6 "state": "Quebec"7}
Response
1{2 "locality": {3 "display_name": "display_name",4 "id": "08a16b83-9094-4e89-8c05-2ccadd5c1c7e",5 "name": "A name",6 "parent_ids": [7 "parent_ids"8 ],9 "type": "type",10 "localities": [11 {12 "id": "08a16b83-9094-4e89-8c05-2ccadd5c1c7e",13 "name": "A name",14 "display_name": "display_name",15 "parent_ids": [16 "parent_ids"17 ],18 "type": "type",19 "custom_meta": {}20 }21 ],22 "custom_meta": {},23 "parent_uid": "parent_uid",24 "meta": {},25 "code": "code"26 }27}
Was this section helpful?