query

locality

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
Required
Enter if locality is 'pincode' or 'sector'.
localityValue
String!
Required
Name of the locality.
city
String
Name of the city.
country
String
Name of the country.
state
String
State or the province.
Response
display_name
String
User-friendly version of the geographical data, which may be more descriptive or formatted differently.
A unique identifier for the locality.
name
String
The 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
String
Specifies the category of the address component, such as pincode, state, city, country, or sector.
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
JSON
Custom meta to store custom json against hierarchy.
parent_uid
String
Unique Identifiers for the parent of the current locality.
meta
JSON
Specifies the meta information for the current locality.
code
String
Specifies the code for the locality.
Query
1query locality(
2 $locality: LocalityEnum!
3 $localityValue: String!
4 $city: String
5 $country: String
6 $state: String
7) {
8 locality(
9 locality: $locality
10 localityValue: $localityValue
11 city: $city
12 country: $country
13 state: $state
14 ) {
15 display_name
16 id
17 name
18 parent_ids
19 type
20 localities {
21 id
22 name
23 display_name
24 parent_ids
25 type
26 custom_meta
27 }
28 custom_meta
29 parent_uid
30 meta
31 code
32 }
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}