---
title: "V1 Get Paper Repo"
method: GET
path: "/v1/papers/{arxiv_id}/repo"
tags: ["v1"]
---

# V1 Get Paper Repo

`GET /v1/papers/{arxiv_id}/repo`

## Request

- Base URL: `https://api.scholarfeed.org` (the document declares no server; this is the origin it was published from)
- URL: `https://api.scholarfeed.org/v1/papers/{arxiv_id}/repo`
- Auth: HTTP bearer

Fetch code/repo summary (README + file tree) for a paper (PAPI-08).

Looks up the paper's github_url in the DB, then queries the GitHub API for:
- README content (base64-decoded, truncated to 3000 chars)
- File tree (up to 100 blob paths, with truncation flag)

Both GitHub API calls are made in parallel via asyncio.gather.

GITHUB_TOKEN env var is optional. Without it, the GitHub API allows 60 req/hr
(unauthenticated); with it, 5000 req/hr.

Rate limit: 10/minute per API key (conservative — each call makes 2 GitHub API requests).

Response shape (success):
    owner: str
    repo: str
    readme: str | null   -- README content truncated to 3000 chars
    file_tree: list[str] -- up to 100 file paths from the repo root
    tree_truncated: bool -- True if the repo has >100 blobs (GitHub tree API limit)

Response shape (error):
    error: str   -- error code (repo_not_found, private_repo, github_rate_limited, invalid_github_url)
    detail: str  -- human-readable description

## Path parameters

- `arxiv_id` string, required

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/scholarfeed/apis/scholar-feed-api.md) · [All operations](https://skmtc.dev/scholarfeed/apis/scholar-feed-api/llms.txt) · [OpenAPI document](https://skmtc.dev/scholarfeed/apis/scholar-feed-api/revisions/fc3200d27505?raw)
