---
title: "Get a repository README"
method: GET
path: "/repos/{owner}/{repo}/readme"
tags: ["repos"]
---

# Get a repository README

`GET /repos/{owner}/{repo}/readme`

Gets the preferred README for a repository.

READMEs support [custom media types](https://docs.github.com/enterprise-server@3.7/rest/overview/media-types) for retrieving the raw content or rendered HTML.

## Path parameters

- `owner` string, required
- `repo` string, required

## Query parameters

- `ref` string

## Response `200`

Response

- ContentFile — Content File
  - `type` 'file', required
  - `encoding` string, required
  - `size` integer, required
  - `name` string, required
  - `path` string, required
  - `content` string, required
  - `sha` string, required
  - `url` string, uri, required
  - `git_url` string, uri, nullable, required
  - `html_url` string, uri, nullable, required
  - `download_url` string, uri, nullable, required
  - `_links` object, required
    - `git` string, uri, nullable, required
    - `html` string, uri, nullable, required
    - `self` string, uri, required
  - `target` string
  - `submodule_git_url` string

## Other responses

- `404` — Resource not found
- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-6.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-6/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-6/versions/15db3fa0759b/schema)
