Skip to content

Get Organization Repository List

GET /api/v5/orgs/{org}/repos

Users call this endpoint to obtain the list of projects (repositories) under the specified organization.

Access Token Support

  • AtomGit user access tokens

Whether Anonymous Access Is Allowed

This endpoint allows anonymous access.

Request Parameters

Parameter Name Location Type Required Description
org path string Yes Path (path/login) of the organization
type query string No Type for filtering public/private repositories. Enum: all / public / private; default all
page query integer No Current page number, default 1
per_page query integer No Number per page, maximum 100, default 20
repo_type query string No Repository type filter. Enum: code (code repository) / model (model repository) / dataset (dataset repository) / space / all (all repository types); default code

Response Parameters

The response body is an array (array). Each array element is a repository (Repository) object. The fields are described below.

Field Type Always Returned Nullable Description
id integer Yes No Repository ID
full_name string Yes No Full repository name (e.g., owner/name)
namespace object Yes No Namespace information
path string Yes No Repository path
name string Yes No Repository name
internal boolean Yes No Whether it is an internal repository
fork boolean Yes No Whether it is a forked repository
html_url string Yes No HTML URL of the repository
forks_count integer Yes No Number of forks
stargazers_count integer Yes No Number of stars
watchers_count integer Yes No Number of watchers
default_branch string Yes No Default branch name
open_issues_count integer Yes No Number of open issues
project_creator string Yes No Project creator
pushed_at string Yes No Last push time
created_at string Yes No Creation time
updated_at string Yes No Update time
status string Yes No Repository status, 0: started (repository not archived), 2: closed (repository archived)
language string Yes No Primary programming language
repo_type string Yes No Repository type
parent object Yes No Parent repository information (fork source)
private boolean Yes No Whether it is a private repository
public boolean Yes No Whether it is a public repository
description string Yes No Repository description
license string No Yes Open-source license, may be null

namespace Object

Field Type Always Returned Nullable Description
namespace.id integer Yes No Namespace ID
namespace.type string Yes No Namespace type (e.g., group)
namespace.name string Yes No Namespace name
namespace.path string Yes No Namespace path
namespace.html_url string Yes No HTML URL of the namespace

parent Object

Field Type Required Nullable Description
parent.id integer Yes No Parent repository ID
parent.full_name string Yes No Parent repository full name
parent.human_name string Yes No Parent repository human-readable name
parent.namespace object Yes No Namespace information of the parent repository
parent.path string Yes No Parent repository path
parent.name string Yes No Parent repository name
parent.description string Yes No Parent repository description
parent.ssh_url_to_repo string Yes No SSH URL of the parent repository
parent.http_url_to_repo string Yes No HTTP URL of the parent repository
parent.web_url string Yes No Web URL of the parent repository
parent.created_at string Yes No Parent repository creation time
parent.updated_at string Yes No Parent repository update time
parent.repo_type string Yes No Parent repository type
parent.private boolean Yes No Whether the parent repository is private
parent.public boolean Yes No Whether the parent repository is public

parent.namespace object

Field Type Required Nullable Description
parent.namespace.id integer Yes No Namespace ID
parent.namespace.type string Yes No Namespace type
parent.namespace.name string Yes No Namespace name
parent.namespace.path string Yes No Namespace path
parent.namespace.full_name string Yes No Namespace full name
parent.namespace.full_path string Yes No Namespace full path

Failure response

This API may return a failure response in cases such as invalid parameters, authentication failure, or the organization not existing. The error field names are subject to what the backend actually returns.

400 Invalid parameter

{
  "message": "参数 type 取值不合法"
}

401 Unauthenticated

{
  "message": "缺少或无效的访问令牌"
}

404 Organization not found

{
  "message": "未找到该组织"
}

HTTP response status codes

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

Request example

Parameter description

Replace <org> with the organization's path (path/login), e.g. openharmony; This API allows anonymous access, and you can also carry an AtomGit user access token.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/orgs/<org>/repos?type=all&page=1&per_page=20&repo_type=code' \
  -H 'Accept: application/json'

JavaScript

// 原生 fetch (Node.js 18+ / 浏览器)
const response = await fetch("https://api.atomgit.com/api/v5/orgs/<org>/repos?type=all&page=1&per_page=20&repo_type=code", {
  headers: {
    "Accept": "application/json",
  },
});

if (!response.ok) {
  throw new Error(`请求失败: ${response.status}`);
}

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

Python

import requests

resp = requests.get(
    "https://api.atomgit.com/api/v5/orgs/<org>/repos",
    params={
        "type": "all",
        "page": 1,
        "per_page": 20,
        "repo_type": "code",
    },
    headers={
        "Accept": "application/json",
    },
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

[
  {
    "id": 29724198,
    "full_name": "openharmony/.gitee",
    "namespace": {
      "id": 6486504,
      "type": "group",
      "name": "OpenHarmony",
      "path": "openharmony",
      "html_url": "https://api.atomgit.com/openharmony"
    },
    "path": ".gitee",
    "name": ".gitee",
    "description": "",
    "private": false,
    "public": true,
    "internal": false,
    "fork": false,
    "html_url": "https://api.atomgit.com/openharmony/.gitee.git",
    "forks_count": 4,
    "stargazers_count": 0,
    "watchers_count": 1,
    "default_branch": "master",
    "open_issues_count": 0,
    "license": null,
    "project_creator": "landwind",
    "pushed_at": "2024-02-06T18:25:26+08:00",
    "created_at": "2023-06-16T10:55:42+08:00",
    "updated_at": "2024-03-29T14:59:46+08:00",
    "status": "0",
    "repo_type": "code"
  }
]

Error Codes

Error Code Description
401 Unauthenticated or invalid credentials (missing/invalid access credentials)
400 Invalid parameters or the request could not be parsed
404 The request path does not exist or the organization does not exist
405 The request method is not supported
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