1Request
string[]Required

tagged Separate values with commas.

boolean

include_body

string

Optional Stack Exchange application key. Raises the per-IP quota from 300 to 10,000 requests per day. Keys are public identifiers, not secrets.

number

page

number

pagesize

string

sort

5 credits
Codefollows the fields above
const result = await firecrawl.scrape({
  alexandria: {
    provider: "stackexchange-com",
    capability: "questions/accepted_answers",
    options: {
      pagesize: 1,
      sort: "votes",
      tagged: [
        "python",
      ],
    },
  },
});
2Response example

This is a sample shape. Press Run to see live data from Stack Exchange.

Long values are shortened in this preview. The full response is 25 KB.

{
  "count": 1,
  "has_more": true,
  "observed_at_ms": 1789448650776,
  "page": 1,
  "q": null,
  "quota": {
    "backoff_seconds": null,
    "max": 300,
    "remaining": 293
  },
  "results": [
    {
      "accepted_answer": {
        "answer_id": 231855,
        "body_html": "<p>To understand what <a href=\"https://docs.python.org/3/reference/simple_stmts.html#yield\" rel=\"noreferrer\"><code>yield</code></a> does, you must understand what <em><a href=\"https://docs.python.org/3/glossary.html#term-generator\" rel=\"noreferrer\">generators</a></em> are. And before you can understand generators, you must understand <em><a href=\"https://docs.python.org/3/glossary.html#term-iterable\" rel=\"noreferrer\">iterables</a></em>.</p>\n<h2>Iterables</h2>\n<p>When you create a list, you can read its items one by one. Reading its items one by one is called iteration:</p>\n<pre><code>&gt;&gt;&gt; mylist = [1, 2, 3]\n&gt;&gt;&gt; for i in mylist:\n...    print(i)\n1\n2\n3\n</code></pre>\n<p><code>mylist</code> is an <em>iterable</em>. When you use a list comprehension, you create a list, and so an iterable:</p>\n<pre><code>&gt;&gt;&gt; mylist = [x*x for x in range(3)]\n&gt;&gt;&gt; for i in mylist:\n...    print(i)\n0\n1\n4\n</code></pre>\n<p>Everything you can use &quot;<code>for... in...</code>&quot; on is an iterable; <code>lists</code>, <code>strings</code>, files...</p>\n<p>These iterables are handy because you can read them as much as you wish, but you store all the values in memory and this is not always what you want when you have a lot of values.</p>\n<h2>Generators</h2>\n<p>Generators are <em><a href=\"https://docs.python.org/3/glossary.html#term-iterator\" rel=\"noreferrer\">iterators</a></em>, a kind of iterable <strong>you can only iterate over once</strong>. Generators do not store all the values in memory, <strong>they generate the values on the fly</strong>:</p>\n<pre><code>&gt;&gt;&gt; mygenerator = (x*x for x in range(3))\n&gt;&gt;&gt; for i in mygenerator:\n...    print(i)\n0\n1\n4\n</code></pre>\n<p>It is just the same except you used <code>()</code> instead of <code>[]</code>. BUT, you <strong>cannot</strong> perform <code>for i in mygenerator</code> a second time since generators can only be used once: they calculate 0, then forget about it and calculate 1, and end after cal… [8,035 more characters]",
        "body_markdown": "To understand what [`yield`] does, you must understand what *[generators]* are. And before you can understand generators, you must understand *[iterables]*.\r\n\r\nIterables\r\n---------\r\n\r\nWhen you create a list, you can read its items one by one. Reading its items one by one is called iteration:\r\n\r\n    >>> mylist = [1, 2, 3]\r\n    >>> for i in mylist:\r\n    ...    print(i)\r\n    1\r\n    2\r\n    3\r\n\r\n`mylist` is an *iterable*. When you use a list comprehension, you create a list, and so an iterable:\r\n\r\n    >>> mylist = [x*x for x in range(3)]\r\n    >>> for i in mylist:\r\n    ...    print(i)\r\n    0\r\n    1\r\n    4\r\n\r\nEverything you can use \"`for... in...`\" on is an iterable; `lists`, `strings`, files...\r\n\r\nThese iterables are handy because you can read them as much as you wish, but you store all the values in memory and this is not always what you want when you have a lot of values.\r\n\r\nGenerators\r\n----------\r\n\r\nGenerators are *[iterators]*, a kind of iterable **you can only iterate over once**. Generators do not store all the values in memory, **they generate the values on the fly**:\r\n\r\n    >>> mygenerator = (x*x for x in range(3))\r\n    >>> for i in mygenerator:\r\n    ...    print(i)\r\n    0\r\n    1\r\n    4\r\n\r\nIt is just the same except you used `()` instead of `[]`. BUT, you **cannot** perform `for i in mygenerator` a second time since generators can only be used once: they calculate 0, then forget about it and calculate 1, and end after calculating 4, one by one.\r\n\r\nYield\r\n-----\r\n\r\n`yield` is a keyword that is used like `return`, except the function will return a generator.\r\n\r\n    >>> def create_generator():\r\n    ...    mylist = range(3)\r\n    ...    for i in mylist:\r\n    ...        yield i*i\r\n    ...\r\n    >>> mygenerator = create_generator() # create a generator\r\n    >>> print(mygenerator) # mygenerator is an object!\r\n    <generator object create_generator at 0xb7555c34>\r\n    >>> for i in mygenerator:\r\n    ...     print(i)\r\n    0\r\n    1\r\n    4\r\n\r\nHere it's a useless example, but it'… [7,522 more characters]",
        "comment_count": 13,
        "content_license": "CC BY-SA 4.0",
        "created_at_ms": 1224802124000,
        "is_accepted": true,
        "last_activity_at_ms": 1711253853000,
        "last_edit_at_ms": 1711253853000,
        "owner": {
          "display_name": "Bite code",
          "link": "https://stackoverflow.com/users/9951/bite-code",
          "reputation": 601941,
          "user_id": 9951,
          "user_type": "registered"
        },
        "question_id": 231767,
        "question_title": "What does the \"yield\" keyword do in Python?",
        "score": 18317,
        "site": "stackoverflow",
        "source_url": "https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do-in-python/231855#231855"
      },
      "question": {
        "accepted_answer_id": 231855,
        "answer_count": 51,
        "body_html": "<p>What functionality does the <a href=\"https://docs.python.org/3/reference/simple_stmts.html#yield\" rel=\"noreferrer\"><code>yield</code></a> keyword in Python provide?</p>\n<p>For example, I'm trying to understand this code<sup><strong>1</strong></sup>:</p>\n<pre><code>def _get_child_candidates(self, distance, min_dist, max_dist):\n    if self._leftchild and distance - max_dist &lt; self._median:\n        yield self._leftchild\n    if self._rightchild and distance + max_dist &gt;= self._median:\n        yield self._rightchild  \n</code></pre>\n<p>And this is the caller:</p>\n<pre><code>result, candidates = [], [self]\nwhile candidates:\n    node = candidates.pop()\n    distance = node._get_dist(obj)\n    if distance &lt;= max_dist and distance &gt;= min_dist:\n        result.extend(node._values)\n    candidates.extend(node._get_child_candidates(distance, min_dist, max_dist))\nreturn result\n</code></pre>\n<p>What happens when the method <code>_get_child_candidates</code> is called?\nIs a list returned? A single element? Is it called again? When will subsequent calls stop?</p>\n\n<hr />\n<sub>\n1. This piece of code was written by Jochen Schulz (jrschulz), who made a great Python library for metric spaces. This is the link to the complete source: <a href=\"https://well-adjusted.de/~jrspieker/mspace/\" rel=\"noreferrer\">Module mspace</a>.</sub> \n",
        "body_markdown": "What functionality does the [`yield`] keyword in Python provide?\r\n\r\nFor example, I'm trying to understand this code<sup>**1**</sup>:\r\n\r\n    def _get_child_candidates(self, distance, min_dist, max_dist):\r\n        if self._leftchild and distance - max_dist < self._median:\r\n            yield self._leftchild\r\n        if self._rightchild and distance + max_dist >= self._median:\r\n            yield self._rightchild\t\r\n\r\nAnd this is the caller:\r\n\r\n    result, candidates = [], [self]\r\n    while candidates:\r\n        node = candidates.pop()\r\n        distance = node._get_dist(obj)\r\n        if distance <= max_dist and distance >= min_dist:\r\n            result.extend(node._values)\r\n        candidates.extend(node._get_child_candidates(distance, min_dist, max_dist))\r\n    return result\r\n\r\nWhat happens when the method `_get_child_candidates` is called?\r\nIs a list returned? A single element? Is it called again? When will subsequent calls stop?\r\n\r\n\r\n[`yield`]: https://docs.python.org/3/reference/simple_stmts.html#yield\r\n\r\n<!-- https://docs.python.org/3/reference/expressions.html#yieldexpr -->\r\n\r\n\r\n----------\r\n\r\n\r\n<sub>\r\n1. This piece of code was written by Jochen Schulz (jrschulz), who made a great Python library for metric spaces. This is the link to the complete source: <a href=\"https://well-adjusted.de/~jrspieker/mspace/\">Module mspace</a>.</sub> ",
        "closed_at_ms": null,
        "closed_reason": null,
        "comment_count": 6,
        "content_license": null,
        "created_at_ms": 1224800471000,
        "is_answered": true,
        "last_activity_at_ms": 1777574627000,
        "last_edit_at_ms": 1711253482000,
        "owner": {
          "display_name": "Alex. S.",
          "link": "https://stackoverflow.com/users/18300/alex-s",
          "reputation": 148444,
          "user_id": 18300,
          "user_type": "registered"
        },
        "question_id": 231767,
        "score": 13135,
        "site": "stackoverflow",
        "source_url": "https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do-in-python",
        "tags": [
          "python",
          "iterator",
          "generator",
          "yield"
        ],
        "title": "What does the \"yield\" keyword do in Python?",
        "view_count": 3499052
      }
    }
  ],
  "site": "stackoverflow",
  "source_url": "https://api.stackexchange.com/2.3/search/advanced?site=stackoverflow&tagged=python&accepted=true&pagesize=1&sort=votes&filter=%217ry9ouLWcQWrdWSzrv7eT0TX0kxJ.zt0R1",
  "tagged": [
    "python"
  ],
  "total": 1144387
}
Browse the library