GitHub API

Get GitHub data as clean JSON with one key: 58 endpoints, 1 to 5 credits per call, the same response shape as every other platform.

What you get#

Onekey exposes GitHub as 58 endpoints behind one API key: 18 endpoints return one record (data is an object) and 40 endpoints return a list (data is an array). Every answer uses the same envelope (success, data, metadata, error), the cost is reported in metadata.credits_charged, and fields are mapped onto the unified schema so the code you write for GitHub also works for the rest of the developer platforms category.

Endpoints#

EndpointWhat it doesParametersCreditsStatus
advisoriesGlobal GitHub security advisories (reviewed), filterable by ecosystem.ecosystem, cursor5stable
advisories_graphqlGitHub security advisories via GraphQL (requires a token).-5beta
advisoryOne GitHub security advisory by GHSA id.ghsa*1stable
branchesBranches of a GitHub repository.owner*, repo*, cursor5stable
commitOne GitHub commit with change stats (sha or ref).owner*, repo*, ref*1stable
commitsRecent commits of a GitHub repository.owner*, repo*, cursor5stable
communityCommunity health profile of a GitHub repository.owner*, repo*1stable
contributorsTop contributors of a GitHub repository.owner*, repo*, cursor5stable
forksRecent forks of a GitHub repository.owner*, repo*, cursor5stable
gistOne public GitHub gist.id*1stable
issueOne GitHub issue.owner*, repo*, number*1stable
issue_commentsComments of a GitHub issue or pull request.owner*, repo*, number*, cursor1stable
issuesRecent issues (and PRs) of a GitHub repository.owner*, repo*, cursor1stable
labelsLabels of a GitHub repository.owner*, repo*, cursor5stable
languagesLanguage breakdown (bytes) of a GitHub repository.owner*, repo*1stable
latest_releaseLatest published release of a GitHub repository.owner*, repo*1stable
licenseDetected license of a GitHub repository.owner*, repo*1stable
license_infoDetails of one open-source license (permissions, conditions, limitations).key*1stable
licensesCommon open-source licenses known to GitHub.cursor5stable
milestonesMilestones of a GitHub repository.owner*, repo*, cursor5stable
orgGitHub organisation profile.org*1stable
org_eventsRecent public events of a GitHub organisation.org*, cursor5stable
org_membersPublic members of a GitHub organisation.org*, cursor5stable
org_reposPublic repositories of a GitHub organisation (most recently pushed).org*, cursor5stable
profileFetch a GitHub user's public profile.username*1stable
public_gistsMost recent public GitHub gists.cursor5stable
pullOne GitHub pull request with change stats.owner*, repo*, number*1stable
pull_commitsCommits of a GitHub pull request.owner*, repo*, number*, cursor5stable
pull_filesFiles changed by a GitHub pull request.owner*, repo*, number*, cursor5stable
pullsRecent pull requests of a GitHub repository.owner*, repo*, cursor5stable
readmeREADME file descriptor of a GitHub repository (name, path, links).owner*, repo*1stable
release_by_tagA GitHub release by tag name.owner*, repo*, tag*1stable
releasesReleases of a GitHub repository.owner*, repo*, cursor1stable
repoFull metadata of a GitHub repository.owner*, repo*1stable
repo_dossierProject dossier of a repository: stars, forks, watchers, open issues, license, topics, language, activity dates.owner*, repo*1stable
repo_eventsRecent public events of a GitHub repository.owner*, repo*, cursor5stable
reposList a GitHub user's most recently updated public repositories.username*, cursor1stable
searchSearch GitHub users by keyword.q*, cursor1stable
search_codeSearch code across GitHub (requires a token).q*, cursor5beta
search_commitsSearch GitHub commits.q*, cursor5stable
search_issuesSearch GitHub issues and pull requests.q*, cursor5stable
search_reposSearch GitHub repositories (most starred first).q*, cursor5stable
search_topicsSearch GitHub topics.q*, cursor5stable
stargazersRecent stargazers of a GitHub repository (requires a token).owner*, repo*, cursor5beta
subscribersWatchers of a GitHub repository (requires a token).owner*, repo*, cursor5beta
tagsTags of a GitHub repository.owner*, repo*, cursor5stable
top_issuesMost-reacted open issues of a repository (feature requests and complaints ranked by reactions).owner*, repo*1stable
topicsTopics of a GitHub repository.owner*, repo*1stable
user_eventsRecent public events of a GitHub user.username*, cursor5stable
user_followersFollowers of a GitHub user.username*, cursor5stable
user_followingAccounts a GitHub user follows.username*, cursor5stable
user_gistsPublic gists of a GitHub user.username*, cursor5stable
user_orgsPublic organisations of a GitHub user.username*5stable
user_profile_velocityA GitHub user's contribution activity for a year (total contributions).handle*2beta needs a pack
user_social_accountsSocial accounts linked to a GitHub profile.username*5stable
user_starredRepositories starred by a GitHub user.username*, cursor5stable
workflow_runsRecent GitHub Actions runs of a repository.owner*, repo*, cursor5stable
workflowsGitHub Actions workflows of a repository.owner*, repo*5stable

A * marks a required parameter. Each endpoint name links to its reference page with the full parameter table, caching window and a recorded response.

Make a request#

This calls github.advisory (1 credit, stable). Replace YOUR_API_KEY with your key; sign up, no card. 1,000 free credits cover the open-platform endpoints. Hard-to-reach platforms (X, TikTok, Instagram, Reddit, and others marked on their page) need a verified email and a purchased pack.

curl "https://api.onekey.dev/v1/github/advisory?ghsa=GHSA-9wx4-h78v-vm56" \
  -H "x-api-key: YOUR_API_KEY"

Fields you get back#

These unified fields come back from GitHub, with the same names as on every other platform. The count is how many of its 58 mapped endpoints return the field; a field the source lacks is null, never missing. 42 platform-specific fields (ext.<name>) come on top, documented on each endpoint page.

FieldTypeEndpoints
author.usernamestring39
content.idstring28
content.createdAtISO 8601 date25
content.urlURL25
content.textstring23
entity.namestring19
content.titlestring18
engagement.commentsinteger16
author.avatarUrlURL15
author.idstring11
author.urlURL10
entity.descriptionstring10
entity.idstring10
entity.urlURL10
content.statestring9
content.updatedAtISO 8601 date9
entity.updatedAtISO 8601 date9
package.licensestring9
engagement.likesinteger8
entity.stats.openIssuesinteger7
entity.tagslist of strings7
author.displayNamestring6
author.typestring6
entity.createdAtISO 8601 date6
entity.languagestring6
entity.stats.forksinteger6
entity.stats.starsinteger6
entity.stats.watchersinteger6
package.defaultBranchstring6
package.homepageUrlURL6
package.pushedAtISO 8601 date6
package.archivedboolean5
author.followersinteger2
author.followinginteger2
author.createdAtISO 8601 date1
author.locationstring1
author.verifiedboolean1
author.websiteURL1
engagement.sharesinteger1
engagement.votesinteger1

The full schema is in Unified schema.

Pricing#

GitHub calls cost 1 to 5 credits, flat per endpoint. Free when served from cache (0.2 credit for a cached response over 100 KB). Invalid, failed or not-found calls are not charged. See pricing for credit packs.