I haven’t found any way to find the key of a song in Audacity. It would be really useful for putting together mixes and adding more parts from other sources.
Audacity can not tell you the key of a song. In fact, I don’t know of any program that can. To know the key of a song you need to know about the harmonic structure of a song. You can not work out the key of a song from signal notes, or even single chords. You need to know how the chords fit together.
You can find the pitch of prominent frequencies in a section of audio with the “Plot Spectrum” tool in the “Analyze” menu.
I found a plug-in for Windows Media Player called Muse-On that does a pretty good job of finding the key. Obviously, some music has accidentals, and C Major has the same notes as A minor etc., and you need to have enough notes to rule out some keys, but this plug-in does a pretty good job. It’s great for grabbing the right key to play along with with a harmonica. Basically, if you have something that identifies the pitch it’s just a matter of eliminating keys it’s not until you have either the key it’s in or a key it works in.
Sometimes even people with loads of theory find it hard to agree on keys, even for “simple” tunes like Greensleeves.
It can be difficult to agree on keys but a site like https://www.getsongkey.com offer their own analysis which I;ve found to be accurate. Their harmonxi mising tool is really helpful too and I use it to throw some tracks in on the fly when I’m DJ’ing or when I’m planning out my music productions.