---
title: "Get website file content"
method: GET
path: "/api/hosting/v1/accounts/{username}/domains/{domain}/files/content"
tags: ["Hosting: Files"]
---

# Get website file content

`GET /api/hosting/v1/accounts/{username}/domains/{domain}/files/content`

Get a single file's content, relative to a website's document root.

Read-only; refuses symlinks, oversized files, non-text file types, and files identified as
containing secrets (e.g. credential files) — none of these are returned by this endpoint.

## Path parameters

- `username` string, required
- `domain` string, required

## Query parameters

- `path` string, required
- `from_line` integer, nullable
- `max_lines` integer, nullable

## Response `200`

Success response

- HostingV1FilesFileContentResource
  - `path` string, required — File path, relative to the document root.
  - `content` string, required — File content for the requested line range.
  - `from_line` integer, required — Line offset the returned content starts from.
  - `total_lines` integer, required — Total number of lines in the file.
  - `size_bytes` integer, required — Total file size in bytes.

## Other responses

- `401` — Unauthenticated response
- `422` — Validation error response
- `500` — Error response

---

[API](https://skmtc.net/hostinger/apis/hostinger-api.md) · [All operations](https://skmtc.net/hostinger/apis/hostinger-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hostinger/hostinger-api/revisions/3bf93dafc002/schema)
