Genel Bakış
NosyAPI Türkiye Acil Toplanma Alanları Listesi API dökümantasyonuna hoşgeldiniz.
İçindekiler
- API Token Bilgileri
- API Özellikleri ve Notlar
- İstek Endpoint Adresleri
- Örnek Kodlar
- İl & İlçe Listeleme - İstek
- İl & İlçe Listeleme Örnek Kodlar
- İl & İlçe Listeleme - Yanıt
API Token Bilgileri
İlgili API kullanımı için token bilgisine gerekmektedir. Bu token bilgisi ile istediğiniz bilgileri çekebilirsiniz. Her üyemize otomatik olarak tanımlamalar gerçekleşir. Token bilginizi menüde yer alan API Bilgilerim bölümünden alabilirsiniz.
Türkiye Acil Toplanma Alanları Listesi API Özellikleri ve Notlar
Bu data içinde toplam 12649 kayıt bulunmaktadır. |
getTurkey endpoint adresine sadece il bilgisi gönderilir ise dönen kayıt sayısı en fazla 100 olacaktır. İlçe bilgisi beraberinde gönderilir ise bu sayı 500'e kadar çıkacaktır. |
getTurkeyDistance endpoint adresine iletilen enlem boylam sonucu ilgili koordinatların 5km çevresinde yer alan en yakında 25 kayıt görüntülenmektedir. |
İlgili datayı sql olarak toplu bir şekilde almak için iletişime geçiniz. |
Her kayıt 1 kredidir. Lütfen demo amaçlı işlemlerinizde küçük ilçelerle sorgu göndermenizi tavsiye ederiz. |
Endpoint Adresleri
İstek |
---|
GET - https://www.nosyapi.com/apiv2/getTurkey?id=43387&city=izmir |
GET - https://www.nosyapi.com/apiv2/getTurkey?id=43387&city=izmir&country=karabaglar |
GET - https://www.nosyapi.com/apiv2/getTurkeyDistance?id=43387&latitude=38.25873801&longitude=27.14374296 |
Örnek Kodlar |
---|
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.nosyapi.com/apiv2/getTurkey?id=43387&city=izmir",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
"Authorization: Bearer API_TOKEN"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
curl --location --request GET 'https://www.nosyapi.com/apiv2/getTurkey?id=43387&city=izmir' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer API_TOKEN'
var data = new FormData();
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://www.nosyapi.com/apiv2/getTurkey?id=43387&city=izmir");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer API_TOKEN");
xhr.send(data);
var client = new RestClient("https://www.nosyapi.com/apiv2/getTurkey?id=43387&city=izmir");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer API_TOKEN");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.get("https://www.nosyapi.com/apiv2/getTurkey?id=43387&city=izmir")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer API_TOKEN")
.multiPartContent() .asString();
import http.client
import mimetypes
conn = http.client.HTTPSConnection("www.nosyapi.com")
boundary = ''
payload = ''
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer API_TOKEN',
'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("GET", "/apiv2/getTurkey?id=43387&city=izmir", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import Foundation
var semaphore = DispatchSemaphore (value: 0)
let parameters = [
] as [[String : Any]]
let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
if param["disabled"] == nil {
let paramName = param["key"]!
body += "--\(boundary)\r\n"
body += "Content-Disposition:form-data; name=\"\(paramName)\""
let paramType = param["type"] as! String
if paramType == "text" {
let paramValue = param["value"] as! String
body += "\r\n\r\n\(paramValue)\r\n"
} else {
let paramSrc = param["src"] as! String
let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
let fileContent = String(data: fileData, encoding: .utf8)!
body += "; filename=\"\(paramSrc)\"\r\n"
+ "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
}
}
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://www.nosyapi.com/apiv2/getTurkey?id=43387&city=izmir")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer API_KEY", forHTTPHeaderField: "Authorization")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
request.httpMethod = "GET"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
Diğer programlama dilleri için lütfen info@nosyapi.com adresine mail atınız.
Not: API_TOKEN yazan yerleri kendi token bilginizle değiştirmeyi unutmayınız.
Yanıt ve Tipleri |
---|
{
"status": "success",
"message": "ok",
"rowCount": 35,
"data": [
{
"name": "Xxxxx Xxxxx Xxxxxx",
"city": "İzmir",
"country": "Menderes",
"street": "Gölcükler",
"streetv2": "xXxxxxxxx",
"phone": "xxxxxxxx",
"fax": "xxxxxxxx",
"website": "xxxxxxxx",
"latitude": 38.15891603,
"longitude": 27.34378004,
"distanceMt": 20, /* distance endpoint kullanırsa bu bilgi dönecektir. */
"distanceKm": 0.02, /* distance endpoint kullanırsa bu bilgi dönecektir. */
"distanceMil": 0.012 /* distance endpoint kullanırsa bu bilgi dönecektir. */
},...
]
}
İl & İlçe Listeleme
Türkiye Acil Toplanma Alanları Listesi API kullanımı için çeşitli değerlere ihtiyaç duymaktayız. Bunlardan en temeli şehir ve ilçe bilgileri. Bu değerleri aşağıdaki API'yı kullanarak erişebilirsiniz.
İstek |
---|
GET - https://www.nosyapi.com/apiv2/getTurkeyCity?id=43387 - İlleri Listeler |
GET - https://www.nosyapi.com/apiv2/getTurkeyCity?id=43387&city=izmir - İlçeleri Listeler |
Alan | Veri Tipi | Zorunluluk | Açıklama |
---|---|---|---|
city | İllerde yer alan ilçe ve semtlerin listesini görmeniz için girmeniz gereken değerdir | string |
Zorunlu Değil |
Örnek Kodlar |
---|
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://www.nosyapi.com/apiv2/getTurkeyCity?id=43387&city=izmir",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
"Authorization: Bearer API_KEY"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
curl --location --request GET 'https://www.nosyapi.com/apiv2/getTurkeyCity?id=43387&city=izmir' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer API_KEY'
var data = new FormData();
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://www.nosyapi.com/apiv2/getTurkeyCity?id=43387&city=izmir");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer API_KEY");
xhr.send(data);
var client = new RestClient("https://www.nosyapi.com/apiv2/getTurkeyCity?id=43387&city=izmir");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer API_KEY");
request.AlwaysMultipartFormData = true;
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Unirest.setTimeouts(0, 0);
HttpResponse response = Unirest.get("https://www.nosyapi.com/apiv2/getTurkeyCity?id=43387&city=izmir")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer API_KEY")
.multiPartContent() .asString();
import http.client
import mimetypes
conn = http.client.HTTPSConnection("www.nosyapi.com")
boundary = ''
payload = ''
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY',
'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("GET", "/apiv2/getCity", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import Foundation
var semaphore = DispatchSemaphore (value: 0)
let parameters = [
] as [[String : Any]]
let boundary = "Boundary-\(UUID().uuidString)"
var body = ""
var error: Error? = nil
for param in parameters {
if param["disabled"] == nil {
let paramName = param["key"]!
body += "--\(boundary)\r\n"
body += "Content-Disposition:form-data; name=\"\(paramName)\""
let paramType = param["type"] as! String
if paramType == "text" {
let paramValue = param["value"] as! String
body += "\r\n\r\n\(paramValue)\r\n"
} else {
let paramSrc = param["src"] as! String
let fileData = try NSData(contentsOfFile:paramSrc, options:[]) as Data
let fileContent = String(data: fileData, encoding: .utf8)!
body += "; filename=\"\(paramSrc)\"\r\n"
+ "Content-Type: \"content-type header\"\r\n\r\n\(fileContent)\r\n"
}
}
}
body += "--\(boundary)--\r\n";
let postData = body.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://www.nosyapi.com/apiv2/getTurkeyCity?id=43387&city=izmir")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer API_KEY", forHTTPHeaderField: "Authorization")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
request.httpMethod = "GET"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
Diğer programlama dilleri için lütfen info@nosyapi.com adresine mail atınız.
Not: API_TOKEN yazan yerleri kendi token bilginizle değiştirmeyi unutmayınız.
Yanıt |
---|
Şehirleri Listeleme Yanıt
{
"status": "ok",
"message": "ok",
"systemTime": 1605104214,
"rowCount": 81,
"data": [
{
"cityName": "Adana",
"citySlug": "adana"
}...
]
}
İlçe ve Semtleri Gösterme Yanıt
{
"status": "ok",
"message": "ok",
"systemTime": 1605104013,
"rowCount": 55,
"data": [
{
"cityName": "Aliağa",
"citySlug": "aliaga"
}...
]
}
Etiketler: Acil Toplanma Alanı listesi,Acil Toplanma Alanı firma listesi,Acil Toplanma Alanı api
Türkiye Acil Toplanma Alanları Listesi API Postman Döküman
NosyAPI Türkiye Acil Toplanma Alanları Listesi API postman dökümanına aşağıdaki linkten ulaşabilirsiniz..
İlgili postman dosyasını import ettikten sonra API_TOKEN yazan yeri kendi API Token değeriniz ile değiştirmeyi unutmayınız.
ID değerini güncellemeyi unutmayınız.