---
title: "Github Read"
method: POST
path: "/github/read"
tags: ["GitHub Search"]
---

# Github Read

`POST /github/read`

Read a file from a GitHub repository with optional line range.

## Request body

- GitHubReadRequest
  - `repository` string, required — Repository in owner/repo format
  - `path` string, required — File path within the repository
  - `ref` string — Branch, tag, or commit SHA
  - `start_line` integer, nullable — 1-based start line
  - `end_line` integer, nullable — 1-based end line (inclusive)

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/trynia/apis/nia-ai-api.md) · [All operations](https://skmtc.net/trynia/apis/nia-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trynia/nia-ai-api/versions/d216ffc3efb6/schema)
