Deprem verilerine programatik erişim için RESTful API
SonDepremler.live API, AFAD ve Kandilli Rasathanesi'nden toplanan deprem verilerine JSON formatında erişim sağlar. API kullanımı ücretsizdir ancak rate limiting uygulanmaktadır.
Son depremleri listeler. Varsayılan olarak son 50 deprem döner.
{
"success": true,
"count": 50,
"data": [
{
"id": "1234567",
"date": "2025-01-15 14:23:45",
"latitude": 38.4192,
"longitude": 27.1287,
"depth": 7.2,
"magnitude": 4.5,
"region": "Ege Denizi",
"city": "İzmir",
"district": "Seferihisar"
},
...
]
}
Belirli bir şehirdeki son depremleri döner.
// Örnek: /api/earthquakes/city/izmir?limit=10
{
"success": true,
"city": "İzmir",
"count": 10,
"data": [...]
}
Genel deprem istatistiklerini döner.
{
"success": true,
"data": {
"total_earthquakes": 15234,
"last_24h": 45,
"last_7d": 312,
"last_30d": 1456,
"max_magnitude_today": 4.8,
"avg_magnitude_7d": 2.4,
"most_active_city": "Muğla"
}
}
Şehir bazlı deprem istatistikleri.
// Örnek: /api/stats/city/istanbul
{
"success": true,
"city": "İstanbul",
"data": {
"last_24h": 3,
"last_7d": 18,
"last_30d": 89,
"max_magnitude": 4.2,
"avg_magnitude": 2.8,
"avg_depth": 12.4
}
}
// Hata response örneği:
{
"success": false,
"error": "Rate limit exceeded",
"message": "Too many requests. Please try again later."
}
JavaScript (Fetch API):
// Son depremleri getir
fetch('https://sondepremler.live/api/earthquakes?limit=10')
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => console.error('Error:', error));
Python (requests):
import requests
response = requests.get('https://sondepremler.live/api/earthquakes/city/istanbul')
data = response.json()
print(data)
cURL:
curl -X GET "https://sondepremler.live/api/earthquakes?limit=5&min_magnitude=3.0"
API kullanımında sorun yaşıyorsanız veya öneriniz varsa bizimle iletişime geçebilirsiniz:
E-posta: [email protected]
İletişim: İletişim Formu