Skip to content

Get a specific repository of a user

GET /api/v5/repos/{owner}/{repo}

Call this endpoint to get the details of a specific repository of the specified user, including basic repository attributes, the namespace it belongs to, the creator, clone URLs, star and fork counts, the default branch, and privacy status.

Supported access tokens

  • AtomGit user access token (AtomGit user access tokens)

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Namespace address path of the repository (address path of the organization or user)
repo path string Yes Repository path (path)
access_token query string Yes User authorization code

Response parameters

Field Type Always returned Nullable Description
id integer Yes No Repository ID
full_name string Yes No Repository full name (namespace/path)
human_name string Yes No Repository human-readable name
url string Yes No Repository API URL
namespace object Yes No Namespace information of the repository
path string Yes No Repository path (path)
name string Yes No Repository name
description string Yes Yes Repository description
status string Yes No Repository status: 0 means start (repository not archived), 2 means closed (repository archived)
ssh_url_to_repo string Yes No SSH clone URL
http_url_to_repo string Yes No HTTP clone URL
web_url string Yes No Repository web URL
readme_url string Yes No README URL
created_at string Yes No Creation time
updated_at string Yes No Update time
creator object Yes No Creator information
members string[] Yes No Member list
forks_count integer Yes No Number of forks
stargazers_count integer Yes No Number of stars
project_labels object[] Yes Yes Repository label list
license string Yes Yes Open source license
internal integer Yes No Whether the repository is internal
open_issues_count integer Yes No Number of open issues
watchers_count integer Yes No Number of followers
assignees_number integer Yes No Number of assignees
enterprise object Yes Yes Enterprise information
default_branch string Yes No Default branch
fork integer Yes No Whether the repository is a fork
owner object Yes No Repository owner information
assigner object Yes Yes Assigner information
issue_template_source string Yes Yes Issue template source
private integer Yes No Whether the repository is private
public integer Yes No Whether the repository is public

namespace object

Field Type Always returned Nullable Description
namespace.id integer Yes No Namespace ID
namespace.name string Yes No Namespace name
namespace.path string Yes No Namespace path(path)
namespace.html_url string Yes No Namespace web URL

creator object

Field Type Always returned Nullable Description
creator.id string Yes No Creator ID
creator.arts_id string Yes No Creator arts ID
creator.username string Yes No Creator username
creator.nickname string Yes No Creator nickname
creator.email string Yes No Creator email
creator.photo string Yes No Creator avatar URL

enterprise object

Field Type Always returned Nullable Description
enterprise.id integer Yes No Enterprise ID
enterprise.path string Yes No Enterprise path (path)
enterprise.html_url string Yes No Enterprise web URL
enterprise.type string Yes No Enterprise type

owner object

Field Type Always returned Nullable Description
owner.id string Yes No Owner ID
owner.login string Yes No Owner login name
owner.name string Yes No Owner name
owner.type string Yes No Owner type

assigner object

Field Type Always returned Nullable Description
assigner.id string Yes No Assigner ID
assigner.login string Yes No Assigner login name
assigner.name string Yes No Assigner name
assigner.type string Yes No Assigner type

project_labels array elements

Each array element is an object; the exact structure depends on the actual response.

Error response

Besides a successful response, callers also need to know what a failure looks like. This endpoint requires authentication, and it also returns a failure when the requested repository does not exist.

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

404 Resource not found

{
  "error": "not_found",
  "message": "Repository does not exist"
}

The actual error field names returned by the backend take precedence.

HTTP status codes

Status code Description
200 Success (OK)
304 Not modified
401 Requires authentication
403 Forbidden
404 Not found

Request example

Parameter notes

The examples are consistent with the rest of this document; copying them as-is produces a successful call. The placeholders mean the following:

<owner> Replace with the namespace address path of the repository (address path of the organization or user); <repo> Replace with the repository path; <token> Replace with your AtomGit user access token.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>?access_token=<token>' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const owner = "<owner>";
const repo = "<repo>";
const token = "<token>";

const response = await fetch(`https://api.atomgit.com/api/v5/repos/${owner}/${repo}?access_token=${token}`, {
  headers: {
    "Accept": "application/json",
  },
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);

Python

import requests

owner = "<owner>"
repo = "<repo>"
token = "<token>"

resp = requests.get(
    f"https://api.atomgit.com/api/v5/repos/{owner}/{repo}",
    params={"access_token": token},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "id": 4250980,
  "full_name": "aron1/Model10123001",
  "human_name": "aron1 / Model10123001",
  "url": "https://api.atomgit.com/api/v5/repos/aron1/Model10123001",
  "namespace": {
    "id": 1364544,
    "name": "aron1",
    "path": "aron1",
    "html_url": "https://api.atomgit.com/aron1"
  },
  "path": "Model10123001",
  "name": "Model10123001",
  "description": "",
  "status": "closed",
  "ssh_url_to_repo": "git@atomgit.com:aron1/Model10123001.git",
  "http_url_to_repo": "https://api.atomgit.com/aron1/Model10123001.git",
  "web_url": "https://api.atomgit.com/aron1/Model10123001",
  "readme_url": "https://api.atomgit.com/aron1/Model10123001/blob/main/README.md",
  "created_at": "2024-10-22T22:14:06.922+08:00",
  "updated_at": "2024-12-02T18:37:23.426+08:00",
  "creator": {
    "id": "660ba866683c570b25be06c8",
    "arts_id": "332008",
    "username": "aron1",
    "nickname": "yanfan",
    "email": "aron1@noreply.atomgit.com",
    "photo": "https://api.atomgit.com/images/avatar.png"
  },
  "members": ["aron1"],
  "forks_count": 0,
  "stargazers_count": 1,
  "project_labels": [],
  "license": "Apache_License_v2.0",
  "internal": 0,
  "open_issues_count": 0,
  "watchers_count": 0,
  "assignees_number": 0,
  "enterprise": {
    "id": 1364544,
    "path": "aron1",
    "html_url": "https://api.atomgit.com/aron1",
    "type": "user"
  },
  "default_branch": "main",
  "fork": 0,
  "owner": {
    "id": "332008",
    "login": "aron1",
    "name": "yanfan",
    "type": "User"
  },
  "assigner": {
    "id": "332008",
    "login": "aron1",
    "name": "yanfan",
    "type": "User"
  },
  "issue_template_source": "project",
  "private": 1,
  "public": 0
}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access token)
400 Invalid parameters or unparseable request
403 No permission to access this resource
404 The requested repository does not exist
429 Too many requests; rate limit triggered
500 Internal system error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc