curl --request POST \
--url https://api.aisa.one/apis/v1/stackexchange-com/questions/answers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question_id": 3940128
}
'import requests
url = "https://api.aisa.one/apis/v1/stackexchange-com/questions/answers"
payload = { "question_id": 3940128 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({question_id: 3940128})
};
fetch('https://api.aisa.one/apis/v1/stackexchange-com/questions/answers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/stackexchange-com/questions/answers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'question_id' => 3940128
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/stackexchange-com/questions/answers"
payload := strings.NewReader("{\n \"question_id\": 3940128\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/stackexchange-com/questions/answers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"question_id\": 3940128\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/stackexchange-com/questions/answers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"question_id\": 3940128\n}"
response = http.request(request)
puts response.read_body{
"answers": [
{
"answer_id": 3940144,
"body_html": "<p>To get a <em>new</em> reversed list, apply the <a href=\"https://docs.python.org/3/library/functions.html#reversed\" rel=\"noreferrer\"><code>reversed</code></a> function and collect the items into a <a href=\"https://docs.python.org/3/library/stdtypes.html#list\" rel=\"noreferrer\"><code>list</code></a>:</p>\n<pre><code>>>> xs = [0, 10, 20, 40]\n>>> list(reversed(xs))\n[40, 20, 10, 0]\n</code></pre>\n<p>To iterate backwards through a list:</p>\n<pre><code>>>> xs = [0, 10, 20, 40]\n>>> for x in reversed(xs):\n... print(x)\n40\n20\n10\n0\n</code></pre>\n",
"body_markdown": "To get a *new* reversed list, apply the [`reversed`][1] function and collect the items into a [`list`][list]:\r\n\r\n```\r\n>>> xs = [0, 10, 20, 40]\r\n>>> list(reversed(xs))\r\n[40, 20, 10, 0]\r\n```\r\n\r\nTo iterate backwards through a list:\r\n\r\n```\r\n>>> xs = [0, 10, 20, 40]\r\n>>> for x in reversed(xs):\r\n... print(x)\r\n40\r\n20\r\n10\r\n0\r\n```\r\n\r\n [1]: https://docs.python.org/3/library/functions.html#reversed\r\n [pep0322]: https://www.python.org/dev/peps/pep-0322/\r\n [list]: https://docs.python.org/3/library/stdtypes.html#list",
"comment_count": 8,
"content_license": "CC BY-SA 4.0",
"created_at_ms": 1287126140000,
"is_accepted": true,
"last_activity_at_ms": 1660588390000,
"last_edit_at_ms": 1660588390000,
"owner": {
"display_name": "codaddict",
"link": "https://stackoverflow.com/users/227665/codaddict",
"reputation": 457906,
"user_id": 227665,
"user_type": "registered"
},
"question_id": 3940128,
"question_title": "How do I reverse a list or loop over it backwards?",
"score": 1738,
"site": "stackoverflow",
"source_url": "https://stackoverflow.com/questions/3940128/how-do-i-reverse-a-list-or-loop-over-it-backwards/3940144#3940144"
},
{
"answer_id": 3940137,
"body_html": "<pre><code>>>> xs = [0, 10, 20, 40]\n>>> xs[::-1]\n[40, 20, 10, 0]\n</code></pre>\n<p>Extended slice syntax is explained <a href=\"http://docs.python.org/release/2.3.5/whatsnew/section-slices.html\" rel=\"noreferrer\">here</a>. See also, <a href=\"http://docs.python.org/library/functions.html#slice\" rel=\"noreferrer\">documentation</a>.</p>\n",
"body_markdown": "```\r\n>>> xs = [0, 10, 20, 40]\r\n>>> xs[::-1]\r\n[40, 20, 10, 0]\r\n```\r\n\r\nExtended slice syntax is explained [here][1]. See also, [documentation][2].\r\n\r\n\r\n [1]: http://docs.python.org/release/2.3.5/whatsnew/section-slices.html\r\n [2]: http://docs.python.org/library/functions.html#slice",
"comment_count": 9,
"content_license": "CC BY-SA 4.0",
"created_at_ms": 1287126072000,
"is_accepted": false,
"last_activity_at_ms": 1649496982000,
"last_edit_at_ms": 1649496982000,
"owner": {
"display_name": "mechanical_meat",
"link": "https://stackoverflow.com/users/42346/mechanical-meat",
"reputation": 170962,
"user_id": 42346,
"user_type": "registered"
},
"question_id": 3940128,
"question_title": "How do I reverse a list or loop over it backwards?",
"score": 1542,
"site": "stackoverflow",
"source_url": "https://stackoverflow.com/questions/3940128/how-do-i-reverse-a-list-or-loop-over-it-backwards/3940137#3940137"
}
],
"count": 2,
"has_more": true,
"observed_at_ms": 1789448650474,
"page": 1,
"question_id": 3940128,
"quota": {
"backoff_seconds": null,
"max": 300,
"remaining": 299
},
"site": "stackoverflow",
"source_url": "https://api.stackexchange.com/2.3/questions/3940128/answers?site=stackoverflow&pagesize=2&sort=votes&filter=%217ry9ouLWcQWrdWSzrv7eT0TX0kxJ.zt0R1",
"total": 18
}Answers
Answers to one question (by question_id + site or URL), one page per call, sorted by votes, activity or creation. Each answer carries is_accepted, score, bodies, owner and its canonical URL.
curl --request POST \
--url https://api.aisa.one/apis/v1/stackexchange-com/questions/answers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question_id": 3940128
}
'import requests
url = "https://api.aisa.one/apis/v1/stackexchange-com/questions/answers"
payload = { "question_id": 3940128 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({question_id: 3940128})
};
fetch('https://api.aisa.one/apis/v1/stackexchange-com/questions/answers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/stackexchange-com/questions/answers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'question_id' => 3940128
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/stackexchange-com/questions/answers"
payload := strings.NewReader("{\n \"question_id\": 3940128\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/stackexchange-com/questions/answers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"question_id\": 3940128\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/stackexchange-com/questions/answers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"question_id\": 3940128\n}"
response = http.request(request)
puts response.read_body{
"answers": [
{
"answer_id": 3940144,
"body_html": "<p>To get a <em>new</em> reversed list, apply the <a href=\"https://docs.python.org/3/library/functions.html#reversed\" rel=\"noreferrer\"><code>reversed</code></a> function and collect the items into a <a href=\"https://docs.python.org/3/library/stdtypes.html#list\" rel=\"noreferrer\"><code>list</code></a>:</p>\n<pre><code>>>> xs = [0, 10, 20, 40]\n>>> list(reversed(xs))\n[40, 20, 10, 0]\n</code></pre>\n<p>To iterate backwards through a list:</p>\n<pre><code>>>> xs = [0, 10, 20, 40]\n>>> for x in reversed(xs):\n... print(x)\n40\n20\n10\n0\n</code></pre>\n",
"body_markdown": "To get a *new* reversed list, apply the [`reversed`][1] function and collect the items into a [`list`][list]:\r\n\r\n```\r\n>>> xs = [0, 10, 20, 40]\r\n>>> list(reversed(xs))\r\n[40, 20, 10, 0]\r\n```\r\n\r\nTo iterate backwards through a list:\r\n\r\n```\r\n>>> xs = [0, 10, 20, 40]\r\n>>> for x in reversed(xs):\r\n... print(x)\r\n40\r\n20\r\n10\r\n0\r\n```\r\n\r\n [1]: https://docs.python.org/3/library/functions.html#reversed\r\n [pep0322]: https://www.python.org/dev/peps/pep-0322/\r\n [list]: https://docs.python.org/3/library/stdtypes.html#list",
"comment_count": 8,
"content_license": "CC BY-SA 4.0",
"created_at_ms": 1287126140000,
"is_accepted": true,
"last_activity_at_ms": 1660588390000,
"last_edit_at_ms": 1660588390000,
"owner": {
"display_name": "codaddict",
"link": "https://stackoverflow.com/users/227665/codaddict",
"reputation": 457906,
"user_id": 227665,
"user_type": "registered"
},
"question_id": 3940128,
"question_title": "How do I reverse a list or loop over it backwards?",
"score": 1738,
"site": "stackoverflow",
"source_url": "https://stackoverflow.com/questions/3940128/how-do-i-reverse-a-list-or-loop-over-it-backwards/3940144#3940144"
},
{
"answer_id": 3940137,
"body_html": "<pre><code>>>> xs = [0, 10, 20, 40]\n>>> xs[::-1]\n[40, 20, 10, 0]\n</code></pre>\n<p>Extended slice syntax is explained <a href=\"http://docs.python.org/release/2.3.5/whatsnew/section-slices.html\" rel=\"noreferrer\">here</a>. See also, <a href=\"http://docs.python.org/library/functions.html#slice\" rel=\"noreferrer\">documentation</a>.</p>\n",
"body_markdown": "```\r\n>>> xs = [0, 10, 20, 40]\r\n>>> xs[::-1]\r\n[40, 20, 10, 0]\r\n```\r\n\r\nExtended slice syntax is explained [here][1]. See also, [documentation][2].\r\n\r\n\r\n [1]: http://docs.python.org/release/2.3.5/whatsnew/section-slices.html\r\n [2]: http://docs.python.org/library/functions.html#slice",
"comment_count": 9,
"content_license": "CC BY-SA 4.0",
"created_at_ms": 1287126072000,
"is_accepted": false,
"last_activity_at_ms": 1649496982000,
"last_edit_at_ms": 1649496982000,
"owner": {
"display_name": "mechanical_meat",
"link": "https://stackoverflow.com/users/42346/mechanical-meat",
"reputation": 170962,
"user_id": 42346,
"user_type": "registered"
},
"question_id": 3940128,
"question_title": "How do I reverse a list or loop over it backwards?",
"score": 1542,
"site": "stackoverflow",
"source_url": "https://stackoverflow.com/questions/3940128/how-do-i-reverse-a-list-or-loop-over-it-backwards/3940137#3940137"
}
],
"count": 2,
"has_more": true,
"observed_at_ms": 1789448650474,
"page": 1,
"question_id": 3940128,
"quota": {
"backoff_seconds": null,
"max": 300,
"remaining": 299
},
"site": "stackoverflow",
"source_url": "https://api.stackexchange.com/2.3/questions/3940128/answers?site=stackoverflow&pagesize=2&sort=votes&filter=%217ry9ouLWcQWrdWSzrv7eT0TX0kxJ.zt0R1",
"total": 18
}Request contract
- Method and path: POST /apis/v1/stackexchange-com/questions/answers
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/stackexchange-com/questions/answers
{
"operationId": "stackexchange-com.questions.answers",
"method": "POST",
"path": "/apis/v1/stackexchange-com/questions/answers",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"examples": {
"provider": {
"summary": "Official provider example; checked against AIsa request constraints",
"value": {
"pagesize": 2,
"question_id": 3940128
}
}
},
"schema": {
"additionalProperties": true,
"allOf": [
{
"anyOf": [
{
"properties": {
"question_id": {}
},
"required": [
"question_id"
]
},
{
"properties": {
"url": {}
},
"required": [
"url"
]
}
]
}
],
"properties": {
"include_body": {
"description": "include_body",
"type": "boolean",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"key": {
"description": "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.",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"order": {
"default": "desc",
"description": "order\n\nProvider reference: allowed values [\"desc\", \"asc\"]; default \"desc\".",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body",
"oneOf": [
"desc",
"asc"
]
}
},
"page": {
"default": 1,
"description": "Pages above 25 need `key`: Stack Exchange serves deeper pages only with an application key (`access_denied` otherwise). Without one the last page reports partial coverage.\n\nProvider reference: minimum 1; maximum 10000; default 1.",
"type": "number",
"x-alexandria-option-metadata": {
"in": "body",
"max": 10000,
"min": 1
}
},
"pagesize": {
"default": 30,
"description": "pagesize\n\nProvider reference: minimum 1; maximum 100; default 30.",
"type": "number",
"x-alexandria-option-metadata": {
"in": "body",
"max": 100,
"min": 1
}
},
"question_id": {
"description": "question_id",
"type": "number"
},
"site": {
"default": "stackoverflow",
"description": "Stack Exchange site API parameter, e.g. stackoverflow, superuser, math, askubuntu, english, physics. Use `sites` to list them. Pattern: ^[a-z0-9]+(\\.[a-z0-9]+)*$.\n\nProvider reference: default \"stackoverflow\".",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"sort": {
"default": "votes",
"description": "sort\n\nProvider reference: allowed values [\"votes\", \"activity\", \"creation\"]; default \"votes\".",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body",
"oneOf": [
"votes",
"activity",
"creation"
]
}
},
"url": {
"description": "HTTPS question URL on any Stack Exchange site, e.g. https://stackoverflow.com/questions/3940128/... or https://math.stackexchange.com/q/11. The site is derived from the host.",
"type": "string"
}
},
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Usage-based pricing. Default request estimate: $0.0005 USD. The final charge depends on actual usage. Your account price may differ; use a request quote where supported.Authorizations
Body
- Option 1
- Option 2
HTTPS question URL on any Stack Exchange site, e.g. https://stackoverflow.com/questions/3940128/... or https://math.stackexchange.com/q/11. The site is derived from the host.
Response
Answers to one question (by question_id + site or URL), one page per call, sorted by votes, activity or creation. Each answer carries is_accepted, score, bodies, owner and its canonical URL.
The response contains the tool result directly.
| Documented field | Provider type | Description |
|---|---|---|
answers | object[] | |
count | number | |
has_more | boolean | |
observed_at_ms | number | |
page | number | |
question_id | number | |
quota | object | |
site | string | |
source_url | string | |
total | number |
These are the provider's documented fields. Field requiredness, nullability and nested object structures are specified only where the descriptions explicitly say so.