What you get#
Onekey exposes Stack Exchange as 43 endpoints behind one API key: 6 endpoints return one record (data is an object) and 37 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 Stack Exchange also works for the rest of the messaging & communities category.
Endpoints#
| Endpoint | What it does | Parameters | Credits | Status |
|---|---|---|---|---|
answer | An answer by id (with body). | id*, site | 1 | stable |
answers | Answers to a question (with body). | id*, site | 5 | stable |
badge_recipients | Recent recipients of a badge. | id*, site | 5 | stable |
badges | Badges of a site ranked by award rarity. | site | 5 | stable |
badges_tag | Tag-based badges of a site. | site | 5 | stable |
comments | Latest comments on a site. | site | 5 | stable |
info | Site statistics. | site | 1 | stable |
linked | Questions that link to a question. | id*, site | 5 | stable |
moderators | Moderators of a site. | site | 5 | stable |
post_comments | Comments on a post (question or answer). | id*, site | 5 | stable |
question | A question by id (with body). | id*, site | 1 | stable |
question_comments | Comments on a question. | id*, site | 5 | stable |
questions | Recent active questions on a Stack Exchange site. | site | 5 | stable |
questions_by_tag | Newest questions for a tag. | tag*, site | 5 | stable |
questions_featured | Featured (bountied) questions on a Stack Exchange site. | site | 5 | stable |
questions_hot | Hot questions on a Stack Exchange site. | site | 5 | stable |
questions_unanswered | Unanswered questions on a Stack Exchange site. | site | 5 | stable |
questions_votes | Most-voted questions on a Stack Exchange site. | site | 5 | stable |
related | Questions related to a question. | id*, site | 5 | stable |
revisions | Edit revisions of a post. | id*, site | 5 | stable |
search | Search Stack Exchange questions. | q*, site | 5 | stable |
search_excerpts | Search questions and answers with excerpts. | q*, site | 5 | stable |
similar | Questions similar to a title. | q*, site | 5 | stable |
sites | All Stack Exchange network sites. | - | 5 | stable |
tag_info | Tag statistics. | tag*, site | 1 | stable |
tag_related | Tags related to a tag. | tag*, site | 5 | stable |
tag_synonyms | Synonyms of a tag. | tag*, site | 5 | stable |
tag_top_answerers | Top answerers for a tag (all time). | tag*, site | 5 | stable |
tag_top_askers | Top askers for a tag (all time). | tag*, site | 5 | stable |
tag_wiki | Wiki excerpt of a tag. | tag*, site | 1 | stable |
tags | Popular tags on a site. | site | 5 | stable |
tags_search | Search tags by name. | q*, site | 5 | stable |
top_by_tag | Top-voted questions for a tag. | tag*, site | 5 | stable |
user | Fetch a Stack Exchange user by numeric id. | id*, site | 1 | stable |
user_answers | Answers written by a user. | id*, site | 5 | stable |
user_badges | Badges earned by a user. | id*, site | 5 | stable |
user_comments | Comments written by a user. | id*, site | 5 | stable |
user_questions | Questions asked by a user. | id*, site | 5 | stable |
user_reputation | Recent reputation changes of a user. | id*, site | 5 | stable |
user_tags | Tags a user is active in. | id*, site | 5 | stable |
user_top_tags | A user's top tags by score. | id*, site | 5 | stable |
users | Top users by reputation on a site. | site | 5 | stable |
users_search | Search users by name on a site. | q*, site | 5 | stable |
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 stackexchange.answer (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/stackexchange/answer?id=11227902" \
-H "x-api-key: YOUR_API_KEY"Fields you get back#
These unified fields come back from Stack Exchange, with the same names as on every other platform. The count is how many of its 43 mapped endpoints return the field; a field the source lacks is null, never missing. 16 platform-specific fields (ext.<name>) come on top, documented on each endpoint page.
| Field | Type | Endpoints |
|---|---|---|
author.id | string | 29 |
author.username | string | 28 |
content.createdAt | ISO 8601 date | 28 |
author.avatarUrl | URL | 27 |
author.url | URL | 27 |
author.reputation | number | 26 |
engagement.likes | integer | 25 |
entity.name | string | 25 |
content.text | string | 23 |
content.id | string | 22 |
engagement.comments | integer | 21 |
content.title | string | 16 |
content.url | URL | 13 |
engagement.views | integer | 13 |
entity.id | string | 4 |
entity.url | URL | 4 |
author.location | string | 3 |
content.type | string | 3 |
entity.description | string | 3 |
entity.stats.rank | integer | 3 |
author.displayName | string | 1 |
entity.type | string | 1 |
media.thumbnailUrl | URL | 1 |
package.version | string | 1 |
The full schema is in Unified schema.
Pricing#
Stack Exchange 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.