Get Node.js runtime logs
Returns the Node.js application's runtime console log entries, oldest first, each with timestamp, level and message.
Returns the Node.js application's runtime console log entries, oldest first, each with
timestamp, level and message. On the first call send period (1h, 1d, 1w or 1m)
and optionally levels and limit (1-5000, default 1000); when more entries match than
limit, the newest are kept.
To poll for new entries send total_lines + 1 from the previous response as from_line
and omit period; period and from_line cannot be combined. Lines that are not JSON
with a timestamp, level and message are skipped, so logs may hold fewer than limit
entries while total_lines counts every raw line. Entries with a timestamp before
last_deployed_at belong to the previous deployment. Returns an empty logs list when
the application has not written a log file yet.
API Token authentication
u123456789Domain name
mydomain.tldTime window for the first fetch. Required when from_line is not sent.
1hPossible values: 1-based line of the log file to start from. For polling send total_lines + 1 from the
previous response. Cannot be combined with period.
5042Maximum number of log entries to return. When more entries match, the newest are kept.
1000Example: 200Success response
Timestamp of the first line of the log file; null when the file is empty or its first line has no timestamp field
2026-03-03T09:11:02ZTotal number of lines in the raw log file. Send total_lines + 1 as from_line in the next poll to receive only new entries.
5042Time of the last completed build; entries before it belong to the previous deployment. null when no build has completed yet.
2026-03-03T08:58:41ZUnauthenticated response
Validation error response
Error response
GET /api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/runtime-logs HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"logs": [
{
"timestamp": "2026-03-03T09:11:02.001Z",
"level": "INFO",
"message": "Server started on port 3000"
}
],
"started_at": "2026-03-03T09:11:02Z",
"total_lines": 5042,
"last_deployed_at": "2026-03-03T08:58:41Z"
}Last updated
Was this helpful?