Use the REST API to bookmark a repository.
You can use the REST API to star (bookmark) a repository. Stars are shown next to repositories to show an approximate level of interest. Stars have no effect on notifications or the activity feed. For more information, see Saving repositories with stars.
In August 2012, we changed the way watching
works on GitHub. Some API
client applications may still be using the original "watcher" endpoints for accessing
this data. You should now use the "star" endpoints instead (described
below). For more information, see REST API endpoints for watching and the changelog post.
In responses from the REST API, watchers, watchers_count, and stargazers_count correspond to the number of users that have starred a repository, whereas subscribers_count corresponds to the number of watchers.
In July 2026, to ensure responsible use of this data and to protect users from misuse, we are introducing new access restrictions to the endpoints related to starring. Access to the stargazers listing endpoints will be limited to admins and collaborators. For more information, see the changelog post.
Note
Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.
GET /repos/{owner}/{repo}/stargazers
Lists the people that have starred the repository.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github.star+json: Includes a timestamp of when the star was created.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/stargazers
Response schema (Status: 200):
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/stargazers
Response schema (Status: 200):
GET /repos/{owner}/{repo}/stargazers/count
Gets the current number of users who have starred the repository. Users who previously starred the repository but later removed their star are not included.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
200 - OK
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/stargazers/count
Response schema (Status: 200):
count: required, integer, minimum: 0GET /repos/{owner}/{repo}/stargazers/history
Returns repository stars grouped by calendar weeks, most recent first. Pages move backward toward the repository's creation week, and weeks within a page are ordered newest to oldest, so concatenating pages produces one continuous series. Weeks without stars contain zero counts. Week and day boundaries are not guaranteed to align with UTC. The days array contains the number of stars created on each day of the week, starting on Sunday.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
per_page (integer)
The number of results per page (max 30). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch (max 100). For more information, see "Using pagination in the REST API."
Default: 1
200 - Repository star history
422 - Validation failed, or the endpoint has been spammed.
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/stargazers/history
Response schema (Status: 200):
Array (maxItems: 30) of Stargazer History:
days: required, array of integertotal: required, integerweek: required, integerGET /user/starred
Lists repositories the authenticated user has starred.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github.star+json: Includes a timestamp of when the star was created.
accept (string)application/vnd.github+json is recommended.sort (string)
The property to sort the results by. created means when the repository was starred. updated means when the repository was last pushed to.
Default: created
Can be one of: created, updated
direction (string)
The direction to sort the results by.
Default: desc
Can be one of: asc, desc
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
200 - OK
304 - Not modified
401 - Requires authentication
403 - Forbidden
Request:
curl -L \
-X GET \
https://api.github.com/user/starred
Response schema (Status: 200):
Array of Repository:
id: required, integer, format: int64node_id: required, stringname: required, stringfull_name: required, stringlicense: required, any of:
key: required, stringname: required, stringurl: required, string or null, format: urispdx_id: required, string or nullnode_id: required, stringhtml_url: string, format: uriforks: required, integerpermissions: object:
admin: required, booleanpull: required, booleantriage: booleanpush: required, booleanmaintain: booleanowner: required, Simple User:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringprivate: required, boolean, default: falsehtml_url: required, string, format: uridescription: required, string or nullfork: required, booleanurl: required, string, format: uriarchive_url: required, stringassignees_url: required, stringblobs_url: required, stringbranches_url: required, stringcollaborators_url: required, stringcomments_url: required, stringcommits_url: required, stringcompare_url: required, stringcontents_url: required, stringcontributors_url: required, string, format: urideployments_url: required, string, format: uridownloads_url: required, string, format: urievents_url: required, string, format: uriforks_url: required, string, format: urigit_commits_url: required, stringgit_refs_url: required, stringgit_tags_url: required, stringgit_url: required, stringissue_comment_url: required, stringissue_events_url: required, stringissues_url: required, stringkeys_url: required, stringlabels_url: required, stringlanguages_url: required, string, format: urimerges_url: required, string, format: urimilestones_url: required, stringnotifications_url: required, stringpulls_url: required, stringreleases_url: required, stringssh_url: required, stringstargazers_url: required, string, format: uristatuses_url: required, stringsubscribers_url: required, string, format: urisubscription_url: required, string, format: uritags_url: required, string, format: uriteams_url: required, string, format: uritrees_url: required, stringclone_url: required, stringmirror_url: required, string or null, format: urihooks_url: required, string, format: urisvn_url: required, string, format: urihomepage: required, string or null, format: urilanguage: required, string or nullforks_count: required, integerstargazers_count: required, integerwatchers_count: required, integersize: required, integerdefault_branch: required, stringopen_issues_count: required, integeris_template: boolean, default: falsetopics: array of stringhas_issues: required, boolean, default: truehas_projects: required, boolean, default: truehas_wiki: required, boolean, default: truehas_pages: required, booleanhas_discussions: boolean, default: falsehas_pull_requests: boolean, default: truepull_request_creation_policy: string, enum: all, collaborators_onlyarchived: required, boolean, default: falsedisabled: required, booleanvisibility: string, default: "public"pushed_at: required, string or null, format: date-timecreated_at: required, string or null, format: date-timeupdated_at: required, string or null, format: date-timeallow_rebase_merge: boolean, default: truetemp_clone_token: stringallow_squash_merge: boolean, default: trueallow_auto_merge: boolean, default: falsedelete_branch_on_merge: boolean, default: falseallow_update_branch: boolean, default: falsesquash_merge_commit_title: string, enum: PR_TITLE, COMMIT_OR_PR_TITLEsquash_merge_commit_message: string, enum: PR_BODY, COMMIT_MESSAGES, BLANKmerge_commit_title: string, enum: PR_TITLE, MERGE_MESSAGEmerge_commit_message: string, enum: PR_BODY, PR_TITLE, BLANKallow_merge_commit: boolean, default: trueallow_forking: booleanweb_commit_signoff_required: boolean, default: falseopen_issues: required, integerwatchers: required, integerstarred_at: stringanonymous_access_enabled: booleancode_search_index_status: object:
lexical_search_ok: booleanlexical_commit_sha: stringRequest:
curl -L \
-X GET \
https://api.github.com/user/starred \
-H "Accept: application/vnd.github.v3.star+json"
Response schema (Status: 200):
Array of Starred Repository:
starred_at: required, string, format: date-timerepo: required, Repository:
id: required, integer, format: int64node_id: required, stringname: required, stringfull_name: required, stringlicense: required, any of:
key: required, stringname: required, stringurl: required, string or null, format: urispdx_id: required, string or nullnode_id: required, stringhtml_url: string, format: uriforks: required, integerpermissions: object:
admin: required, booleanpull: required, booleantriage: booleanpush: required, booleanmaintain: booleanowner: required, Simple User:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringprivate: required, boolean, default: falsehtml_url: required, string, format: uridescription: required, string or nullfork: required, booleanurl: required, string, format: uriarchive_url: required, stringassignees_url: required, stringblobs_url: required, stringbranches_url: required, stringcollaborators_url: required, stringcomments_url: required, stringcommits_url: required, stringcompare_url: required, stringcontents_url: required, stringcontributors_url: required, string, format: urideployments_url: required, string, format: uridownloads_url: required, string, format: urievents_url: required, string, format: uriforks_url: required, string, format: urigit_commits_url: required, stringgit_refs_url: required, stringgit_tags_url: required, stringgit_url: required, stringissue_comment_url: required, stringissue_events_url: required, stringissues_url: required, stringkeys_url: required, stringlabels_url: required, stringlanguages_url: required, string, format: urimerges_url: required, string, format: urimilestones_url: required, stringnotifications_url: required, stringpulls_url: required, stringreleases_url: required, stringssh_url: required, stringstargazers_url: required, string, format: uristatuses_url: required, stringsubscribers_url: required, string, format: urisubscription_url: required, string, format: uritags_url: required, string, format: uriteams_url: required, string, format: uritrees_url: required, stringclone_url: required, stringmirror_url: required, string or null, format: urihooks_url: required, string, format: urisvn_url: required, string, format: urihomepage: required, string or null, format: urilanguage: required, string or nullforks_count: required, integerstargazers_count: required, integerwatchers_count: required, integersize: required, integerdefault_branch: required, stringopen_issues_count: required, integeris_template: boolean, default: falsetopics: array of stringhas_issues: required, boolean, default: truehas_projects: required, boolean, default: truehas_wiki: required, boolean, default: truehas_pages: required, booleanhas_discussions: boolean, default: falsehas_pull_requests: boolean, default: truepull_request_creation_policy: string, enum: all, collaborators_onlyarchived: required, boolean, default: falsedisabled: required, booleanvisibility: string, default: "public"pushed_at: required, string or null, format: date-timecreated_at: required, string or null, format: date-timeupdated_at: required, string or null, format: date-timeallow_rebase_merge: boolean, default: truetemp_clone_token: stringallow_squash_merge: boolean, default: trueallow_auto_merge: boolean, default: falsedelete_branch_on_merge: boolean, default: falseallow_update_branch: boolean, default: falsesquash_merge_commit_title: string, enum: PR_TITLE, COMMIT_OR_PR_TITLEsquash_merge_commit_message: string, enum: PR_BODY, COMMIT_MESSAGES, BLANKmerge_commit_title: string, enum: PR_TITLE, MERGE_MESSAGEmerge_commit_message: string, enum: PR_BODY, PR_TITLE, BLANKallow_merge_commit: boolean, default: trueallow_forking: booleanweb_commit_signoff_required: boolean, default: falseopen_issues: required, integerwatchers: required, integerstarred_at: stringanonymous_access_enabled: booleancode_search_index_status: object:
lexical_search_ok: booleanlexical_commit_sha: stringGET /user/starred/{owner}/{repo}
Whether the authenticated user has starred the repository.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
204 - Response if this repository is starred by you
304 - Not modified
401 - Requires authentication
403 - Forbidden
404 - Not Found if this repository is not starred by you
Request:
curl -L \
-X GET \
https://api.github.com/user/starred/OWNER/REPO
Response schema (Status: 204):
PUT /user/starred/{owner}/{repo}
Note that you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP method."
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
204 - No Content
304 - Not modified
401 - Requires authentication
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X PUT \
https://api.github.com/user/starred/OWNER/REPO
Response schema (Status: 204):
DELETE /user/starred/{owner}/{repo}
Unstar a repository that the authenticated user has previously starred.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
204 - No Content
304 - Not modified
401 - Requires authentication
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X DELETE \
https://api.github.com/user/starred/OWNER/REPO
Response schema (Status: 204):
GET /users/{username}/starred
Lists repositories a user has starred.
If the specified user has a private profile, this endpoint returns an empty list unless the request is authenticated as that user. A request authenticated as the specified user returns starred repositories visible to the token even if the token has no OAuth scopes.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github.star+json: Includes a timestamp of when the star was created.
accept (string)application/vnd.github+json is recommended.username (string) (required)
The handle for the GitHub user account.
sort (string)
The property to sort the results by. created means when the repository was starred. updated means when the repository was last pushed to.
Default: created
Can be one of: created, updated
direction (string)
The direction to sort the results by.
Default: desc
Can be one of: asc, desc
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
Request:
curl -L \
-X GET \
https://api.github.com/users/USERNAME/starred
Response schema (Status: 200):
Same response schema as List stargazers.