---
title: "Retrieve file archive from a repository"
method: GET
path: "/api/v4/projects/{id}/repository/archive"
tags: ["repositories"]
---

# Retrieve file archive from a repository

`GET /api/v4/projects/{id}/repository/archive`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/projects/{id}/repository/archive`
- Auth: none declared

Retrieves the file archive of a specified repository. This endpoint can be accessed without authentication if the repository is publicly accessible. For GitLab.com users, this endpoint has a rate limit threshold of 5 requests per minute.

## Path parameters

- `id` string, required

## Query parameters

- `sha` string
- `ref_type` 'heads' | 'tags'
- `format` string
- `path` string
- `include_lfs_blobs` boolean
- `exclude_paths` string[]

## Response `200`

Retrieve file archive from a repository

---

[API](https://skmtc.dev/gitlab/apis/gitlab-api.md) - [All operations](https://skmtc.dev/gitlab/apis/gitlab-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitlab/apis/gitlab-api/revisions/b234947ef3f2?raw)
