Stack Overflow

List Stack Overflow user comments

List the comments a Stack Overflow user has written, by time or votes.

GET/v1/stack-overflow/users/{memberId}/comments
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
6
memberIdintegerrequiredpath

User id on the chosen site, e.g. `22656`. `-1` is the Community user.

≥ -1 · ≤ 2147483647

sitestringoptionalquery

Stack Exchange site, by its API name (`askubuntu`, `serverfault`, `math`, `ru.stackoverflow`). Default: `stackoverflow`. The sites endpoint lists them all.

sortstringoptionalquery

Order: `creation` (default) or `votes`. `creation` pages without a ceiling; `votes` stops at the list ceiling. Rows with equal scores can repeat or skip.

one of: creation, votes

orderstringoptionalquery

Direction of the sort: `desc` (default) or `asc`.

one of: desc, asc

limitintegeroptionalquery

Up to this many rows per page, 1 to 100. Default: 30. A page can hold fewer than `limit` rows where rows share a creation second or a block of 100 rows ends. Follow `page.nextCursor` until `hasMore` is false.

≥ 1 · ≤ 100

cursorstringoptionalquery

Cursor from `page.nextCursor` of the previous response. It only works with the same filters.

min 1 chars · max 1024 chars

Response fields
42

Endpoint-specific response payload.

datalookupStatus
string

`not_found` when no user has this id on the site. A user with no comments is `found` with an empty list.

one of: found, not_found

datasite
string

The Stack Exchange site the comments belong to.

datamemberId
integer

The user the comments belong to.

The comments on this page.

datacomments[]id
integer

Comment id.

datacomments[]postId
integernullable

The question or answer the comment is on.

datacomments[]postType
stringnullable

Whether the comment is on a question or an answer; null when not known.

one of: question, answer, null

datacomments[]url
stringnullable

Link to the comment.

datacomments[]score
integernullable

Upvotes the comment received.

datacomments[]edited
booleannullable

Whether the comment was edited. The flag comes from the route that returned the comment, so the same comment can differ between routes.

datacomments[]createdAt
stringnullable

When it was written, ISO 8601 UTC.

Who wrote it.

datacomments[]authorid
integernullable

User id on this site; null for a deleted user.

datacomments[]authoraccountId
integernullable

Network-wide account id, the same on every site.

datacomments[]authorname
stringnullable

Display name.

datacomments[]authorurl
stringnullable

Profile URL.

datacomments[]authorimageUrl
stringnullable

Avatar URL.

datacomments[]authorreputation
integernullable

Reputation on this site.

datacomments[]authortype
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

datacomments[]authoracceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

The user the comment is addressed to, when it is a reply. Null when the comment is not a reply; on the comments-by-post routes it is always null because those routes do not carry reply targets.

datacomments[]replyToid
integernullable

User id on this site; null for a deleted user.

datacomments[]replyToaccountId
integernullable

Network-wide account id, the same on every site.

datacomments[]replyToname
stringnullable

Display name.

datacomments[]replyTourl
stringnullable

Profile URL.

datacomments[]replyToimageUrl
stringnullable

Avatar URL.

datacomments[]replyToreputation
integernullable

Reputation on this site.

datacomments[]replyTotype
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

datacomments[]replyToacceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

datacomments[]isByPostAuthor
booleannullable

Whether the comment's author wrote the post it is on; null on lists that do not carry it.

datacomments[]license
stringnullable

Content licence, e.g. `CC BY-SA 4.0`.

datacomments[]bodyHtml
stringnullable

Comment text as HTML.

datacomments[]bodyMarkdown
stringnullable

Comment text as Markdown; null on lists that do not carry it.

Pagination state for the current page.

datapagehasMore
boolean

Whether another page is available.

datapagenextCursor
stringnullable

Cursor for the next page; null on the last page.

datalimitReached
boolean

True when the list stopped at the site's 25-page ceiling (2,500 rows, or 625 when the page carries text), or when a user's answer or comment list is too large for page-offset paging and has served its first 100 rows (25 when it carries text). Sort by `creation` to page deeper. False for every list that ends because it ran out.

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

Code example

curl "https://api.socialfetch.dev/v1/stack-overflow/users/22656/comments" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Comment listing.