Skip to content

List users who are watching the repository

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

The user calls this endpoint to list the users who are watching the repository.

Access token support

  • AtomGit user access tokens (AtomGit user access tokens)

Anonymous access allowed?

This endpoint allows anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Address path of the namespace the repository belongs to (the address path of an enterprise, organization, or individual)
repo path string Yes Repository path (path)
page query integer No Current page number
per_page query integer No Number of items per page, maximum 100, default 20
watched_after query string No Watch time after this time
watched_before query string No Watch time before this time

Response parameters

Array element

Field Type Always returned Nullable Description
id integer Yes No User ID
login string Yes No User login name
name string Yes No User name
avatar_url string Yes No User avatar address
watch_at string Yes No Watch time, format e.g. 2024-11-13T16:15:53.287+08:00

Error response

400 Parameter error

{
  "error": "invalid_request",
  "message": "Invalid request parameters"
}

401 Unauthenticated

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

Note: The actual error response field names are subject to what the backend returns; the example above is only a common form.

HTTP response status codes

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

Request example

Parameter description

Replace <owner> with the address path of the namespace the repository belongs to (the address path of an enterprise, organization, or individual); replace <repo> with the repository path (path).

This endpoint allows anonymous access, so the example does not include an access token; if you need to include one, append ?access_token=<token> to the URL.

cURL

curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/subscribers?page=1&per_page=20' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/repos/<owner>/<repo>/subscribers?page=1&per_page=20", {
  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

resp = requests.get(
    "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/subscribers",
    params={"page": 1, "per_page": 20},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

[
  {
    "id": 496,
    "login": "xiaogang",
    "name": "xiaogang",
    "avatar_url": "https://api.atomgit.com/uploads/avatar/xiaogang.jpg",
    "watch_at": "2024-11-13T16:15:53.287+08:00"
  }
]

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing/invalid access credentials)
400 Parameter error or the request cannot be parsed
404 Request path does not exist
405 Request method 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