# GitHub Issues, Pull Requests & Forks Activity Exporter (`xyrelith-data/github-issues-pull-requests-forks-activity-exporter`) Actor

Export issues, pull requests, forks and contributor profiles from any public GitHub repository without a token. Filter by state, label, author, assignee, milestone and date, and walk past GitHub's 1,000-result list cap with automatic date slicing.

- **URL**: https://apify.com/xyrelith-data/github-issues-pull-requests-forks-activity-exporter.md
- **Developed by:** [Xyrelith Data](https://apify.com/xyrelith-data) (community)
- **Categories:** Automation, Developer tools, Open source
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## GitHub Issues, Pull Requests & Forks Activity Exporter

Turn any public GitHub repository into a clean activity table. Export its issues, pull requests,
forks, and contributor profiles in one run without a token, cookie, or proxy setup. Every row is
flattened for spreadsheets, BI tools, and AI pipelines.

This actor reads GitHub's own public pages and JSON views, so it works for any public repository
worldwide and needs no GitHub account. An optional personal token only raises the anonymous REST
limit for optional enrichments such as PR diff stats and join dates.

### What you can export

#### Issues

One row per issue with repository, number, title, state, state reason, author, labels, assignees,
milestone, comment count, created/updated/closed dates, and URL. Optional: full body, reaction
totals, and the complete comment thread with per-comment reactions.

#### Pull requests

One row per pull request with the same identity and people fields plus merged flag and date,
merged-by user, base and head branch, head repository owner/name, commit count, head SHA, and
draft flag. Optional: full body, reaction totals, full comment thread, and diff stats
(additions, deletions, changed files).

#### Issues + pull requests

Both record types in one dataset, de-duplicated and ordered by your chosen sort.

#### Forks

One row per fork with fork owner, fork repository, URL, owner avatar, stars, forks, open issues,
open pull requests, fork date, and last push date.

#### Contributor profiles

One row per GitHub user or organization with login, display name, account type, avatar, bio,
company, location, website, followers, following, public repository count, social links, and
join date when GitHub's public REST endpoint is available. Email harvesting is deliberately
excluded.

### Filters

| Filter | Applies to | Notes |
|---|---|---|
| State | Issues and pull requests | open, closed, all; pull requests also merged and draft |
| Labels | Issues and pull requests | every listed label must be present |
| Author | Issues and pull requests | exact GitHub login |
| Assignee | Issues and pull requests | exact GitHub login |
| Milestone | Issues and pull requests | exact milestone title |
| Created from / to | Issues and pull requests | YYYY-MM-DD |
| Updated from / to | Issues and pull requests | YYYY-MM-DD |
| Closed from / to | Issues and pull requests | YYYY-MM-DD |
| Search text | Issues and pull requests | searches titles and bodies |
| Sort | Issues and pull requests | newest, oldest, most commented, recently updated, most reactions |
| Max items per repository | All repository modes | shared between issues and pull requests in combined mode |
| Fork period | Forks | 1 month to 5 years |
| Fork sort | Forks | most starred, recently updated, most open issues, most open pull requests |

### Input reference

| Input key | Type | Default | What it does |
|---|---|---|---|
| `mode` | select | `issues` | issues, pullRequests, issuesAndPullRequests, forks, or profiles |
| `repositories` | string list | not set | owner/repo slugs or github.com URLs |
| `usernames` | string list | not set | usernames or profile URLs for profiles mode |
| `state` | select | `open` | open, closed, all, merged, draft |
| `labels` | string list | empty | require every listed label |
| `author` | string | empty | filter by author login |
| `assignee` | string | empty | filter by assignee login |
| `milestone` | string | empty | filter by milestone title |
| `createdFrom` | string | empty | earliest created date |
| `createdTo` | string | empty | latest created date |
| `updatedFrom` | string | empty | earliest updated date |
| `updatedTo` | string | empty | latest updated date |
| `closedFrom` | string | empty | earliest closed date |
| `closedTo` | string | empty | latest closed date |
| `searchText` | string | empty | free text in titles and bodies |
| `sort` | select | `newest` | newest, oldest, mostCommented, recentlyUpdated, mostReactions |
| `maxItemsPerRepository` | integer | `100` | records per repository |
| `includeBody` | boolean | `false` | add full descriptions |
| `includeCommentThread` | boolean | `false` | add every comment |
| `includeReactions` | boolean | `false` | add reaction totals |
| `includeAuthorProfile` | boolean | `false` | add the author profile |
| `includeDiffStats` | boolean | `false` | add PR additions/deletions/changed files |
| `forkPeriod` | select | `5y` | fork activity period |
| `forkSort` | select | `mostStarred` | fork list order |
| `githubToken` | secret string | empty | optional REST limit increase |

### Breaking past GitHub's 1,000-result list cap

GitHub returns at most 1,000 results for one search query. Newest-first and oldest-first exports
therefore split the requested date range into year windows and recursively split any window that
still reports more than 1,000 matches, down to a single day. Each window is fetched separately
and de-duplicated, so a large repository can be exported well past 1,000 rows without gaps. If a
single day still has more than 1,000 matches, the run says so in its status message.

The other three sort orders use GitHub's own server ordering and are capped at 1,000 results per
repository; the actor reports that cap instead of silently under-delivering.

### Output

All modes share these fields where they apply:

`recordType`, `repository`, `repositoryUrl`, `number`, `title`, `state`, `stateReason`, `url`,
`authorLogin`, `authorName`, `authorAvatarUrl`, `authorProfileUrl`, `labels`, `assignees`,
`milestone`, `commentCount`, `createdAt`, `updatedAt`, `closedAt`, `scrapedAt`.

Issues and pull requests add optional `body`, `reactions`, `comments`, and `authorProfile`.
Pull requests add `isDraft`, `merged`, `mergedAt`,
`mergedBy`, `baseBranch`, `headBranch`, `headRepositoryOwner`, `headRepositoryName`,
`commitCount`, `headSha`, and optional `additions`, `deletions`, `changedFiles`.

Forks use `forkOwner`, `forkRepository`, `forkUrl`, `forkOwnerAvatarUrl`, `stars`, `forks`,
`openIssues`, `openPullRequests`, `createdAt`, and `pushedAt`.

Profiles use `login`, `accountType`, `name`, `bio`, `company`, `location`, `website`,
`followers`, `following`, `publicRepos`, `socialLinks`, `joinedAt`, `publicGists`, and
`twitterUsername`.

Empty values are omitted at every depth. Counts that are truly zero, such as zero comments or
zero stars, are kept.

### Example input

```json
{
  "mode": "issuesAndPullRequests",
  "repositories": ["psf/requests", "https://github.com/microsoft/vscode"],
  "state": "all",
  "labels": ["bug"],
  "sort": "newest",
  "maxItemsPerRepository": 100,
  "includeBody": true,
  "includeCommentThread": true,
  "includeReactions": true
}
```

Minimal daily-style run:

```json
{
  "mode": "issues",
  "repositories": ["psf/requests"],
  "maxItemsPerRepository": 3
}
```

### How it works

The actor reads the same public JSON views that power github.com. Issue and pull-request lists
provide 25 rows per page plus a total count. Issue detail pages provide bodies, labels, assignees,
milestones, state reasons, and reaction groups. Issue comment threads paginate through GitHub's
public timeline view. Pull-request pages provide branches, merge data, commit counts, and bodies.
Fork pages provide owner, stars, open counts, and dates. Profile pages provide public profile
data. Optional REST calls use `api.github.com` only for PR comment threads, diff stats, and join
dates.

Requests are paced at about one per second and retried on 429 and 5xx responses. No proxy is
required. If GitHub temporarily rate-limits the optional anonymous REST calls, the actor keeps
going with the page data and reports what was skipped.

### Limitations

- GitHub's fork list is a filtered view. A repository with 10,000+ forks can show only about
  1,000 fork rows, and `/network/members` adds owner names without stars or dates. The actor
  exports every fork row GitHub exposes for the selected period and sort, and says when the list
  ends. This is a GitHub cap, not an actor cap.
- Full pull-request comment threads use GitHub's anonymous REST endpoint, which allows about 60
  requests per hour per IP. Without an optional token the actor falls back to the first rendered
  comment page and reports the fallback. Issue comment threads do not need REST and are fetched
  in full.
- Join date is not shown on logged-out profile pages. It is filled when the public REST user
  endpoint answers and omitted otherwise.
- GitHub hides stargazers, watchers, and starred-at lists behind login. They are out of scope.
- Email addresses are never collected.

### FAQ

**Do I need a GitHub token?**
No. Every mode returns real public data without one. A token is optional and only increases the
REST limit for PR comment threads, diff stats, and join dates.

**Can I export a repository with more than 1,000 issues?**
Yes, with the newest-first or oldest-first sort. The actor slices the date range automatically.

**Can I mix issues and pull requests in one dataset?**
Yes. Choose "Issues + pull requests" and the actor returns both types, de-duplicated and sorted.

**Can I use repository URLs instead of owner/repo?**
Yes. Both forms are accepted, as are profile URLs in profiles mode.

**Why is a fork row missing stars?**
Some fork lists do not render stars for every row. The field is omitted when GitHub does not
show it rather than filled with a placeholder.

**Why does a PR comment thread stop early?**
GitHub's anonymous REST budget may have run out. Add an optional token for complete threads, or
use issue mode, where full threads are fetched without REST.

### Data source

GitHub's public `github.com` pages and JSON views, plus `api.github.com` for optional REST
enrichments on public data only. The actor is not affiliated with GitHub.

# Actor input Schema

## `mode` (type: `string`):

Choose issues, pull requests, both together, forks, or contributor profiles.

## `repositories` (type: `array`):

Public GitHub repositories as owner/repo slugs or github.com URLs. Example: psf/requests or https://github.com/psf/requests.

## `usernames` (type: `array`):

Profiles to export in contributor profiles mode. Example: kennethreitz or https://github.com/kennethreitz.

## `state` (type: `string`):

open, closed or all. Pull requests also accept merged and draft. Draft means pull requests currently open as drafts.

## `labels` (type: `array`):

Only records that carry every listed label. Matching is case-insensitive.

## `author` (type: `string`):

Only records opened by this GitHub login.

## `assignee` (type: `string`):

Only records assigned to this GitHub login.

## `milestone` (type: `string`):

Only records attached to this milestone title.

## `createdFrom` (type: `string`):

Earliest creation date, YYYY-MM-DD.

## `createdTo` (type: `string`):

Latest creation date, YYYY-MM-DD.

## `updatedFrom` (type: `string`):

Earliest update date, YYYY-MM-DD.

## `updatedTo` (type: `string`):

Latest update date, YYYY-MM-DD.

## `closedFrom` (type: `string`):

Earliest close date, YYYY-MM-DD.

## `closedTo` (type: `string`):

Latest close date, YYYY-MM-DD.

## `searchText` (type: `string`):

Free text searched inside titles and bodies.

## `sort` (type: `string`):

Newest and oldest walk past GitHub's 1,000-result cap with automatic date slicing. Other orders use GitHub's server order and are capped at 1,000 results.

## `maxItemsPerRepository` (type: `integer`):

Upper bound on returned records per repository. In issues + pull requests mode the limit is shared across both types.

## `includeBody` (type: `boolean`):

Add the full issue or pull-request description.

## `includeCommentThread` (type: `boolean`):

Add every comment with author, date, body and per-comment reactions.

## `includeReactions` (type: `boolean`):

Add reaction counts by emoji for each issue or pull request.

## `includeAuthorProfile` (type: `boolean`):

Add the author's public profile (name, company, location, bio, followers, social links) to every record.

## `includeDiffStats` (type: `boolean`):

Add additions, deletions and changed files. Uses the optional GitHub token when supplied and otherwise the anonymous REST limit.

## `forkPeriod` (type: `string`):

Only forks with push activity in this period. GitHub exposes at most five years.

## `forkSort` (type: `string`):

Order of fork rows on GitHub's fork list.

## `githubToken` (type: `string`):

Optional personal access token for higher REST limits when comment threads, diff stats or join dates are requested. Never required.

## Actor input object example

```json
{
  "mode": "issues",
  "repositories": [
    "psf/requests"
  ],
  "usernames": [
    "kennethreitz"
  ],
  "state": "open",
  "sort": "newest",
  "maxItemsPerRepository": 3,
  "includeBody": false,
  "includeCommentThread": false,
  "includeReactions": false,
  "includeAuthorProfile": false,
  "includeDiffStats": false,
  "forkPeriod": "5y",
  "forkSort": "mostStarred"
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all exported GitHub activity records.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "issues",
    "repositories": [
        "psf/requests"
    ],
    "usernames": [
        "kennethreitz"
    ],
    "state": "open",
    "sort": "newest",
    "maxItemsPerRepository": 3,
    "includeBody": false,
    "includeCommentThread": false,
    "includeReactions": false,
    "includeAuthorProfile": false,
    "includeDiffStats": false,
    "forkPeriod": "5y",
    "forkSort": "mostStarred"
};

// Run the Actor and wait for it to finish
const run = await client.actor("xyrelith-data/github-issues-pull-requests-forks-activity-exporter").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "issues",
    "repositories": ["psf/requests"],
    "usernames": ["kennethreitz"],
    "state": "open",
    "sort": "newest",
    "maxItemsPerRepository": 3,
    "includeBody": False,
    "includeCommentThread": False,
    "includeReactions": False,
    "includeAuthorProfile": False,
    "includeDiffStats": False,
    "forkPeriod": "5y",
    "forkSort": "mostStarred",
}

# Run the Actor and wait for it to finish
run = client.actor("xyrelith-data/github-issues-pull-requests-forks-activity-exporter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "issues",
  "repositories": [
    "psf/requests"
  ],
  "usernames": [
    "kennethreitz"
  ],
  "state": "open",
  "sort": "newest",
  "maxItemsPerRepository": 3,
  "includeBody": false,
  "includeCommentThread": false,
  "includeReactions": false,
  "includeAuthorProfile": false,
  "includeDiffStats": false,
  "forkPeriod": "5y",
  "forkSort": "mostStarred"
}' |
apify call xyrelith-data/github-issues-pull-requests-forks-activity-exporter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xyrelith-data/github-issues-pull-requests-forks-activity-exporter"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7OpM4cDSEsOPXO0bm/builds/4ZWPmDEIW0ze4OKAM/openapi.json
