Skip to main content
This notebooks shows how you can load issues and pull requests (PRs) for a given repository on GitHub. Also shows how you can load github files for a given repository on GitHub. We will use the LangChain Python repository as an example.

Setup access token

To access the GitHub API, you need a personal access token - you can set up yours here: github.com/settings/tokens?type=beta. You can either set this token as the environment variable GITHUB_PERSONAL_ACCESS_TOKEN and it will be automatically pulled in, or you can pass it in directly at initialization as the access_token named parameter.

Load Issues and PRs

Let’s load all issues and PRs created by “UmerHA”. Here’s a list of all filters you can use:
  • include_prs
  • milestone
  • state
  • assignee
  • creator
  • mentioned
  • labels
  • sort
  • direction
  • since
For more info, see docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#list-repository-issues.

Only load issues

By default, the GitHub API returns considers pull requests to also be issues. To only get ‘pure’ issues (i.e., no pull requests), use include_prs=False

Load GitHub File Content

For below code, loads all markdown file in rpeo langchain-ai/langchain
example output of one of document:

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.