Repository navigation
FAQ
Short answers; each links the page with the detail. The repository has no issues filed yet, so these come from the README, the code and the runs behind this wiki.
There is no such post on that site, or the post came back without markdown. Check the site (the default is stackoverflow) and whether the id is an answer's: answers need isForAnswer: true, or -a on the command line. See How markdown is retrieved.
The API sends body_markdown with HTML entities in it and the package passes the text on untouched. Recipes has a small decoder.
That is the order 1.x used, and 2.0.0 kept it so old callers keep working. It also means util.promisify gets it backwards. Leave out the callback to get a Promise instead (Recipes).
The README gives the API's anonymous quota as 300 requests a day per IP address; an API key (apiKey, or -k) raises it. The package makes one request per call, keeps no cache and does not track the quota. When the API throttles you, the call fails with a StackExchangeError whose errorName is throttle_violation (Recipes).
Ids joined by ; go into one request, but the call returns only the first post in the API's answer. Call it once per post (Recipes).
Yes, through the runtime: on Node 24 set NODE_USE_ENV_PROXY=1 and HTTPS_PROXY before Node starts; Node 20 ignores NODE_USE_ENV_PROXY and needs undici's EnvHttpProxyAgent preloaded; Deno and Bun read HTTPS_PROXY themselves (Recipes). Keep the timeout on, because a proxy that drops the tunnel makes fetch retry until it fires (Edge cases and errors).
Deno 2.9.6 (with --allow-net) and Bun 1.4.2 were run for this wiki (Getting started). Browsers and workers were not tested; the README says the library uses only web platform APIs, and in a browser the API's CORS headers decide.
Probably because the error came from the other build. The ES module and CommonJS builds each have their own class, so an error thrown by the CommonJS build is not an instance of the ES module's class. Compare error.name (Edge cases and errors).
null means the post does not exist; that is an answer, not an error. Errors print one line to stderr and exit 1 (Commands).
With npm 11.16.0, npx stack-exchange-markdown-retriever@2.0.0 -s scifi 127968 and ... -a 1010 passed -s and -a to the tool (Getting started). Other npm versions were not tested.
Version 2.2, with a fixed filter, and there is no option to change it (How markdown is retrieved).
No. Every 1.x version is deprecated on npm; 1.x depends on the deprecated request package, its command line tool was never installed and -a was ignored. Versions and upgrading lists what changes.
This wiki describes stack-exchange-markdown-retriever 2.0.0 and was last updated on 2026-09-29. The library is MIT licensed. Report problems in the issues. On npm: stack-exchange-markdown-retriever.
Using it
The releases
Contributing
Elsewhere