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
capital
StringIndicates the capital of the county.
currency
StringIndicates the currency of the county.
currencyCode
StringcurrencySymbol
Stringemoji
StringIndicates the flag emoji of the county.
emojiString
StringIndicates the flag emoji code of the county.
iso2
StringThe two-letter country code corresponding to the country.
iso3
StringThe three-letter country code corresponding to the country.
Shows spellings of country name in different languages.
Country's name.
native
StringIndicates the name of the country in the local language.
phoneCode
StringThe phone code corresponding to the country.
region
StringIndicates the region of the county.
subregion
StringIndicates the subregion of the county.
State
type State {
id: ID!
countryId: String!
locationTranslations: LocationTranslations
name: String!
native: String
stateCode: String
}
Fields
ID indicating which country the state belongs to.
locationTranslations
LocationTranslationsShows spellings of state name in different languages.
State's name.
native
StringIndicates the name of the state in the local language.
stateCode
StringThe 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
cityCode
StringThe two-letter city code corresponding to the city.
ID indicating which country the city belongs to.
latitude
StringIndicates the latitude of the city.
longitude
StringIndicates the longitude of the city.
City's name.
order
FloatSpecifies the order of cities.
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
ID indicating which city the district belongs to.
ID indicating which country the district belongs to.
latitude
StringIndicates the latitude of the city.
longitude
StringIndicates the longitude of the city.
District's name.
order
FloatSpecifies the order of districts.
ID indicating which state the district belongs to.
Town
type Town {
id: ID!
districtId: String!
name: String!
order: Float
}
Fields
ID indicating which district the town belongs to.
Town's name.
order
FloatSpecifies 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.
search
StringupdatedAt
DateFilterInputReturn Type
Country
CountryList States
listState(
countryId: StringFilterInput!
id: StringFilterInput
search: String
updatedAt: DateFilterInput
): [State!]!
Arguments
You can get the filter response by entering the desired condition for the countryId.
search
StringupdatedAt
DateFilterInputReturn Type
State
StateList Cities
listCity(
countryId: StringFilterInput
id: StringFilterInput
search: String
stateId: StringFilterInput!
updatedAt: DateFilterInput
): [City!]!
Arguments
countryId
StringFilterInputYou can get the filter response by entering the desired condition for the countryId.
search
StringYou can get the filter response by entering the desired condition for the stateId.
updatedAt
DateFilterInputReturn Type
City
CityList Districts
listDistrict(
cityId: StringFilterInput!
countryId: StringFilterInput
id: StringFilterInput
search: String
stateId: StringFilterInput
updatedAt: DateFilterInput
): [District!]!
Arguments
You can get the filter response by entering the desired condition for the cityId.
countryId
StringFilterInputYou can get the filter response by entering the desired condition for the countryId.
search
StringstateId
StringFilterInputYou can get the filter response by entering the desired condition for the stateId.
updatedAt
DateFilterInputReturn Type
District
DistrictList Towns
listTown(
districtId: StringFilterInput!
id: StringFilterInput
search: String
updatedAt: DateFilterInput
): [Town!]!
Arguments
You can get the filter response by entering the desired condition for the districtId.
search
StringupdatedAt
DateFilterInputReturn Type
Town
TownExamples
Retrieve a list of countries
- BASH
- NODE.JS
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 } } "}'
const axios = require('axios');
const data = {"query":`{
listCountry {
id
name
locationTranslations {
tr
en
}
iso2
iso3
phoneCode
capital
currency
native
region
subregion
emoji
emojiString
}
}
`};
const config = {
method: 'POST',
url: 'https://api.myikas.com/api/v1/admin/graphql',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
if (error.response) {
console.log(JSON.stringify(error.response.data));
}
});
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
- BASH
- NODE.JS
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 } } "}'
const axios = require('axios');
const data = {"query":`{
listState(countryId: { eq: "country_id" })
{
id
name
stateCode
countryId
}
}
`};
const config = {
method: 'POST',
url: 'https://api.myikas.com/api/v1/admin/graphql',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
if (error.response) {
console.log(JSON.stringify(error.response.data));
}
});
Response
{
"data": {
"listState": [
{
"id": "1efede5d-7ca8-4499-be12-092defb21a0c",
"countryId": "92b5ad7a-a93e-45d3-aae5-c8e58bd65130",
"name": "Franche-Comté",
"stateCode": "I"
}
]
}
}
List Cities
- BASH
- NODE.JS
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 } } "}'
const axios = require('axios');
const data = {"query":`{
listCity(
stateId: { eq: "state_id" })
{
id
countryId
stateId
name
latitude
longitude
}
}
`};
const config = {
method: 'POST',
url: 'https://api.myikas.com/api/v1/admin/graphql',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
if (error.response) {
console.log(JSON.stringify(error.response.data));
}
});
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
- BASH
- NODE.JS
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 } } "}'
const axios = require('axios');
const data = {"query":`{
listDistrict(
cityId: { eq: "city_id" })
{
id
countryId
stateId
cityId
name
order
}
}
`};
const config = {
method: 'POST',
url: 'https://api.myikas.com/api/v1/admin/graphql',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
if (error.response) {
console.log(JSON.stringify(error.response.data));
}
});
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
- BASH
- NODE.JS
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 } } "}'
const axios = require('axios');
const data = {"query":`{
listTown(
districtId: { eq: "district_id" })
{
id
districtId
name
order
}
}
`};
const config = {
method: 'POST',
url: 'https://api.myikas.com/api/v1/admin/graphql',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
if (error.response) {
console.log(JSON.stringify(error.response.data));
}
});
Response
{
"data": {
"listTown": [
{
"id": "14692d78-c5da-4830-975e-44dd54d9df6f",
"districtId": "0774fbd3-b818-463a-b697-2e28a8a6daed",
"name": "ÇAYYOLU",
"order": 1286
}
]
}
}