v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
repos

List repository activities

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

get/repos/{owner}/{repo}/activity

Path parameters

ownerstring required

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

repostring required

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

Query parameters

direction'asc' | 'desc'

The direction to sort the results by.

per_pageinteger

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

beforestring

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

afterstring

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

refstring

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.

actorstring

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

time_period'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'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

Response

idinteger required
node_idstring required
beforestring required

The SHA of the commit before the activity.

afterstring required

The SHA of the commit after the activity.

refstring required

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

timestampstring date-time required

The time when the activity occurred.

activity_type'push' | 'force_push' | 'branch_deletion' | 'branch_creation' | 'pr_merge' | 'merge_queue_merge' required

The type of the activity that was performed.

Example response

[
  {
    "id": 1296269,
    "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
    "before": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
    "after": "827efc6d56897b048c772eb4087f854f46256132",
    "ref": "refs/heads/main",
    "timestamp": "2011-01-26T19:06:43Z",
    "activity_type": "force_push",
    "actor": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "41d064eb2195891e12d0413f63227ea7",
      "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",
      "starred_at": "\"2020-07-09T00:17:55Z\"",
      "user_view_type": "public"
    }
  }
]