Believe it or not, this genre is actually called "carnival music" (also "circus music" or occasionally "carousel music"). To get closer to this particular sound, try adding the modifier "dark" or "creepy" (i.e. "creepy carnival"). It's typically late Victorian era dance music played on circus instruments, such as the calliope organ.
Your second selection, although very related in sound, could alternately be described as a "Valse Musette", a Parisian version of waltz music typically played by street musicians, either organ grinders or accordionists. If you don't necessarily want the carnival associations, you could search for either this or "Bal Musette", a more general term for the Parisian dance music of the 1880s.
If it has vocals, this genre is called "dark cabaret," as found in the Beatles' "Mr Kite" and many of Tom Waits' best-known songs.