Skip to content

List repository activities

GET
/repos/{owner}/{repo}/activity

Lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users.

For more information about viewing repository activity, see “Viewing activity and data for your repository.”

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

direction
string
default: desc
Allowed values: asc desc

The direction to sort the results by.

per_page
integer
default: 30

The number of results per page (max 100). For more information, see “Using pagination in the REST API.”

before
string

A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see “Using pagination in the REST API.”

after
string

A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see “Using pagination in the REST API.”

ref
string

The Git reference for the activities you want to list.

The ref for a branch can be formatted either as refs/heads/BRANCH_NAME or BRANCH_NAME, where BRANCH_NAME is the name of your branch.

actor
string

The GitHub username to use to filter by the actor who performed the activity.

time_period
string
Allowed values: day week month quarter year

The time period to filter by.

For example, day will filter for activity that occurred in the past 24 hours, and week will filter for activity that occurred in the past 7 days (168 hours).

activity_type
string
Allowed values: push force_push branch_creation branch_deletion pr_merge merge_queue_merge

The activity type to filter by.

For example, you can choose to filter by “force_push”, to see all force pushes to the repository.

Response

Media type application/json
Array<object>
Activity

Activity

object
id
required
integer
node_id
required
string
before
required

The SHA of the commit before the activity.

string
after
required

The SHA of the commit after the activity.

string
ref
required

The full Git reference, formatted as refs/heads/<branch name>.

string
timestamp
required

The time when the activity occurred.

string format: date-time
activity_type
required

The type of the activity that was performed.

string
Allowed values: push force_push branch_deletion branch_creation pr_merge merge_queue_merge
actor
required
Simple User

A GitHub user.

object
name
string
nullable
email
string
nullable
login
required
string
id
required
integer format: int64
node_id
required
string
avatar_url
required
string format: uri
gravatar_id
required
string
nullable
url
required
string format: uri
html_url
required
string format: uri
followers_url
required
string format: uri
following_url
required
string
gists_url
required
string
starred_url
required
string
subscriptions_url
required
string format: uri
organizations_url
required
string format: uri
repos_url
required
string format: uri
events_url
required
string
received_events_url
required
string format: uri
type
required
string
site_admin
required
boolean
starred_at
string
user_view_type
string
Examples
Example default
[
{
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"before": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"after": "827efc6d56897b048c772eb4087f854f46256132",
"ref": "refs/heads/main",
"pushed_at": "2011-01-26T19:06:43Z",
"push_type": "normal",
"pusher": {
"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
}
}
]
Link
string
Example
<https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last"

Validation failed, or the endpoint has been spammed.

Media type application/json
Validation Error Simple

Validation Error Simple

object
message
required
string
documentation_url
required
string
errors
Array<string>
Example generated
{
"message": "example",
"documentation_url": "example",
"errors": [
"example"
]
}