Search

Searching the questions:

Warning! Either intitle or tagged keyword arguments should be passed, otherwise BadArgumentsError is passed.

from pystackapi import Site
from pystackapi.sites import StackOverflow

site = Site(StackOverflow)

# Search for questions with word "Python" in title
about = site.search(intitle='Python')
q1 = about[0]  # First returned question

# Search for questions with tag [python]
topic = site.search(tagged='Python')
q2 = topic[0]

print(f'{q1}\n')
print(f'{q2}\n')

Last updated