Skip to main content

Location

By using this API, you can get location information such as country list, state list, city list, discrict list, town list.

Overview

Location API.

Models

Country

type Country {
id: ID!
capital: String
currency: String
currencyCode: String
currencySymbol: String
emoji: String
emojiString: String
iso2: String
iso3: String
locationTranslations: LocationTranslations!
name: String!
native: String
phoneCode: String
region: String
subregion: String
}

Fields

idID!required
capitalString

Indicates the capital of the county.

currencyString

Indicates the currency of the county.

currencyCodeString
currencySymbolString
emojiString

Indicates the flag emoji of the county.

emojiStringString

Indicates the flag emoji code of the county.

iso2String

The two-letter country code corresponding to the country.

iso3String

The three-letter country code corresponding to the country.

locationTranslationsLocationTranslations!required

Shows spellings of country name in different languages.

nameString!required

Country's name.

nativeString

Indicates the name of the country in the local language.

phoneCodeString

The phone code corresponding to the country.

regionString

Indicates the region of the county.

subregionString

Indicates the subregion of the county.

State

type State {
id: ID!
countryId: String!
locationTranslations: LocationTranslations
name: String!
native: String
stateCode: String
}

Fields

idID!required
countryIdString!required

ID indicating which country the state belongs to.

locationTranslationsLocationTranslations

Shows spellings of state name in different languages.

nameString!required

State's name.

nativeString

Indicates the name of the state in the local language.

stateCodeString

The two-letter state code corresponding to the state.

City

type City {
id: ID!
cityCode: String
countryId: String!
latitude: String
longitude: String
name: String!
order: Float
stateId: String!
}

Fields

idID!required
cityCodeString

The two-letter city code corresponding to the city.

countryIdString!required

ID indicating which country the city belongs to.

latitudeString

Indicates the latitude of the city.

longitudeString

Indicates the longitude of the city.

nameString!required

City's name.

orderFloat

Specifies the order of cities.

stateIdString!required

ID indicating which state the city belongs to.

District

type District {
id: ID!
cityId: String!
countryId: String!
latitude: String
longitude: String
name: String!
order: Float
stateId: String!
}

Fields

idID!required
cityIdString!required

ID indicating which city the district belongs to.

countryIdString!required

ID indicating which country the district belongs to.

latitudeString

Indicates the latitude of the city.

longitudeString

Indicates the longitude of the city.

nameString!required

District's name.

orderFloat

Specifies the order of districts.

stateIdString!required

ID indicating which state the district belongs to.

Town

type Town {
id: ID!
districtId: String!
name: String!
order: Float
}

Fields

idID!required
districtIdString!required

ID indicating which district the town belongs to.

nameString!required

Town's name.

orderFloat

Specifies the order of towns.

Queries

List Countries

listCountry(
id: StringFilterInput
iso2: StringFilterInput
iso3: StringFilterInput
search: String
updatedAt: DateFilterInput
): [Country!]!

Arguments

You can get the filter response by entering the desired condition for the iso2.

You can get the filter response by entering the desired condition for the iso3.

searchString

Return Type

CountryCountry

List States

listState(
countryId: StringFilterInput!
id: StringFilterInput
search: String
updatedAt: DateFilterInput
): [State!]!

Arguments

countryIdStringFilterInput!required

You can get the filter response by entering the desired condition for the countryId.

searchString

Return Type

StateState

List Cities

listCity(
countryId: StringFilterInput
id: StringFilterInput
search: String
stateId: StringFilterInput!
updatedAt: DateFilterInput
): [City!]!

Arguments

You can get the filter response by entering the desired condition for the countryId.

searchString
stateIdStringFilterInput!required

You can get the filter response by entering the desired condition for the stateId.

Return Type

CityCity

List Districts

listDistrict(
cityId: StringFilterInput!
countryId: StringFilterInput
id: StringFilterInput
search: String
stateId: StringFilterInput
updatedAt: DateFilterInput
): [District!]!

Arguments

cityIdStringFilterInput!required

You can get the filter response by entering the desired condition for the cityId.

You can get the filter response by entering the desired condition for the countryId.

searchString

You can get the filter response by entering the desired condition for the stateId.

Return Type

DistrictDistrict

List Towns

listTown(
districtId: StringFilterInput!
id: StringFilterInput
search: String
updatedAt: DateFilterInput
): [Town!]!

Arguments

districtIdStringFilterInput!required

You can get the filter response by entering the desired condition for the districtId.

searchString

Return Type

TownTown

Examples

Retrieve a list of countries

curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw '{"query":"{ listCountry { id name locationTranslations { tr en } iso2 iso3 phoneCode capital currency native region subregion emoji emojiString } } "}'

Response

{
"data": {
"listCountry": [
{
"id": "92b5ad7a-a93e-45d3-aae5-c8e58bd65130",
"name": "France",
"locationTranslations": {
"tr": "Fransa",
"en": "France"
},
"iso2": "FR",
"iso3": "FRA",
"phoneCode": "33",
"capital": "Paris",
"currency": "EUR",
"native": "France",
"region": "Europe",
"subregion": "Western Europe",
"emoji": "🇫🇷",
"emojiString": "U+1F1EB U+1F1F7"
}
]
}
}

List States

curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw '{"query":"{ listState(countryId: { eq: \"country_id\" }) { id name stateCode countryId } } "}'

Response

{
"data": {
"listState": [
{
"id": "1efede5d-7ca8-4499-be12-092defb21a0c",
"countryId": "92b5ad7a-a93e-45d3-aae5-c8e58bd65130",
"name": "Franche-Comté",
"stateCode": "I"
}
]
}
}

List Cities

curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw '{"query":"{ listCity( stateId: { eq: \"state_id\" }) { id countryId stateId name latitude longitude } } "}'

Response

{
"data": {
"listCity": [
{
"id": "b23c0e54-aef2-4357-b690-75c90fd44792",
"countryId": "92b5ad7a-a93e-45d3-aae5-c8e58bd65130",
"stateId": "eda394b7-9aa8-49c9-9c26-dba5a0838fa5",
"name": "Paris",
"latitude": "48.85340000",
"longitude": "2.34860000"
}
]
}
}

List Districts

curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw '{"query":"{ listDistrict( cityId: { eq: \"city_id\" }) { id countryId stateId cityId name order } } "}'

Response

{
"data": {
"listDistrict": [
{
"id": "0774fbd3-b818-463a-b697-2e28a8a6daed",
"countryId": "da8c5f2a-8d37-48a8-beff-6ab3793a1861",
"stateId": "dcb9135c-4b84-4c06-9a42-f359317a9b78",
"cityId": "6f9272a3-9924-4223-baf8-9b21c9360f0c",
"name": "ÇANKAYA",
"order": 46
}
]
}
}

List Towns

curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw '{"query":"{ listTown( districtId: { eq: \"district_id\" }) { id districtId name order } } "}'

Response

{
"data": {
"listTown": [
{
"id": "14692d78-c5da-4830-975e-44dd54d9df6f",
"districtId": "0774fbd3-b818-463a-b697-2e28a8a6daed",
"name": "ÇAYYOLU",
"order": 1286
}
]
}
}