List repositories starred by the authorized user¶
GET /api/v5/user/starred
Call this endpoint to list repositories starred by the authorized user.
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 |
|---|---|---|---|---|
access_token |
query | string | Yes | User authorization code |
sort |
query | string | No | Sort order, enum: created / last_push; sorts by repository creation time (created) or last push time (last_push); default: creation time |
direction |
query | string | No | Sort direction, enum: asc / desc; default: descending |
page |
query | integer | No | Current page number |
per_page |
query | integer | No | Number of items per page; maximum 100, default 20 |
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
| (response body) | array<object> |
Yes | No | List of repositories starred by the authorized user; each element is a repository object described below |
repository object (array element)
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
id |
integer | — | — | Repository ID |
full_name |
string | — | — | Repository full name(owner/name) |
human_name |
string | — | — | Repository readable name |
url |
string | — | — | Repository API URL |
namespace |
object | — | — | Namespace information, see below |
path |
string | — | — | Repository path |
name |
string | — | — | Repository name |
parent_full_name |
string | — | — | Parent repository full name |
description |
string | — | — | Repository description |
status |
string | — | — | Repository status |
ssh_url_to_repo |
string | — | — | SSH clone URL |
http_url_to_repo |
string | — | — | HTTP clone URL |
web_url |
string | — | — | Repository web URL |
created_at |
string | — | — | Creation time |
updated_at |
string | — | — | Update time |
homepage |
string | — | — | Homepage URL |
members |
string[] | — | — | Member list |
parent |
object | — | — | Parent repository information, see below |
forks_count |
integer | — | — | Number of forks |
stargazers_count |
integer | — | — | Number of stars |
relation |
string | — | — | Relation |
permission |
object | — | — | Permissions of the current user on the repository, see below |
internal |
integer | — | — | Whether the repository is internal |
open_issues_count |
integer | — | — | Number of open issues |
has_issue |
integer | — | — | Whether the issue feature is enabled |
has_issues |
integer | — | — | Whether the repository has issuess |
watchers_count |
integer | — | — | Number of followers |
enterprise |
object | — | — | Enterprise information, see below |
default_branch |
string | — | — | Default branch |
fork |
integer | — | — | Whether the repository is a fork |
pushed_at |
string | — | — | Last push time |
owner |
object | — | — | Repository owner information, see below |
issue_template_source |
string | — | — | Issue template source |
project_creator |
string | — | — | Project creator |
private |
integer | — | — | Whether the repository is private |
public |
integer | — | — | Whether the repository is public |
namespace object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
namespace.id |
integer | — | — | Namespace ID |
namespace.type |
string | — | — | Namespace type |
namespace.name |
string | — | — | Namespace name |
namespace.path |
string | — | — | Namespace path |
namespace.html_url |
string | — | — | Namespace web URL |
parent object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
parent.full_name |
string | — | — | Parent repository full name |
parent.human_name |
string | — | — | Parent repository readable name |
permission object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
permission.pull |
integer | — | — | Pull permission |
permission.push |
integer | — | — | Push permission |
permission.admin |
integer | — | — | Administrator permission |
enterprise object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
enterprise.id |
integer | — | — | Enterprise ID |
enterprise.path |
string | — | — | Enterprise path |
enterprise.html_url |
string | — | — | Enterprise web URL |
enterprise.type |
string | — | — | Enterprise type |
owner object
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
owner.id |
string | — | — | Owner ID |
owner.login |
string | — | — | OwnerLogin name |
owner.name |
string | — | — | OwnerName |
owner.type |
string | — | — | OwnerType |
Error response¶
This endpoint requires user authentication. It returns 401 when the user is unauthenticated or the access token is missing or invalid, and 400 when parameter validation fails. The actual error field names returned by the backend take precedence over those in the examples below.
400 Invalid parameters
401 Unauthenticated
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
400 |
Bad request |
401 |
Requires authentication |
403 |
Forbidden |
Request example¶
Parameter notes¶
All example calls below must carry a user access token.
<token>Replace with your AtomGit user access token.
cURL¶
curl -X GET 'https://api.atomgit.com/api/v5/user/starred?access_token=<token>&sort=created&direction=desc&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/user/starred?access_token=<YOUR-TOKEN>&sort=created&direction=desc&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/user/starred",
params={
"access_token": "<YOUR-TOKEN>",
"sort": "created",
"direction": "desc",
"page": 1,
"per_page": 20,
},
headers={
"Accept": "application/json",
},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
[
{
"id": 777621,
"full_name": "xiaogang/private-new2",
"human_name": "xiaogang / private-new2",
"url": "https://api.atomgit.com/api/v5/repos/xiaogang/private-new2",
"namespace": {
"id": 137117,
"type": "user",
"name": "xiaogang",
"path": "xiaogang",
"html_url": "https://api.atomgit.com/xiaogang"
},
"path": "private-new2",
"name": "private-new2",
"parentfull_name": "xiaogang_test/private-new",
"description": "Trump",
"status": "started",
"ssh_url_to_repo": "ssh://git@atomgit.com:2222/xiaogang/private-new2.git",
"http_url_to_repo": "https://api.atomgit.com/xiaogang/private-new2.git",
"web_url": "https://api.atomgit.com/xiaogang/private-new2",
"created_at": "2024-12-11T17:41:14.536+08:00",
"updated_at": "2024-12-11T17:41:14.536+08:00",
"homepage": "https://api.atomgit.com/xiaogang/private-new2",
"members": [
"xiaogang"
],
"parent": {
"full_name": "xiaogang_test/private-new",
"human_name": "xiaogang_test / private-new"
},
"forks_count": 0,
"stargazers_count": 1,
"relation": "master",
"permission": {
"pull": true,
"push": true,
"admin": true
},
"internal": false,
"open_issues_count": 0,
"has_issue": false,
"has_issues": false,
"watchers_count": 0,
"enterprise": {
"id": 137117,
"path": "xiaogang",
"html_url": "https://api.atomgit.com/xiaogang",
"type": "user"
},
"default_branch": "main",
"fork": true,
"pushed_at": "2024-12-20T19:14:34.979+08:00",
"owner": {
"id": "496",
"login": "xiaogang",
"name": "Xiao Gang",
"type": "User"
},
"issue_template_source": "project",
"project_creator": "xiaogang",
"private": false,
"public": true
}
]
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access token) |
400 |
Invalid parameters or unparseable request |
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