Skip to content

Social profile

POST /social/profile reads the public profile of a GitHub, Bluesky or Mastodon account from its official API: name, bio, followers, posts, join date and links.

POSThttps://api.qelka.com/v1/social/profile

Read the public profile of a GitHub, Bluesky or Mastodon account from the platform's official API, without signing in: name, bio, location, company, follower and post counts, creation date and the links the person published. Each lookup costs 1 credit when the platform answered, whether the profile exists or not.

Request

usernamestringRequired
A username with platform, a Bluesky handle with a dot (bsky.app), a Mastodon address (user@server), or a profile URL (https://github.com/torvalds, https://bsky.app/profile/bsky.app, https://mastodon.social/@Gargron). 1 to 2,048 characters.
platformstringDefault from username
github, bluesky or mastodon. Required for a plain username; a URL, a Mastodon address or a handle with a dot sets the platform.
freshbooleanDefault false
true skips the 24-hour result cache and asks the platform again.

A plain username sent with platform: "mastodon" is looked up on mastodon.social. A Bluesky handle without a dot gets .bsky.social appended. When both a URL and platform are sent, they must name the same platform.

curl https://api.qelka.com/v1/social/profile \
  --max-time 30 \
  -H "Authorization: Bearer $QELKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username": "torvalds", "platform": "github"}'
const response = await fetch('https://api.qelka.com/v1/social/profile', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ username: 'torvalds', platform: 'github' }),
  signal: AbortSignal.timeout(30_000),
})
const result = await response.json()
console.log(result)
import os

import requests

api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
    "https://api.qelka.com/v1/social/profile",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"username": "torvalds", "platform": "github"},
    timeout=30,
)
result = response.json()
print(result)
<?php
$ch = curl_init('https://api.qelka.com/v1/social/profile');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('QELKA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode(['username' => 'torvalds', 'platform' => 'github']),
    CURLOPT_TIMEOUT => 30,
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
	"time"
)

func main() {
	payload, _ := json.Marshal(map[string]any{"username": "torvalds", "platform": "github"})
	request, _ := http.NewRequest(http.MethodPost, "https://api.qelka.com/v1/social/profile", bytes.NewReader(payload))
	request.Header.Set("Authorization", "Bearer "+os.Getenv("QELKA_API_KEY"))
	request.Header.Set("Content-Type", "application/json")

	client := &http.Client{Timeout: 30 * time.Second}
	response, err := client.Do(request)
	if err != nil {
		panic(err)
	}
	defer response.Body.Close()

	var result map[string]any
	if err := json.NewDecoder(response.Body).Decode(&result); err != nil {
		panic(err)
	}
	fmt.Println(result)
}
require 'json'
require 'net/http'

uri = URI('https://api.qelka.com/v1/social/profile')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{ENV.fetch('QELKA_API_KEY')}"
request['Content-Type'] = 'application/json'
request.body = JSON.generate({ username: 'torvalds', platform: 'github' })

response = Net::HTTP.start(uri.host, uri.port, use_ssl: true, read_timeout: 30) do |http|
  http.request(request)
end
result = JSON.parse(response.body)
puts result

Response

Read status first: found means profile is set.

idstring
Identifier of this lookup: lkp_ followed by 26 characters.
objectstring
Always social_profile.
inputstring
The username you sent, without surrounding spaces.
platformstring
github, bluesky or mastodon.
usernamestring
The handle that was looked up.
instancestring or null
The Mastodon server that was asked, such as mastodon.social. null on other platforms.
statusstring
found, not_found or unavailable.
profileobject or null
The public profile. null unless status is found.
profile.idstring
The platform's identifier of the account: a number on GitHub and Mastodon, a DID on Bluesky.
profile.usernamestring
The handle as the platform spells it; user@server on Mastodon.
profile.display_namestring or null
The display name.
profile.urlstring
The public profile URL.
profile.avatar_urlstring or null
The avatar image URL.
profile.biostring or null
The bio or description, as plain text.
profile.locationstring or null
The location written on GitHub. null on Bluesky and Mastodon, which have no such field.
profile.companystring or null
The company written on GitHub.
profile.websitestring or null
The website set on GitHub.
profile.followersinteger or null
Number of followers.
profile.followinginteger or null
Number of accounts followed.
profile.postsinteger or null
Posts on Bluesky, statuses on Mastodon. null on GitHub.
profile.repositoriesinteger or null
Public repositories on GitHub. null elsewhere.
profile.created_atstring or null
When the account was created, ISO 8601.
profile.account_typestring or null
user, organization (GitHub) or bot (a GitHub bot, a Mastodon bot account or a Bluesky labeler).
profile.verifiedboolean or null
Bluesky: true when a trusted verifier has verified the account, or the account is itself a trusted verifier. null on GitHub and Mastodon.
profile.linksarray of objects
The website and social accounts on the profile, without duplicates.
profile.links.platformstring
The platform of the link, such as x, youtube, mastodon or website.
profile.links.labelstring or null
The label the person gave the link, when the platform has one.
profile.links.urlstring
The link.
profile.links.verifiedboolean or null
Mastodon: true when the server confirmed that the linked page links back to the profile. null elsewhere.
credits_usedinteger
Credits debited for this call: 1 unless status is unavailable or the key is a test key.
cachedboolean
true when the answer came from the 24-hour cache.
Response
{
  "id": "lkp_01M8CEGAACSNCNH8HSS50Y4JZ4",
  "object": "social_profile",
  "input": "torvalds",
  "platform": "github",
  "username": "torvalds",
  "instance": null,
  "status": "found",
  "profile": {
    "id": "1024025",
    "username": "torvalds",
    "display_name": "Linus Torvalds",
    "url": "https://github.com/torvalds",
    "avatar_url": "https://avatars.githubusercontent.com/u/1024025?v=4",
    "bio": null,
    "location": "Portland, OR",
    "company": "Linux Foundation",
    "website": null,
    "followers": 333220,
    "following": 0,
    "posts": null,
    "repositories": 12,
    "created_at": "2011-09-03T15:26:22Z",
    "account_type": "user",
    "verified": null,
    "links": []
  },
  "credits_used": 1,
  "cached": false
}

