Skip to main content
The REST API is now versioned. For more information, see "About API versioning."

REST API endpoints for starring

Use the REST API to bookmark a repository.

About starring

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.

Starring versus watching

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.

New access restrictions

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.

List 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.

Fine-grained access tokens for "List stargazers"

This endpoint works with the following fine-grained token types:

The fine-grained token must have at least one of the following permission sets:

  • "Metadata" repository permissions (read)
  • "Contents" repository permissions (write)

This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested.

Parameters for "List stargazers"

Headers
Name, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Path parameters
Name, Type, Description
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.

Query parameters
Name, Type, Description
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

HTTP response status codes for "List stargazers"

Status codeDescription
200

OK

422

Validation failed, or the endpoint has been spammed.

Code samples for "List stargazers"

Request examples

get/repos/{owner}/{repo}/stargazers
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/stargazers

Default response

Status: 200
[ { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false } ]

Get stargazer 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.

Fine-grained access tokens for "Get stargazer count"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Metadata" repository permissions (read)

This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested.

Parameters for "Get stargazer count"

Headers
Name, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Path parameters
Name, Type, Description
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.

HTTP response status codes for "Get stargazer count"

Status codeDescription
200

OK

404

Resource not found

Code samples for "Get stargazer count"

Request example

get/repos/{owner}/{repo}/stargazers/count
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/stargazers/count

Response

Status: 200
{ "count": 42 }

Get repository star 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.

Fine-grained access tokens for "Get repository star history"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Metadata" repository permissions (read)

This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested.

Parameters for "Get repository star history"

Headers
Name, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Path parameters
Name, Type, Description
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.

Query parameters
Name, Type, Description
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

HTTP response status codes for "Get repository star history"

Status codeDescription
200

Repository star history

422

Validation failed, or the endpoint has been spammed.

Code samples for "Get repository star history"

Request example

get/repos/{owner}/{repo}/stargazers/history
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/stargazers/history

Repository star history

Status: 200
[ { "week": 1754784000, "total": 19, "days": [ 0, 12, 7, 0, 0, 0, 0 ] } ]

List repositories starred by the authenticated user

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.

Fine-grained access tokens for "List repositories starred by the authenticated user"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Starring" user permissions (read)

This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested.

Parameters for "List repositories starred by the authenticated user"

Headers
Name, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Query parameters
Name, Type, Description
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

HTTP response status codes for "List repositories starred by the authenticated user"

Status codeDescription
200

OK

304

Not modified

401