Setup
Put them in your environment or
.env; Data APIs covers the other ways.
Notes
- Every per-site call needs site (e.g. stackoverflow).
- Quota: 10,000 requests a day per IP by default (shared by keyless apps on that IP); without a key or token at most 25 pages are returned. Over 30 requests a second from one IP gets the IP banned for a while.
- When a response carries backoff, wait that many seconds before calling the same method again. Do not repeat an identical request within a minute; responses are cached.
- Responses are always gzip or deflate compressed. Every response is a wrapper with items, has_more and quota_remaining; total only with filter=total or a custom filter.
- Dates are Unix epoch seconds. Bodies are not returned by default: pass filter=withbody.
Endpoints
Search questions
- Does not accept min or max.
Search with excerpts
- Highlighted terms are wrapped in <span class=“highlight”>.
Find similar questions
Get questions by id
Get answers to questions
Get answers by id
Get users
List tags
List Stack Exchange sites
- Changes rarely: cache for at least a day.