osu!search uses the osu!api to find similar beatmaps based on a certain difficulty's properties (, , ).
in osu!lazer, you can copy a beatmap's link by right clicking on the diff, and the final part of it (usually a number) is the difficulty id. for single difficulty maps, you can paste the link into your browser, and it'll expand with the difficulty id. in osu!stable, i have no fucking clue.