For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get Node.js runtime logs

Returns the Node.js application's runtime console log entries, oldest first, each with timestamp, level and message.

Get Node.js runtime logs

get

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.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
usernamestringRequiredExample: u123456789
domainstringRequired

Domain name

Example: mydomain.tld
Query parameters
periodstring · enumOptional

Time window for the first fetch. Required when from_line is not sent.

Example: 1hPossible values:
from_lineinteger · min: 1Optional

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.

Example: 5042
limitinteger · min: 1 · max: 5000Optional

Maximum number of log entries to return. When more entries match, the newest are kept.

Default: 1000Example: 200
Responses
200

Success response

application/json
started_atstring · date-time · nullableRequired

Timestamp of the first line of the log file; null when the file is empty or its first line has no timestamp field

Example: 2026-03-03T09:11:02Z
total_linesintegerRequired

Total number of lines in the raw log file. Send total_lines + 1 as from_line in the next poll to receive only new entries.

Example: 5042
last_deployed_atstring · date-time · nullableRequired

Time of the last completed build; entries before it belong to the previous deployment. null when no build has completed yet.

Example: 2026-03-03T08:58:41Z
get/api/hosting/v1/accounts/{username}/websites/{domain}/nodejs/runtime-logs
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?