bpy answers that run on the Blender version you actually have.

The Python API changes every release and old tutorials keep ranking. bpy-compass reads a Sanity Context Knowledge Base built from the official release notes, cites the entries it used, and tells you which popular pattern broke, in which version, and what replaced it.

Blender version the script must run on

LTS, current long-term release

Pick the version you are scripting for, then ask. Every answer comes back as a script valid for that version, a list of patterns that stopped working and when, and the Knowledge Base entries it was read from.

Try the same question on 4.2 and 5.0 to see the answer change.