---
title: "Detect and parse a `.env.example`-style file for a public repository (supports GitHub and GitLab)"
method: GET
path: "/git/public/{provider}/{owner}/{repo}/env-example"
tags: ["Public Repositories"]
---

# Detect and parse a \`.env.example\`-style file for a public repository (supports GitHub and GitLab)

`GET /git/public/{provider}/{owner}/{repo}/env-example`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/git/public/{provider}/{owner}/{repo}/env-example`
- Auth: none declared

## Path parameters

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

## Query parameters

- `base_url` string, nullable
- `branch` string, nullable
- `root_directory` string, nullable

## Response `200`

Detected env-example variables

- PublicEnvExampleResponse: Response for env-example detection
  - `branch` string, required: Branch the file was read from
  - `path` string, nullable: Path of the detected env-example file (e.g. ".env.example"), `null` if the repository has none
  - `variables` EnvExampleVariable[], required: Parsed variables (empty if no env-example file was found)
    - `default_value` string, required: Placeholder/default value as written in the file (may be empty)
    - `description` string, nullable: Description derived from a `# comment` immediately preceding the variable in the file, if any
    - `key` string, required: Variable name (e.g. "DATABASE_URL")

## Other responses

- `400`: Provider not supported
- `401`: Authentication required for custom GitLab origins
- `403`: Git provider permission required
- `404`: Repository or branch not found
- `429`: API rate limit exceeded
- `500`: Internal server error

## Changes

- **2026-09-07** `2a40922f832c`: 3 info
  - added the new optional `query` request parameter `base_url`
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
- **2026-09-07** `2b95ed4ff1d2`: 1 warning, 1 info
  - deleted the `query` request parameter `fresh`
  - added the new optional `query` request parameter `root_directory`
- **2026-09-07** `38e97c3c35dd`: 1 info
  - endpoint added
- **2026-09-07** `f7404eb7ac98`: 1 breaking
  - api path removed without deprecation
- **2026-08-30** `4bab5a6e64b5`: 3 info
  - added the new optional `query` request parameter `base_url`
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/git/public/:provider/:owner/:repo/env-example/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
