Публичное API для доступа к новеллам, мангам и главам
Для использования API необходимо создать API ключ. Войдите или зарегистрируйтесь, чтобы продолжить.
ВойтиУ вас пока нет API ключей
Создайте API ключ в разделе "Мои API ключи" выше
curl -X POST https://lorachi.xyz/api/graphql \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"query": "{ novels(page: 1, limit: 10) { novels { id title type author } } }"
}' Получить список новелл с пагинацией
{
novels(page: 1, limit: 20, type: "novel", sort: "updatedAt") {
novels {
id
title
type
author
coverUrl
description
chapters
views
rating
}
pagination {
page
total
totalPages
}
}
} Получить информацию о конкретной новелле
{
novel(id: "NOVEL_ID") {
id
title
type
author
artist
coverUrl
description
alternativeTitles
releaseYear
ageRating
status
chapters
views
rating
badges
}
} Получить новеллу со всеми главами
{
novelWithChapters(id: "NOVEL_ID") {
novel {
id
title
type
}
chapters {
id
chapter
title
volume
views
isPaid
price
}
}
} Получить содержимое текстовой главы
{
chapter(novelId: "NOVEL_ID", chapterNumber: "1") {
id
title
content
volume
views
isPaid
price
}
} Получить страницы манга-главы
{
mangaChapter(novelId: "NOVEL_ID", chapterNumber: "1") {
id
title
volume
pages {
pageNumber
imageUrl
}
isPaid
price
}
} Поиск новелл по названию или автору
{
searchNovels(query: "vampire", limit: 10) {
id
title
type
author
coverUrl
}
} 30 запросов в минуту на API ключ
Максимум 5 активных API ключей на пользователя
const response = await fetch('https://lorachi.xyz/api/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
query: `{
novels(page: 1, limit: 10) {
novels {
id
title
author
}
}
}`
})
});
const data = await response.json();
console.log(data.data.novels); import requests
query = '''
{
novels(page: 1, limit: 10) {
novels {
id
title
author
}
}
}
'''
response = requests.post(
'https://lorachi.xyz/api/graphql',
json={'query': query},
headers={'x-api-key': 'YOUR_API_KEY'}
)
data = response.json()
print(data['data']['novels'])