Stack Overflow

Get Stack Overflow post citation

Get a BibTeX, AMS and text citation for a Stack Overflow question or answer.

GET/v1/stack-overflow/posts/{postId}/citation
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
2
postIdintegerrequiredpath

Post id (a question or an answer) on the chosen site, e.g. `11227902`.

≥ 1 · ≤ 2147483647

sitestringoptionalquery

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

Response fields
11

Endpoint-specific response payload.

datalookupStatus
string

`not_found` when the post does not exist or was deleted.

one of: found, not_found

datasite
string

The Stack Exchange site the post belongs to.

datapostId
integer

The post that is cited.

databibtex
stringnullable

The citation as a BibTeX entry.

dataamsref
stringnullable

The citation as an AMS reference.

dataexampleHtml
stringnullable

An example of how to cite the post in text, as HTML.

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/posts/11227902/citation" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Post citation.