Skip to content

Stack Overflow

Mode: 🌐 Public · Domain: stackoverflow.com

Commands

CommandDescription
opencli stackoverflow hotHot questions
opencli stackoverflow search <query>Search questions
opencli stackoverflow bountiesQuestions with active bounties
opencli stackoverflow unansweredUnanswered questions
opencli stackoverflow read <id>Read a question with answers and comments
opencli stackoverflow user <name>Find users by display name (highest reputation first)
opencli stackoverflow tag <tag>List questions tagged with a given tag (most active first)
opencli stackoverflow related <id>List questions related to a given question id

Listing columns

hot, search, and bounties share an agent-native shape so the question_id is round-trippable into stackoverflow read:

ColumnSourceNotes
ranklocal1-indexed position
idquestion_idFeed into stackoverflow read
titletitle
scorescore
answersanswer_count
viewsview_count
is_answeredis_answered(omitted on unanswered since always false)
tagstags (joined)Comma-separated
authorowner.display_name
creation_datecreation_dateUnix epoch seconds
urllinkCanonical question URL
bountybounty_amount(bounties only, prepended after id)

read columns

stackoverflow read <id> fetches the question, answers up to --answers-limit (accepted first, then by votes — if the accepted answer is outside the votes-sorted page it is fetched separately and prepended), question comments up to --comments-limit, and answer comments up to --comments-limit per answer. It mirrors the hackernews read and lobsters read thread shape.

ColumnDescription
typePOST / Q-COMMENT / ANSWER / A-COMMENT
authorDisplay name (HTML entities decoded)
scoreVote count for that row
accepted'true' for the accepted answer, empty string otherwise
textBody / comment, HTML stripped, entities decoded, indented for comments

The accepted answer (if any) is always the first ANSWER row. Other answers follow in descending score order. Comments under an answer appear immediately after that answer with A-COMMENT type and a > indent.

Usage Examples

bash
# Hot questions
opencli stackoverflow hot --limit 10

# Search questions
opencli stackoverflow search "async await" --limit 20

# Active bounties
opencli stackoverflow bounties --limit 10

# Unanswered questions
opencli stackoverflow unanswered --limit 10

# Tagged questions (id feeds stackoverflow read)
opencli stackoverflow tag rust --limit 10

# Related questions for a given question id (rows feed stackoverflow read)
opencli stackoverflow related 11227809 --limit 10
opencli stackoverflow related 11227809 --sort votes --limit 5

# User profile search (returns userId/profile URL rows)
opencli stackoverflow user "Jon Skeet" --limit 5

# Read a question with answers and comments
opencli stackoverflow read 11227809
opencli stackoverflow read 11227809 --answers-limit 3 --comments-limit 5

# JSON output
opencli stackoverflow hot -f json
opencli stackoverflow read 11227809 -f json

Caveats

  • Stack Exchange API has a 300/day quota per IP for unauthenticated requests. A read call uses up to 4 quota units (question, question comments, answers, batched answer comments), or 5 when the accepted answer must be fetched separately.
  • --answers-limit and --comments-limit are bounded to 1-100, matching the Stack Exchange API page size limit. If batched answer comments would be partial, the command fails fast instead of returning an incomplete thread.
  • Bodies are returned as HTML; this adapter strips tags and decodes named / decimal / hex HTML entities for plain-text consumption.
  • tag returns question rows with id, so agents can call opencli stackoverflow read <id> without parsing URLs. user returns Stack Overflow profile rows (userId + url), not question rows.

Prerequisites

  • No browser required — uses the public Stack Exchange API

Released under the Apache-2.0 License.