---
title: "Get contents of multiple files from a remote public git repository in a single call. Reduces round-trips when you need to read several related files. Max 10 files per batch, 5000 total lines budget across all files. Each file supports optional line ranges. Failed files return per-file errors without blocking other files."
method: POST
path: "/api/v1/code_get_files"
---

# Get contents of multiple files from a remote public git repository in a single call. Reduces round-trips when you need to read several related files. Max 10 files per batch, 5000 total lines budget across all files. Each file supports optional line ranges. Failed files return per-file errors without blocking other files.

`POST /api/v1/code_get_files`

## Query parameters

- `client` string, required

## Request body

- object
  - `max_lines` integer — Per-file safety cap on lines returned (cap: 2000).
  - `paths` object[], required — List of files to read. Each entry has a path and optional line range.
    - `end_line` integer — Last line to return (inclusive). If omitted, returns to end of file.
    - `path` string, required — File path relative to repository root
    - `start_line` integer — First line to return (1-based).
  - `repository` string, required — Git URL of a public remote repository

## Response `200`

Successful response

- object

## Other responses

- `400` — Bad request (invalid params or missing client)
- `404` — Repository or file not found
- `429` — Rate limited
- `500` — Internal server error
- `502` — Bad gateway (upstream clone failure)
- `503` — Service unavailable (clone queue full)

---

[API](https://skmtc.dev/searchcode/apis/searchcode-rest-api.md) · [All operations](https://skmtc.dev/searchcode/apis/searchcode-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/searchcode/searchcode-rest-api/revisions/24a0730a30a6/schema)
