TR KOBİlerin atık, elektrik, su ve lojistik faturalarını BDDK YVO Tebliği ve GHG Protocol uyumlu, doğrulanabilir ESG verisine dönüştüren açık çekirdek bir API.
EN An open-core API that converts SME utility invoices into BDDK YVO and GHG Protocol compliant, verifiable ESG data.
Tıkla, dene / Try it now 👉 🎛️ Görsel Demo
Canlı bağlantılar / Live links
- 🌐 Landing: https://memirutku.github.io/rebot-api/
- 🎛️ Görsel demo: https://rebot-api-demo.onrender.com
- 🔌 API: https://rebot-api.onrender.com
- 📘 Swagger UI: https://rebot-api.onrender.com/docs
- 💬 Tartışma / Discussions: https://github.com/memirutku/rebot-api/discussions
BDDK'nın Nisan 2025'te yayımladığı Yeşil Varlık Oranı (YVO) Tebliği, bankaların yeşil kredi portföylerini bağımsız doğrulanmış çevresel veriyle tevsik etmesini zorunlu kıldı. KOBİler bu veriyi üretemiyor: ya hiç ölçülmüyor ya da firma beyanına dayanıyor. Türkiye'de BDDK YVO için makine-okunabilir açık veri standardı yok.
REBOT API, KOBİ faturalarını alır, GHG Protocol Scope 1/2/3 hesabını yapar, BDDK YVO Ek-1 hedeflerine eşler, sonucu imzalı bir bundle olarak bankalara sunar. Üç katman halinde:
- Giriş —
POST /v1/invoices: PDF/CSV/JSON fatura kabul, normalize - Doğrulama — Açık emisyon faktör kataloğu (DEFRA + TÜİK)
- Çıkış —
GET /v1/esg/{tax_id}: BDDK YVO + EFRAG VSME XBRL uyumlu bundle, Ed25519 imzalı
Bu repo REBOT API'nin açık çekirdek motorudur: API uç noktaları, parser'lar, GHG hesap motoru, YVO mapper, JSON şemalar ve emisyon faktör kataloğu Apache 2.0 + CC BY-SA 4.0 lisanslıdır. Ticari sürüm için iletişim: GitHub Discussions.
git clone https://github.com/memirutku/rebot-api.git
cd rebot-api
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
uvicorn api.main:app --reload
# Tarayıcı: http://localhost:8000/docs🟢 https://rebot-api.onrender.com
URL=https://rebot-api.onrender.com
# 1. Atık taşıma faturası gönder
curl -X POST $URL/v1/invoices -H "Content-Type: application/json" \
-d @examples/requests/waste_ingest.json
# 2. KOBİ bazında dönemsel ESG bundle al (imzalı)
curl "$URL/v1/esg/9876543210?period=2025-Q2" | jq .
# 3. İmza doğrulama için public key
curl $URL/v1/signing/public-key | jq .İmza doğrulama (Python):
import base64, json, requests
from nacl.signing import VerifyKey
URL = "https://rebot-api.onrender.com"
resp = requests.get(f"{URL}/v1/esg/9876543210?period=2025-Q2").json()
pub = requests.get(f"{URL}/v1/signing/public-key").json()
vk = VerifyKey(base64.b64decode(pub["verify_key_b64"]))
canonical = json.dumps(resp["bundle"], sort_keys=True, separators=(",",":"),
ensure_ascii=False).encode()
vk.verify(canonical, base64.b64decode(resp["signature"]["value_b64"])) # tampered → raises
print("✅ İmza geçerli, BDDK YVO bundle doğrulandı")Diğer uç noktalar:
curl $URL/health # liveness
curl "$URL/v1/emission-factors?region=TR" # TR emisyon faktörleri
curl $URL/v1/emission-factors/electricity.tr.grid_average # tek faktör
curl "$URL/v1/ewc-codes?chapter=20" # EWC kodları (chapter 20 — evsel)Örnek imzalı bundle: examples/responses/esg_bundle_signed.json
⚠️ Render free tier — 15 dakika inaktiviteden sonra uyur. İlk istek 30-60 saniye sürebilir (cold start), sonraki istekler hızlı. Deploy adımları:docs/deploy-render.md.
demo/app.py Hugging Face Spaces uyumlu bir Gradio arayüzü içerir. Programcı olmayan biri için fatura JSON yapıştır → imzalı YVO bundle gör akışı sunar. Yerel çalıştırma:
pip install -r demo/requirements.txt
python demo/app.py # http://localhost:7860HF Spaces'e deploy: docs/deploy-hf-spaces.md.
site/index.html — tek dosyalık static landing page, GitHub Pages'te otomatik yayınlanır: memirutku.github.io/rebot-api. TR/EN dil değiştirici + favicon + og:image dahil. Deploy ayarları: docs/deploy-github-pages.md.
- Kod: Apache 2.0
- Veri ve şemalar: CC BY-SA 4.0
- Issue açın, PR atın.
- Tartışma: GitHub Discussions — Türkiye yeşil fintech için açık forum.
Turkey's banking regulator (BDDK) issued the Green Asset Ratio (YVO) Regulation in April 2025, requiring banks to back green loan portfolios with independently verified environmental data. SMEs cannot produce that data — it's either unmeasured or self-reported. Turkey has no machine-readable open data standard for YVO reporting.
REBOT API ingests SME utility invoices, runs GHG Protocol Scope 1/2/3 accounting, maps to BDDK YVO Annex 1 objectives, and emits a signed bundle to banks. Three layers:
- Ingest —
POST /v1/invoices: accept PDF/CSV/JSON invoices, normalize - Verify — Open emission factor catalogue (DEFRA + TÜİK Turkey-grid)
- Emit —
GET /v1/esg/{tax_id}: BDDK YVO + EFRAG VSME XBRL compatible bundle, Ed25519 signed
This repository is REBOT API's open-core engine: endpoints, parsers, GHG accounting, YVO mapper, JSON schemas, and emission-factor catalogue, all under Apache 2.0 + CC BY-SA 4.0. For the commercial edition, reach out via GitHub Discussions.
git clone https://github.com/memirutku/rebot-api.git
cd rebot-api
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
uvicorn api.main:app --reload
# Browser: http://localhost:8000/docs🟢 https://rebot-api.onrender.com
URL=https://rebot-api.onrender.com
# 1. Submit a waste-transport invoice
curl -X POST $URL/v1/invoices -H "Content-Type: application/json" \
-d @examples/requests/waste_ingest.json
# 2. Fetch the signed ESG bundle for the SME and period
curl "$URL/v1/esg/9876543210?period=2025-Q2" | jq .
# 3. Get the public key to verify the signature
curl $URL/v1/signing/public-key | jq .Verify the signature (Python):
import base64, json, requests
from nacl.signing import VerifyKey
URL = "https://rebot-api.onrender.com"
resp = requests.get(f"{URL}/v1/esg/9876543210?period=2025-Q2").json()
pub = requests.get(f"{URL}/v1/signing/public-key").json()
vk = VerifyKey(base64.b64decode(pub["verify_key_b64"]))
canonical = json.dumps(resp["bundle"], sort_keys=True, separators=(",",":"),
ensure_ascii=False).encode()
vk.verify(canonical, base64.b64decode(resp["signature"]["value_b64"])) # tampered → raises
print("✅ Signature valid — BDDK YVO bundle verified")Other endpoints:
curl $URL/health # liveness
curl "$URL/v1/emission-factors?region=TR" # TR emission factors
curl $URL/v1/emission-factors/electricity.tr.grid_average # single factor
curl "$URL/v1/ewc-codes?chapter=20" # EWC waste codes (chapter 20 — municipal)Sample signed bundle: examples/responses/esg_bundle_signed.json
⚠️ Render free tier — sleeps after 15 minutes of inactivity. First request takes 30-60 seconds (cold start); subsequent requests are fast. Deploy steps:docs/deploy-render.md.
demo/app.py is a Hugging Face Spaces compatible Gradio UI. It lets non-developers paste an invoice JSON and watch the signed YVO bundle render in the browser. Run locally:
pip install -r demo/requirements.txt
python demo/app.py # http://localhost:7860Deploy to HF Spaces: docs/deploy-hf-spaces.md.
site/index.html — single-file static landing page, auto-deployed to GitHub Pages: memirutku.github.io/rebot-api. Built-in TR/EN language toggle, favicon, and og:image. Setup: docs/deploy-github-pages.md.
- fingreen-ai/greenlang — open ESG methodology (global parallel)
- EFRAG VSME XBRL Taxonomy — EU SME machine-readable standard (interop target)
- Cloud Carbon Footprint — emission factor catalogue patterns
- Code: Apache 2.0
- Data & schemas: CC BY-SA 4.0
- Open an issue, send a PR.
- Discussion: GitHub Discussions.
KOBİ veya KOBİ'nin muhasebecisi SME or its accountant
│ (1) atık taşıma fatura JSON waste-transport invoice JSON
▼
┌─────────────────────────────────────────┐
│ POST /v1/invoices │
│ • EWC kodu + birim doğrulaması │
│ • Pydantic ile şema validation │
│ • SHA-256 dedupe │
│ • Verifier (GHG Protocol Scope 3.5) │
└────────────────┬────────────────────────┘
▼ store
┌─────────────────────────────────────────┐
│ GET /v1/esg/{tax_id} │
│ • Dönemsel toplam (period filtre) │
│ • BDDK YVO Ek-1 Hedef 4 alignment │
│ • Ed25519 imzalı bundle │
└────────────────┬────────────────────────┘
▼
Banka / Regulator
(verifies via /v1/signing/public-key)