Act on the status

status What it means What to do Billed
found The platform returned a public profile. Use profile. Counts are what the platform reported at the time of the lookup. Yes, and cached 24 hours
not_found The platform says no account has this handle. Check the spelling, or the Mastodon server. Yes, and cached 24 hours
unavailable The platform did not answer within 5 seconds, rate limited the request or answered an error. Try again later. No, and not cached

Where each profile comes from

Platform Source
GitHub GitHub REST API: GET /users/{username}, then GET /users/{username}/social_accounts for the linked accounts
Bluesky Public AppView API at public.api.bsky.app: app.bsky.actor.getProfile
Mastodon The server's own API: GET /api/v1/accounts/lookup?acct=

Only what the platform shows to anyone without an account is read. The API never signs in and reads no private field, follower list or post content.

What the API keeps

The API returns only what the person made public on the platform. The request log keeps the username masked. A profile describes a person: use it for purposes they would expect, such as showing the profile they connected to your app.

Look up a Bluesky handle with a test key

Test keys return a simulated profile without calling the platform. With a test key in QELKA_API_KEY, this request returns:

curl https://api.qelka.com/v1/social/profile \
  --max-time 30 \
  -H "Authorization: Bearer $QELKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username": "example.com", "platform": "bluesky"}'
const response = await fetch('https://api.qelka.com/v1/social/profile', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ username: 'example.com', platform: 'bluesky' }),
  signal: AbortSignal.timeout(30_000),
})
const result = await response.json()
console.log(result)
import os

import requests

api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
    "https://api.qelka.com/v1/social/profile",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"username": "example.com", "platform": "bluesky"},
    timeout=30,
)
result = response.json()
print(result)
Response
{
  "id": "lkp_01M8CH2R3B8WQ5ZJ0NY7KDXG4E",
  "object": "social_profile",
  "input": "example.com",
  "platform": "bluesky",
  "username": "example.com",
  "instance": null,
  "status": "found",
  "profile": {
    "id": "did:plc:simulated0000000000000000",
    "username": "example.com",
    "display_name": "Simulated Profile",
    "url": "https://bsky.app/profile/example.com",
    "avatar_url": null,
    "bio": "A simulated profile returned to test keys.",
    "location": null,
    "company": null,
    "website": null,
    "followers": 1200,
    "following": 80,
    "posts": 340,
    "repositories": null,
    "created_at": "2020-01-15T10:00:00Z",
    "account_type": "user",
    "verified": false,
    "links": []
  },
  "credits_used": 0,
  "cached": false
}

Errors

Status Type When
400 invalid_request username is missing, empty or longer than 2,048 characters, platform is not github, bluesky or mastodon, the body is not a JSON object, or it has a field the request table does not list
401 invalid_api_key The key is missing, unknown or revoked
402 insufficient_credits Your balance is less than 1 credit (live keys only)
403 forbidden The key is restricted to other endpoints
405 invalid_request The method is not POST
422 unprocessable_input username is not a valid handle or profile URL for its platform, a plain username was sent without platform, platform does not match the platform of the URL, or the Mastodon server is not a public host
429 rate_limited Too many requests: wait Retry-After seconds
500 internal_error Unexpected error on our side: retry with backoff

No error is billed. A platform that does not answer is not an error: it is a 200 with status unavailable and credits_used: 0.