List all Cities belongs to Country
Use this endpoint to effortlessly retrieve a comprehensive list of cities which is belongs to the country using country ISO2 string.
Required Parameter
-
ciso2
- string
-
Country iso2 string.
Optional query param
-
isPaginate
- boolean
-
Return you the paginated result
-
limit
- integer
-
Limit the countries returned
-
page
- integer
-
Return the contents of that page after pagination
Request
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => '/countries/IN/cities',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => ['X-API-KEY' => 'your-api-key'],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
return "cURL Error #:" . $err;
} else {
$data = json_decode($response);
}
const axios = require("axios");
const options = {
method: 'GET',
url: '/countries/IN/cities',
headers: {
'X-API-KEY': 'your-api-key'
},
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("/countries/IN/cities"),
Headers =
{
{ "X-API-KEY", "your-api-key" }
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("/countries/IN/cities")
.addHeader("X-API-KEY", "your-api-key")
.build();
Response response = client.newCall(request).execute();
List all Cities belongs to State
Use this endpoint to effortlessly retrieve a comprehensive list of cities which is belongs to the state using the state ISO2 string.
Required Parameter
-
ciso2
- string
-
Country iso2 string.
-
siso2
- string
-
State iso2 string.
Optional query param
-
isPaginate
- boolean
-
Return you the paginated result
-
limit
- integer
-
Limit the countries returned
-
page
- integer
-
Return the contents of that page after pagination
Request
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => '/countries/IN/states/MP/cities',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => ['X-API-KEY' => 'your-api-key'],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
return "cURL Error #:" . $err;
} else {
$data = json_decode($response);
}
const axios = require("axios");
const options = {
method: 'GET',
url: '/countries/IN/states/MP/cities',
headers: {
'X-API-KEY': 'your-api-key'
},
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("/countries/IN/states/MP/cities"),
Headers =
{
{ "X-API-KEY", "your-api-key" }
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("/countries/IN/states/MP/cities")
.addHeader("X-API-KEY", "your-api-key")
.build();
Response response = client.newCall(request).execute();
Retrive a City
Retrieve detailed information about a city using its cityId code. This endpoint is useful for obtaining specific city data based on the cityId.
Required parameter
-
ciso2
- string
-
Country iso2 string.
-
siso2
- string
-
State iso2 string.
-
cityId
- integer
-
City id which is mentioned in the api.
Request
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => '/countries/IN/states/IN/cities/132181',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => ['X-API-KEY' => 'your-api-key'],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
return "cURL Error #:" . $err;
} else {
$data = json_decode($response);
}
const axios = require("axios");
const options = {
method: 'GET',
url: '/countries/IN/states/IN/cities/132181',
headers: {
'X-API-KEY': 'your-api-key'
},
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("/countries/IN/states/IN/cities/132181"),
Headers =
{
{ "X-API-KEY", "your-api-key" }
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("/countries/IN/states/IN/cities/132181")
.addHeader("X-API-KEY", "your-api-key")
.build();
Response response = client.newCall(request).execute();
Autocomplete by Country
This endpoint allows you to get all the cities which is like the name you provide, it is useful for the searching of the city in your application.
Required parameter
-
ciso2
- string
-
Country iso2 string.
-
cityName
- string
-
Any City full name can search.
Optional query param
-
isPaginate
- boolean
-
Return you the paginated result
-
limit
- integer
-
Limit the countries returned
-
page
- integer
-
Return the contents of that page after pagination
Request
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => '/countries/IN/cities/autoComplete',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ['X-API-KEY' => 'your-api-key'],
CURLOPT_POSTFIELDS => "stateName='your-search-string'"
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
return "cURL Error #:" . $err;
} else {
$data = json_decode($response);
}
const axios = require("axios");
const encodedParams = new URLSearchParams();
encodedParams.append("stateName", "your-search-string");
const options = {
method: 'POST',
url: '/countries/IN/cities/autoComplete',
headers: {
'X-API-KEY': 'your-api-key'
},
data: encodedParams
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("/countries/IN/cities/autoComplete"),
Headers =
{
{ "X-API-KEY", "your-api-key" }
},
Content = new FormUrlEncodedContent(new Dictionary
{
{"stateName", "your-search-string"}
}),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
OkHttpClient client = new OkHttpClient();
RequestBody body = new FormBody.Builder()
.add("stateName", "your-search-string")
.build();
Request request = new Request.Builder()
.url("/countries/IN/cities/autoComplete")
.post(body)
.addHeader("X-API-KEY", "your-api-key")
.build();
Response response = client.newCall(request).execute();
Autocomplete by State
This endpoint allows you to add a new conversation between you and a contact or group. A contact or group id is required to create a conversation.
Required parameter
-
ciso2
- string
-
Country iso2 string.
-
cityName
- string
-
Any City full name can search.
Optional query param
-
isPaginate
- boolean
-
Return you the paginated result
-
limit
- integer
-
Limit the countries returned
-
page
- integer
-
Return the contents of that page after pagination
Request
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => '/countries/IN/states/MP/cities/autoComplete',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ['X-API-KEY' => 'your-api-key'],
CURLOPT_POSTFIELDS => "cityName='your-search-string'"
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
return "cURL Error #:" . $err;
} else {
$data = json_decode($response);
}
const axios = require("axios");
const encodedParams = new URLSearchParams();
encodedParams.append("cityName", "your-search-string");
const options = {
method: 'POST',
url: '/countries/IN/states/MP/cities/autoComplete',
headers: {
'X-API-KEY': 'your-api-key'
},
data: encodedParams
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("/countries/IN/states/MP/cities/autoComplete"),
Headers =
{
{ "X-API-KEY", "your-api-key" }
},
Content = new FormUrlEncodedContent(new Dictionary
{
{"cityName", "your-search-string"}
}),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
OkHttpClient client = new OkHttpClient();
RequestBody body = new FormBody.Builder()
.add("cityName", "your-search-string")
.build();
Request request = new Request.Builder()
.url("/countries/IN/states/MP/cities/autoComplete")
.post(body)
.addHeader("X-API-KEY", "your-api-key")
.build();
Response response = client.newCall(request).execute();