A set is the numbered run. A master set is that plus everything else the packs can still give you. A grandmaster set is that plus everything the set produced outside a booster. None of that is a standard, though. It's roughly what people mean, and the line that counts is the one you draw yourself.
Three words come up often enough to be useful shorthand. Nobody official defines them, so treat them as a shared starting point rather than a specification.
Set
The numbered run. Every card from the first number up to the set's stated total, one copy each.
Master set
The numbered run, plus the secret rares numbered above that total, plus the holo variants that come out of the same packs. Reverse holos mostly, though recent Chinese releases add a good deal more in-set variants than that.
Grandmaster set
Everything above, plus the official promos attached to the set (MEP, SVP, SWSHP and the rest) and the printings that never came out of a booster: jumbos, stamped copies, deck exclusives, event and special-product cards.
By set
Pick a release and take it as far as you want. The three tiers above are written for this case: one print run, with a clear finish line at each step.
By Pokémon
Pick a Pokémon and chase it across every set and series it ever appeared in. The same steps roughly apply, but this is where the lines get genuinely arguable.
Take a Charizard master set. Counting every card with Charizard in the name pulls in Dark Charizard and every ex, V, VMAX and Mega. Counting the ones where Charizard only turns up in the artwork, behind a Trainer or over another Pokémon's shoulder, and it grows again. Plenty of collectors say yes to that. Plenty say absolutely not.
There's no answer to look up, because there's no authority to look it up from: a name means whatever the community roughly agrees it means. And your own scope will move as the easy cards run out. So the goal isn't to publish the correct definition, it's to let you set that scope, change it later, and have the page keep up.
151
The Kanto 151, remade for Scarlet & Violet. Bulbasaur through Mew, plus everything the set hides behind them.
More sets are coming, along with single-Pokémon pages. Further out, the scope becomes something you set yourself.
Sets and Pokémon are only the two most obvious ways in. There are also illustrator sets, trainer and character mastersets, and collections defined by a property rather than a print run: every jumbo, every staff-stamped copy, every card whose art gathers a full evolution line.
The common ones are built by hand, because card order and what counts as a variant are judgment calls a query can't make. The rest is tooling: poké.dev data underneath, and foundation code that makes each new mini-app cheap to stand up, so a collection idea becomes a masterset app without anyone writing it from scratch. Free, no account, no ads.