1

Currently I am working on the project where I need to collect all questions from the Stack Overflow site.

from stackapi import StackAPI

SITENAME = 'stackoverflow'
SITE = StackAPI(SITENAME)

questions = SITE.fetch('questions')
print(len(questions))

I passed various arguments to the fetch method, but maximum amount of responses that I get is 500.

Is there any way to increase the number of responses using fetch method? If not is there any other way to collect all question from Stack Overflow?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • 3
    just take a step back and consider how large the object would be if you fetched _every_ question from StackOverflow. now realize why that is not possible – gold_cy Sep 30 '21 at 15:35
  • 3
    also take a look at the docs --> https://stackapi.readthedocs.io/en/latest/api.html#stackapi.StackAPI you will see the limitiations imposed on `page_size` and `max_pages` – gold_cy Sep 30 '21 at 15:38
  • 2
    See https://meta.stackexchange.com/a/277952/186121 – nanofarad Sep 30 '21 at 15:43

0 Answers0