Stack Exchange · Search
stackexchange-com/questions/searchGet public social media posts, profiles and videos with Stack Exchange · Search from Alexandria through one Spiral API key. Questions on one Stack Exchange site matching free text (q: one term or up to 5 searched together), tags, or title/body text, optionally inside a creation-date window (fromdate/todate) and score/date bounds (min/max); accepted: true keeps only questions with an accepted answer. It runs in the background and returns structured JSON. Pay as you go, with no subscription.
Pricing
$0.00873 per call.
Limits
- Runs
- In the background
- Returns
- json
- Longest queue wait
- 1 hour
- Run deadline
- 5 minutes
- Longest run, end to end
- 225 minutes
- Largest inline input
- 1 MB
- Largest input file
- 2 GB
- Largest output
- 5 GB
Input
| Field | Kind | Default | Description |
|---|---|---|---|
q | text | — | Free-text query matched against title and body, or up to 5 such terms searched in one call (one upstream request per term; |
key | text | — | Optional Stack Exchange application key. Raises the per-IP quota from 300 to 10,000 requests per day and unlocks pages above 25, which the API refuses anonymously. Keys are public identifiers, not secrets. |
max | number | — | Upper bound on the sort field: score for |
min | number | — | Lower bound on the sort field: score for |
url | text | — | A pasted site search URL (https://stackoverflow.com/search?q=..., any Stack Exchange host) or tag listing URL (https://superuser.com/questions/tagged/windows+powershell). The site comes from the host, |
body | text | — | Text that must appear in the body. |
page | number 1 to 10000 | 1 | Pages above 25 need |
site | text | stackoverflow | Stack Exchange site API parameter, e.g. stackoverflow, superuser, math, askubuntu, english, physics. Use |
sort | one of relevance, votes, activity, creation | — | Defaults to |
order | one of desc, asc | desc | order |
title | text | — | Text that must appear in the title. |
closed | true or false | — | closed |
tagged | list | — | Every tag must be present on the question. |
todate | number | — | Upper bound on the question's creation time, inclusive: Unix seconds, |
accepted | true or false | — | true: only questions with an accepted answer; false: only without. |
fromdate | number | — | Lower bound on the question's creation time, inclusive: Unix seconds, |
pagesize | number 1 to 100 | 10 | pagesize |
nottagged | list | — | None of these tags may be present. |
min_answers | number 0 to 1000 | — | min_answers |
include_body | true or false | — | true adds body_html/body_markdown to every question; off by default because bodies dominate the response size. |
Same request in code
curl https://api.spiral.ai/v1/runs \
-H "Authorization: Bearer $SPIRAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"provider": "alexandria",
"model": "stackexchange-com/questions/search",
"input": {
"q": "<q>"
}
}'Frequently asked questions
How much does Stack Exchange · Search cost?
$0.00873 per call. You pay as you go from one Spiral balance, with no subscription, and a failed run is not charged.
How do I use Stack Exchange · Search through an API?
Send `POST /v1/runs` with `"provider": "alexandria"`, `"model": "stackexchange-com/questions/search"` and the input fields on this page, using one Spiral API key. It runs in the background: poll the run, or name a webhook to be told when it finishes.
Do I need an account with Alexandria to use Stack Exchange · Search?
No. Spiral runs it on its own Alexandria account and charges your Spiral balance.
Can my AI agent use Stack Exchange · Search?
Yes. Agents find and run it through Spiral's MCP server, CLI or agent skill, with the same API key.