Send the key in the Authorization header, and a User-Agent that names your tool, so we can tell your requests apart and reach you if something goes wrong.
curl -i -H "Authorization: Bearer $RT_KEY" \
-H "User-Agent: my-shelf-bot/1.0" \
'https://randomtranslator.com/api/v1/user-novels/bookmarks?limit=2'
The answer is your library, newest read first, with these headers among the others:
HTTP/2 200
content-type: application/json
cache-control: private, no-store
x-ratelimit-limit: 10000
x-ratelimit-remaining: 9995
x-ratelimit-cost: 5
{
"total": 41,
"items": [
{
"novel_id": 1234,
"translated_title": "Sword God",
"reading_status": "READING",
"current_chapter_number": 37
}
]
}
The same call in Python, with the requests library:
import os
import requests
API = "https://randomtranslator.com/api/v1"
session = requests.Session()
session.headers.update({
"Authorization": "Bearer " + os.environ["RT_KEY"],
"User-Agent": "my-shelf-bot/1.0",
})
r = session.get(f"{API}/user-novels/bookmarks", params={"limit": 2})
r.raise_for_status()
for row in r.json()["items"]:
print(row["translated_title"], "chapter", row["current_chapter_number"])
print("units left today:", r.headers.get("X-RateLimit-Remaining"))
And in JavaScript, with fetch in Node 18 or later:
const API = "https://randomtranslator.com/api/v1";
const res = await fetch(`${API}/user-novels/bookmarks?limit=2`, {
headers: {
Authorization: `Bearer ${process.env.RT_KEY}`,
"User-Agent": "my-shelf-bot/1.0",
},
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.detail}`);
for (const row of body.items) console.log(row.translated_title, row.current_chapter_number);
A good first session: call GET /limits/me to see your allowances, read your library, then open one novel with GET /novels/{id} and its glossary with GET /novels/{id}/entities. Every route is in the API reference.