To answer the question - Air on the G Sting is actually written in the key of C.
The Air on the G String came from an original orchestral suite written by Johann Sebastian Bach for his patron Prince Leopold of Anhalt sometime between the years 1717 and 1723. Patrons paid composers to write music in the 18th century.
A century later violinist Arthur Wilhelmj's arranged the piece for violin and piano. Originally composed in D major, transposed to C and moving the melody down an octave, Wilhelmj was able to play the piece on only one string of his violin, the G string.
Many musicians agree that the lowest string on the violin is also its most sonorous. So the name remained, “Air on the G String”.
It became Bach's first work to be recorded, performed by the Russian cellist Aleksandr Verzhbilovich and an unnamed pianist, in 1902, as the Air from the Ouverture No. 3 in D major, BWV 1068.
The second movement of Bach's D Major Suite is the famous Air which is one of the most beautiful melodies ever written. It is most familiar to concert goers as a solo violin composition and is known as Air on the G String.
In its original form in the Suite the melody is given to the violins, but is not confined to the G string. The movement follows the two part song form, each part being repeated.
The second movement Air in D major is the most familiar and also the most generally admired of all of Bach's orchestral compositions. In the original version the movement is scored for the strings only the melody being carried by the violins - but not on the G string.
The Harvard Dictionary of Music by Don Michael Randel
What We Hear In Music: a course of study in music history and appreciation by Anne Faulkner Oberndorfer