docs
  • Getting started
    • Welcome
    • 📥Installation
    • Simple example
  • API reference
    • Index
    • Module "sites"
    • Class "Site"
    • Class "Network"
    • Exceptions
  • Recipes
    • Index
    • Answers
    • Badges
    • Questions
    • Search
    • Site info
    • Users
Powered by GitBook
On this page
  1. Recipes

Badges

Getting some badges from site:

from pystackapi import Site
from pystackapi.sites import StackOverflow

site = Site(StackOverflow)

# Getting recently awarded badges in the system,
# constrained to a certain set of badges with ids 1, 2, and 3
badges_recipients = site.get_badges_recipients([1, 2, 3])

# Getting five pages of badges, that are awarded
# for participation in specific tags
tag_based_badges = site.get_tag_based_badges(pagesize=5)

print(badges_recipients)
print(tag_based_badges)
PreviousAnswersNextQuestions

Last updated 1 year ago