Skip to main content

VeriApi.Pro Python SDK: döviz kuru, namaz vakti, hava durumu ve deprem API'si

Python ile döviz kurlarını, namaz vakitlerini, hava durumunu, son depremleri ve il/ilçe listesini tek API anahtarıyla çekin.

Official Python client for VeriApi.Pro: Turkish exchange rates, prayer times, weather, earthquakes and cities.

Python 3.9+, bağımlılık yok.

pip install veriapi

Hızlı başlangıç

from veriapi import VeriApi, VeriApiHatasi

api = VeriApi("va_ANAHTARINIZ")

sonuc = api.doviz("USD,EUR")
print(sonuc.veri["kurlar"])
print(sonuc.kaynak[0]["atif"])  # veriyi gösterdiğiniz yerde görünür yazın
print(sonuc.guncelleme, sonuc.bayat)
print(sonuc.kota.gunluk_kalan, sonuc.kota.dakikalik_kalan, sonuc.kota.istek_maliyeti)

Yöntemler

api.doviz(["USD", "EUR"], tur="referans")      # tur: anlik | referans
api.hava(il="duzce", ilce="akcakoca")          # ya da konum="duzce-akcakoca", ya da enlem=, boylam=
api.namaz(il="ankara", tarih="2026-11-05", gun=7)
api.depremler(limit=10, min_buyukluk=4.0, saat=24, il="izmir", yurtici=True)
api.iller()
api.ilceler("duzce")                           # ad, slug ya da plaka

api.get("/v1/takvim/tatiller", {"yil": 2026})  # diğer tüm uçlar

Seçenekler

api = VeriApi(
    "va_ANAHTARINIZ",
    zaman_asimi=10.0,    # istek başına saniye
    yeniden_deneme=2,    # 429'da en çok kaç kez daha; 0 kapatır
    azami_bekleme=60.0,  # bundan uzun Retry-After beklenmez, hata hemen fırlatılır
)

Hatalar

try:
    api.namaz(il="duzce", gun=99)
except VeriApiHatasi as hata:
    print(hata.kod, hata.mesaj, hata.http_durumu)
    print(hata.alanlar)      # 422: [{"alan": "gun", "mesaj": "..."}]
    print(hata.retry_after)  # 429: saniye
    print(hata.zaman_asimi)  # zaman aşımında True; bağlantı hatasında kod ve http_durumu 0

Webhook doğrulama

Ham gövdeyi kullanın; JSON'u ayrıştırıp yeniden üretirseniz imza tutmaz.

from flask import Flask, abort, request
from veriapi import imza_dogrula

app = Flask(__name__)

@app.post("/webhook")
def webhook():
    gecerli = imza_dogrula(
        request.get_data(),
        request.headers.get("X-VeriApi-Imza"),
        request.headers.get("X-VeriApi-Zaman"),
        "WEBHOOK_GIZLI_ANAHTARINIZ",
    )
    if not gecerli:
        abort(401)
    olay = request.headers.get("X-VeriApi-Olay")
    print(olay, request.get_json())
    return "", 204

tolerans=300 saniyeden eski ya da ileri tarihli imza reddedilir; tolerans=0 kapatır.

Test

python3 -m unittest discover -s tests

Bağlantılar

Lisans: MIT

Metadata

Release files for veriapi 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for veriapi 0.1.0
File Size Uploaded Provenance Actions
veriapi-0.1.0.tar.gz 11.5 kB Without provenance Details for veriapi-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for veriapi 0.1.0
File Interpreter ABI Platform Actions
veriapi-0.1.0-py3-none-any.whl Python 3 none any Details for veriapi-0.1.0-py3-none-any.whl

Total release size: 19.9 kB

Release files / veriapi-0.1.0.tar.gz

Download URL veriapi-0.1.0.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ea77fd64a938f45ed35bc3c933a3888b0b4aade404b829f1758344141319fba7
BLAKE2b-256 checksum
How to use checksums
097ca6fefeea8dc7d903ab2a6e7a50a475cd6f8d0fec690a28c16df98cf092e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / veriapi-0.1.0-py3-none-any.whl

Download URL veriapi-0.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d78d0da0a0ba8622432f766f8f77c157599f21bd6098eb96b8c638a7a1c7d9c
BLAKE2b-256 checksum
How to use checksums
e613552c81b5ff201438148b4785e4aeb358b710ed302c7c7c70b9293f4fce9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for veriapi 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page