To authenticate requests, include an Authorization
header with the value "Bearer {YOUR_TOKEN_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
Contact udruga@citati.hr if you are interested in API integration.
Page number to retrieve. Default 1.
between:1,10000 Number of items per page. Default 10.
const url = new URL(
"https://api.citati.hr/authors"
);
const params = {
"page": "1",
"per_page": "10",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Page number to retrieve. Default 1.
between:1,30 Number of items per page. Default 10.
Search terms. Default none.
const url = new URL(
"https://api.citati.hr/authors/search"
);
const params = {
"page": "1",
"per_page": "10",
"query": "lorem",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
required_without:author_slug The ID of the author.
required_without:author_id The slug of the author.
const url = new URL(
"https://api.citati.hr/authors/1"
);
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Page number to retrieve. Default 1.
between:1,10000 Number of items per page. Default 10.
Must be one of latest, relevant, random, featured, or popular. How to sort the collections. Default latest.
Must be one of text or gallery. Default all.
const url = new URL(
"https://api.citati.hr/collections"
);
const params = {
"page": "1",
"per_page": "10",
"order_by": "random",
"type": "text",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
cache-control
: no-cache, private
content-type
: application/json
access-control-allow-origin
: *
{
"data": [
{
"id": 69,
"title": "Vesla na vodi",
"slug": "vesla-na-vodi",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": "song",
"image": null,
"cover": null,
"label": null,
"link": null
},
{
"id": 59,
"title": "Posoljeni zrak i razlivena tinta",
"slug": "posoljeni-zrak-i-razlivena-tinta",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": "song",
"image": null,
"cover": null,
"label": null,
"link": null
},
{
"id": 65,
"title": "Svi moji punti kad se zbroje",
"slug": "svi-moji-punti-kad-se-zbroje",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": "song",
"image": null,
"cover": null,
"label": null,
"link": null
},
{
"id": 24,
"title": "Crno ili bijelo",
"slug": "crno-ili-bijelo",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": "song",
"image": null,
"cover": null,
"label": null,
"link": null
},
{
"id": 56,
"title": "Ovo mi je škola",
"slug": "ovo-mi-je-skola",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": "song",
"image": null,
"cover": null,
"label": null,
"link": null
},
{
"id": 40,
"title": "Lipa moja",
"slug": "lipa-moja",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": "song",
"image": null,
"cover": null,
"label": null,
"link": null
},
{
"id": 67,
"title": "Tebe nisam bio vrijedan",
"slug": "tebe-nisam-bio-vrijedan",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": "song",
"image": null,
"cover": null,
"label": null,
"link": null
},
{
"id": 2,
"title": "Poslovice",
"slug": "poslovice",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": null,
"image": null,
"cover": null,
"label": null,
"link": null
},
{
"id": 10,
"title": "E-bonton",
"slug": "e-bonton",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": null,
"image": null,
"cover": null,
"label": null,
"link": null
},
{
"id": 16,
"title": "Ruža vjetrova",
"slug": "ruza-vjetrova",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": "album",
"image": null,
"cover": null,
"label": null,
"link": null
}
],
"links": {
"first": "https://citati-api.test/collections?page=1",
"last": "https://citati-api.test/collections?page=9",
"prev": null,
"next": "https://citati-api.test/collections?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 9,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://citati-api.test/collections?page=1",
"label": "1",
"active": true
},
{
"url": "https://citati-api.test/collections?page=2",
"label": "2",
"active": false
},
{
"url": "https://citati-api.test/collections?page=3",
"label": "3",
"active": false
},
{
"url": "https://citati-api.test/collections?page=4",
"label": "4",
"active": false
},
{
"url": "https://citati-api.test/collections?page=5",
"label": "5",
"active": false
},
{
"url": "https://citati-api.test/collections?page=6",
"label": "6",
"active": false
},
{
"url": "https://citati-api.test/collections?page=7",
"label": "7",
"active": false
},
{
"url": "https://citati-api.test/collections?page=8",
"label": "8",
"active": false
},
{
"url": "https://citati-api.test/collections?page=9",
"label": "9",
"active": false
},
{
"url": "https://citati-api.test/collections?page=2",
"label": "Next »",
"active": false
}
],
"path": "https://citati-api.test/collections",
"per_page": 10,
"to": 10,
"total": 83
}
}
Page number to retrieve. Default 1.
between:1,30 Number of items per page. Default 10.
Search terms. Default none.
const url = new URL(
"https://api.citati.hr/collections/search"
);
const params = {
"page": "1",
"per_page": "10",
"query": "lorem",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
cache-control
: no-cache, private
content-type
: application/json
access-control-allow-origin
: *
{
"data": [],
"links": {
"first": "https://citati-api.test/collections/search?query=lorem&page=1",
"last": "https://citati-api.test/collections/search?query=lorem&page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": null,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://citati-api.test/collections/search?query=lorem&page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://citati-api.test/collections/search",
"per_page": 10,
"to": null,
"total": 0
}
}
required_without:collection_slug The ID of the collection.
required_without:collection_id The slug of the collection.
const url = new URL(
"https://api.citati.hr/collections/1"
);
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
cache-control
: no-cache, private
content-type
: application/json
access-control-allow-origin
: *
{
"data": {
"id": 1,
"title": "Citati",
"slug": "citati",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": null,
"image": null,
"cover": null,
"label": null,
"link": null
}
}
const url = new URL(
"https://api.citati.hr/interactions"
);
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"post_id": 1,
"collection_id": 1,
"user_id": 2,
"type": "like"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Page number to retrieve. Default 1.
between:1,1000 Number of items per page. Default 10.
Collection ID/slugs(‘s) to filter posts. If multiple, comma-separated. Default none.
Author ID/slugs(‘s) to filter posts. If multiple, comma-separated. Default none.
Topic ID/slugs(‘s) to filter posts. If multiple, comma-separated. Default none.
Must be one of latest, relevant, random, featured, or popular. How to sort the posts. Default latest.
const url = new URL(
"https://api.citati.hr/posts"
);
const params = {
"page": "1",
"per_page": "10",
"collections": "1",
"authors": "1",
"topics": "1",
"order_by": "random",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
cache-control
: no-cache, private
content-type
: application/json
access-control-allow-origin
: *
{
"data": [],
"links": {
"first": "https://citati-api.test/posts?page=1",
"last": "https://citati-api.test/posts?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": null,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://citati-api.test/posts?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://citati-api.test/posts",
"per_page": 10,
"to": null,
"total": 0
}
}
Page number to retrieve. Default 1.
between:1,30 Number of items per page. Default 10.
Search terms. Default none.
const url = new URL(
"https://api.citati.hr/posts/search"
);
const params = {
"page": "1",
"per_page": "10",
"query": "lorem",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
cache-control
: no-cache, private
content-type
: application/json
access-control-allow-origin
: *
{
"data": [],
"links": {
"first": "https://citati-api.test/posts/search?query=lorem&page=1",
"last": "https://citati-api.test/posts/search?query=lorem&page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": null,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://citati-api.test/posts/search?query=lorem&page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://citati-api.test/posts/search",
"per_page": 10,
"to": null,
"total": 0
}
}
required_without:post_slug The ID of the post.
required_without:post_id The UID of the post.
const url = new URL(
"https://api.citati.hr/posts/1"
);
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
cache-control
: no-cache, private
content-type
: application/json
access-control-allow-origin
: *
{
"data": {
"id": 1,
"uid": "QUeodrV",
"content": "Kinofobija",
"description": "Strah od psa.",
"sticky": false,
"featured_at": null,
"image": null,
"updated_at": "2023-09-02T10:29:15.000000Z",
"collections": [
{
"id": 4,
"title": "Znanje",
"slug": "znanje",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": null,
"image": null,
"cover": null,
"label": null,
"link": null
},
{
"id": 8,
"title": "Fobije",
"slug": "fobije",
"caption": null,
"sticky": false,
"featured_at": null,
"promo_until": null,
"type": "text",
"source": null,
"image": null,
"cover": null,
"label": null,
"link": null
}
],
"authors": [
{
"id": 530,
"name": "Fobija",
"slug": "fobija"
}
],
"topics": []
}
}
Page number to retrieve. Default 1.
between:1,10000 Number of items per page. Default 10.
const url = new URL(
"https://api.citati.hr/topics"
);
const params = {
"page": "1",
"per_page": "10",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
cache-control
: no-cache, private
content-type
: application/json
access-control-allow-origin
: *
{
"data": [
{
"id": 1,
"name": "alkohol",
"slug": "alkohol"
},
{
"id": 2,
"name": "ambicija",
"slug": "ambicija"
},
{
"id": 3,
"name": "anegdote",
"slug": "anegdote"
},
{
"id": 4,
"name": "bog",
"slug": "bog"
},
{
"id": 5,
"name": "bogatstvo",
"slug": "bogatstvo"
},
{
"id": 6,
"name": "bol",
"slug": "bol"
},
{
"id": 7,
"name": "bolest",
"slug": "bolest"
},
{
"id": 8,
"name": "borba",
"slug": "borba"
},
{
"id": 9,
"name": "brak",
"slug": "brak"
},
{
"id": 10,
"name": "budućnost",
"slug": "buducnost"
}
],
"links": {
"first": "https://citati-api.test/topics?page=1",
"last": "https://citati-api.test/topics?page=16",
"prev": null,
"next": "https://citati-api.test/topics?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 16,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://citati-api.test/topics?page=1",
"label": "1",
"active": true
},
{
"url": "https://citati-api.test/topics?page=2",
"label": "2",
"active": false
},
{
"url": "https://citati-api.test/topics?page=3",
"label": "3",
"active": false
},
{
"url": "https://citati-api.test/topics?page=4",
"label": "4",
"active": false
},
{
"url": "https://citati-api.test/topics?page=5",
"label": "5",
"active": false
},
{
"url": "https://citati-api.test/topics?page=6",
"label": "6",
"active": false
},
{
"url": "https://citati-api.test/topics?page=7",
"label": "7",
"active": false
},
{
"url": "https://citati-api.test/topics?page=8",
"label": "8",
"active": false
},
{
"url": "https://citati-api.test/topics?page=9",
"label": "9",
"active": false
},
{
"url": "https://citati-api.test/topics?page=10",
"label": "10",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "https://citati-api.test/topics?page=15",
"label": "15",
"active": false
},
{
"url": "https://citati-api.test/topics?page=16",
"label": "16",
"active": false
},
{
"url": "https://citati-api.test/topics?page=2",
"label": "Next »",
"active": false
}
],
"path": "https://citati-api.test/topics",
"per_page": 10,
"to": 10,
"total": 153
}
}
Page number to retrieve. Default 1.
between:1,30 Number of items per page. Default 10.
Search terms. Default none.
const url = new URL(
"https://api.citati.hr/topics/search"
);
const params = {
"page": "1",
"per_page": "10",
"query": "lorem",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
cache-control
: no-cache, private
content-type
: application/json
access-control-allow-origin
: *
{
"data": [],
"links": {
"first": "https://citati-api.test/topics/search?query=lorem&page=1",
"last": "https://citati-api.test/topics/search?query=lorem&page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": null,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://citati-api.test/topics/search?query=lorem&page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://citati-api.test/topics/search",
"per_page": 10,
"to": null,
"total": 0
}
}
required_without:topic_slug The ID of the topic.
required_without:topic_id The slug of the topic.
const url = new URL(
"https://api.citati.hr/topics/1"
);
const headers = {
"Authorization": "Bearer {YOUR_TOKEN_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
cache-control
: no-cache, private
content-type
: application/json
access-control-allow-origin
: *
{
"data": {
"id": 1,
"name": "alkohol",
"slug": "alkohol"
}
}