Javni REST API za dostop do svetopisemskih besedil, verza dneva in seznama prevodov. Odgovori so v formatu JSON (UTF-8).
copyright z atribucijo, ki jo je treba navajati.
https://biblija.hozana.si/api/v1
Vsak zahtevek zahteva API ključ. Ključ dobiš (in regeneriraš) na strani Profil (potrebna je prijava). Pošlji ga v glavi:
Authorization: Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx
Alternativno je podprta tudi glava X-API-Key: <ključ>. Ključa nikoli ne pošiljaj v URL-ju.
100 zahtev na dan na ključ. Vsak odgovor vsebuje glave X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset. Ob preseženi meji vrne 429 in glavo Retry-After.
/translationsSeznam prevodov, ki so na voljo (z oznakami za parameter translation).
curl -H "Authorization: Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx" \
"https://biblija.hozana.si/api/v1/translations"const res = await fetch("https://biblija.hozana.si/api/v1/translations", {
headers: { Authorization: "Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx" }
});
if (!res.ok) throw new Error((await res.json()).error.message);
const { data } = await res.json();
console.log(data);import requests
r = requests.get(
"https://biblija.hozana.si/api/v1/translations",
headers={"Authorization": "Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx"}, timeout=10)
r.raise_for_status()
print(r.json()["data"])<?php
$ch = curl_init("https://biblija.hozana.si/api/v1/translations");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx"],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data["data"]);/passageOdlomek po referenci v izbranem prevodu.
| Parameter | Obvezen | Opis |
|---|---|---|
translation | da | Oznaka prevoda (npr. KJV, SSP3). |
reference | da | Referenca, npr. Jn 3,16, Mt 5,1-12 ali Ps 23. |
curl -H "Authorization: Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx" \
"https://biblija.hozana.si/api/v1/passage?translation=KJV&reference=Jn%203,16"const res = await fetch("https://biblija.hozana.si/api/v1/passage?translation=KJV&reference=Jn%203,16", {
headers: { Authorization: "Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx" }
});
if (!res.ok) throw new Error((await res.json()).error.message);
const { data } = await res.json();
console.log(data);import requests
r = requests.get(
"https://biblija.hozana.si/api/v1/passage?translation=KJV&reference=Jn%203,16",
headers={"Authorization": "Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx"}, timeout=10)
r.raise_for_status()
print(r.json()["data"])<?php
$ch = curl_init("https://biblija.hozana.si/api/v1/passage?translation=KJV&reference=Jn%203,16");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx"],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data["data"]);/verse-of-the-dayVerz dneva. Neobvezni parameter translation (privzeto SSP3).
curl -H "Authorization: Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx" \
"https://biblija.hozana.si/api/v1/verse-of-the-day?translation=KJV"const res = await fetch("https://biblija.hozana.si/api/v1/verse-of-the-day?translation=KJV", {
headers: { Authorization: "Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx" }
});
if (!res.ok) throw new Error((await res.json()).error.message);
const { data } = await res.json();
console.log(data);import requests
r = requests.get(
"https://biblija.hozana.si/api/v1/verse-of-the-day?translation=KJV",
headers={"Authorization": "Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx"}, timeout=10)
r.raise_for_status()
print(r.json()["data"])<?php
$ch = curl_init("https://biblija.hozana.si/api/v1/verse-of-the-day?translation=KJV");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer bib_xxxxxxxxxxxxxxxxxxxxxxxx"],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data["data"]);{
"data": {
"reference": "Jn 3,16",
"translation": { "abbreviation": "KJV", "name": "King James Version", "language": "eng" },
"verses": [
{
"book": "John", "book_abbrev": "Jhn", "chapter": 3, "verse": 16,
"reference": "Jhn 3,16",
"text": "For God so loved the world, ..."
}
],
"copyright": "Public Domain"
}
}
{ "error": { "code": "reference_not_found", "message": "Reference ni mogoče najti: ..." } }
| Koda | HTTP | Pomen |
|---|---|---|
missing_api_key / invalid_api_key | 401 | Manjkajoč ali napačen ključ. |
invalid_translation / missing_parameter | 400 | Napačen vnos. |
reference_not_found / not_found | 404 | Ni zadetka / neznan endpoint. |
rate_limit_exceeded | 429 | Presežena dnevna meja. |