Community and lead research

Find where a topic is discussed, who answers questions about it and which companies build in the space, using public community and repository data.

The problem#

Before you post, sponsor or reach out, you need to know which communities matter, who the recurring helpful voices are and which companies are active. That information is public, but scattered over forums, Q&A sites and code hosts.

Onekey searches them with one call shape and returns the same fields for each.

Endpoints to call#

EndpointUsed forCreditsStatus
reddit.search_subredditsSubreddits about a topic, with subscriber counts.2beta may need a pack
lemmy.search_communitiesLemmy communities about a topic.5stable
stackexchange.tag_top_answerersThe people who answer the most questions for a Stack Exchange tag.5stable
github.search_reposRepositories in a space, most starred first, with owner and homepage.5stable
web.contactsContact points a company publishes on a page: emails, phone numbers, social links.3stable

Each endpoint name links to its reference page with every parameter, the caching window and a recorded response.

Your first call#

This is github.search_repos (5 credits). 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/search_repos?q=language%3Apython%20stars%3A%3E50000" \
  -H "x-api-key: YOUR_API_KEY"

A working script#

Map a niche: communities, top answerers, active projects and the public contact page of the organisation behind one of them.

python
import os
import requests

API = "https://api.onekey.dev"
HEADERS = {"x-api-key": os.environ["ONEKEY_KEY"]}


def call(path, **params):
    """GET /v1/<platform>/<endpoint>; returns the data or raises with the error code."""
    r = requests.get(f"{API}/v1/{path}", params=params, headers=HEADERS, timeout=30)
    body = r.json()
    if not body["success"]:
        raise RuntimeError(f"{path}: {body['error']['code']}")
    return body["data"]


def get(item, field):
    """get(item, 'content.title'): a field of the unified schema, or None."""
    for key in field.split("."):
        item = (item or {}).get(key)
    return item


TOPIC = "home automation"

for sub in call("reddit/search_subreddits", q=TOPIC)[:5]:  # beta
    print("reddit", get(sub, "entity.name"), get(sub, "entity.stats.followers"))
for comm in call("lemmy/search_communities", q=TOPIC)[:5]:
    print("lemmy ", get(comm, "entity.name"), get(comm, "entity.stats.followers"))

for a in call("stackexchange/tag_top_answerers", tag="home-automation")[:5]:
    print("answerer", get(a, "author.username"), get(a, "author.reputation"))

for repo in call("github/search_repos", q=f"{TOPIC} stars:>500")[:5]:
    print("project", get(repo, "entity.name"), get(repo, "entity.stats.stars"), get(repo, "package.homepageUrl"))

page = call("web/contacts", url="https://example.com/contact")
print("public contact points:", get(page, "ext.emails"), get(page, "ext.social"))

What a month costs#

Illustrative volume, not a benchmark: 30 topic searches on each of Reddit and Lemmy, 30 tag lookups on Stack Exchange, 100 repository searches and 100 company contact pages, in one month.

EndpointCallsCredits per callCredits
reddit.search_subreddits beta30260
lemmy.search_communities305150
stackexchange.tag_top_answerers305150
github.search_repos1005500
web.contacts1003300
Total1,160

About 1,160 credits: the Starter pack (5,000 credits, $9) covers it, at $1.80 per 1,000 credits. Prices are in USD (regional pricing is planned); credits never expire. See pricing.

Every figure above assumes every call is a fresh fetch. These endpoints cache for 2 minutes to 10 minutes. Free when served from cache (0.2 credit for a cached response over 100 KB). Repeating a call inside that window costs nothing. Invalid, failed and not-found calls are not charged either.

Good to know#

Keep reading#