Skip to main content

GitHub

Base URL: https://drain.lat/api/v1/github
Fetch a GitHub user’s public profile.
GET /api/v1/github/profile/:username
username
string
required
The GitHub username to look up.
curl "https://drain.lat/api/v1/github/profile/torvalds" \
  -H "x-api-key: YOUR_API_KEY"
id
number
GitHub user ID.
username
string
GitHub username.
displayName
string
Display name.
bio
string
Profile bio.
company
string
Company listed on profile.
location
string
Location listed on profile.
email
string
Public email address.
website
string
Personal website URL.
avatarUrl
string
Avatar image URL.
profileUrl
string
Link to GitHub profile.
followers
number
Number of followers.
following
number
Number of accounts followed.
publicRepos
number
Number of public repositories.
publicGists
number
Number of public gists.
created
string
Account creation date.
updated
string
Last profile update date.
Response
{
  "id": 1024025,
  "username": "torvalds",
  "displayName": "Linus Torvalds",
  "bio": "Just for fun",
  "company": "Linux Foundation",
  "location": "Portland, OR",
  "email": "",
  "website": "",
  "avatarUrl": "https://avatars.githubusercontent.com/u/1024025",
  "profileUrl": "https://github.com/torvalds",
  "followers": 234000,
  "following": 0,
  "publicRepos": 8,
  "publicGists": 0,
  "created": "2011-09-03T15:26:22Z",
  "updated": "2024-01-01T00:00:00Z",
  "scrapedAt": "2026-05-05T12:00:00.000Z"
}
Get a user’s public repositories sorted by last updated.
GET /api/v1/github/profile/:username/repos
username
string
required
The GitHub username.
curl "https://drain.lat/api/v1/github/profile/torvalds/repos" \
  -H "x-api-key: YOUR_API_KEY"
username
string
GitHub username.
repos
array
total
number
Total repos returned.
Response
{
  "username": "torvalds",
  "repos": [
    {
      "id": 2325298,
      "name": "linux",
      "fullName": "torvalds/linux",
      "description": "Linux kernel source tree",
      "language": "C",
      "stars": 180000,
      "forks": 54000,
      "watchers": 180000,
      "isPrivate": false,
      "isFork": false,
      "topics": ["kernel", "linux"],
      "url": "https://github.com/torvalds/linux",
      "created": "2011-09-04T22:48:12Z",
      "updated": "2026-05-05T00:00:00Z"
    }
  ],
  "total": 8,
  "scrapedAt": "2026-05-05T12:00:00.000Z"
}
Returns up to 30 repositories per request.
Get a user’s GitHub followers.
GET /api/v1/github/profile/:username/followers
username
string
required
The GitHub username.
curl "https://drain.lat/api/v1/github/profile/torvalds/followers" \
  -H "x-api-key: YOUR_API_KEY"
Response
{
  "username": "torvalds",
  "followers": [
    {
      "id": 583231,
      "username": "octocat",
      "avatarUrl": "https://avatars.githubusercontent.com/u/583231",
      "profileUrl": "https://github.com/octocat"
    }
  ],
  "total": 30,
  "scrapedAt": "2026-05-05T12:00:00.000Z"
}
Returns up to 30 followers.
Get the list of users a GitHub user follows.
GET /api/v1/github/profile/:username/following
username
string
required
The GitHub username.
curl "https://drain.lat/api/v1/github/profile/torvalds/following" \
  -H "x-api-key: YOUR_API_KEY"
Response
{
  "username": "torvalds",
  "following": [
    {
      "id": 583231,
      "username": "octocat",
      "avatarUrl": "https://avatars.githubusercontent.com/u/583231",
      "profileUrl": "https://github.com/octocat"
    }
  ],
  "total": 0,
  "scrapedAt": "2026-05-05T12:00:00.000Z"
}
Returns up to 30 results.
Get the public organizations a GitHub user belongs to.
GET /api/v1/github/profile/:username/orgs
username
string
required
The GitHub username.
curl "https://drain.lat/api/v1/github/profile/torvalds/orgs" \
  -H "x-api-key: YOUR_API_KEY"
Response
{
  "username": "torvalds",
  "orgs": [
    {
      "id": 1915493,
      "name": "torvalds",
      "description": "",
      "avatarUrl": "https://avatars.githubusercontent.com/u/1915493",
      "url": "https://github.com/torvalds"
    }
  ],
  "total": 1,
  "scrapedAt": "2026-05-05T12:00:00.000Z"
}
Get info for a single GitHub repository.
GET /api/v1/github/repo/:owner/:repo
owner
string
required
Repository owner (user or org).
repo
string
required
Repository name.
curl "https://drain.lat/api/v1/github/repo/torvalds/linux" \
  -H "x-api-key: YOUR_API_KEY"
id
number
Repository ID.
name
string
Repository name.
fullName
string
Full name including owner.
description
string
Repository description.
language
string
Primary language.
stars
number
Star count.
forks
number
Fork count.
openIssues
number
Open issue count.
isPrivate
boolean
Whether the repo is private.
isFork
boolean
Whether the repo is a fork.
isArchived
boolean
Whether the repo is archived.
topics
string[]
Topic tags.
license
string
License identifier.
defaultBranch
string
Default branch name.
owner
object
Response
{
  "id": 2325298,
  "name": "linux",
  "fullName": "torvalds/linux",
  "description": "Linux kernel source tree",
  "language": "C",
  "stars": 180000,
  "forks": 55000,
  "watchers": 180000,
  "openIssues": 0,
  "isPrivate": false,
  "isFork": false,
  "isArchived": false,
  "topics": ["kernel", "linux"],
  "license": "GPL-2.0",
  "defaultBranch": "master",
  "url": "https://github.com/torvalds/linux",
  "owner": {
    "id": 1024025,
    "username": "torvalds",
    "avatarUrl": "https://..."
  },
  "scrapedAt": "2026-05-08T10:00:00.000Z"
}
Get the last 20 commits for a repository.
GET /api/v1/github/repo/:owner/:repo/commits
owner
string
required
Repository owner.
repo
string
required
Repository name.
curl "https://drain.lat/api/v1/github/repo/torvalds/linux/commits" \
  -H "x-api-key: YOUR_API_KEY"
owner
string
Repository owner.
repo
string
Repository name.
commits
array
total
number
Number of commits returned.
Response
{
  "owner": "torvalds",
  "repo": "linux",
  "commits": [
    {
      "sha": "a1b2c3d",
      "message": "kernel: fix memory leak in net subsystem",
      "author": "Linus Torvalds",
      "date": "2026-05-07T18:00:00Z",
      "url": "https://github.com/torvalds/linux/commit/a1b2c3d"
    }
  ],
  "total": 20,
  "scrapedAt": "2026-05-08T10:00:00.000Z"
}