What's the origin of the expression "peanut gallery"? When was it first used? I know there is a similar expression in Spanish "gallinero", I wonder if they are equivalent.
According to the OED, "peanut gallery" is an informal American term that originally referred to a location in a theater:
the top gallery in a theatre or cinema, usually the location of the cheapest seats and hence regarded as the most vocal or rowdy section of the audience
(I have never heard the term used to refer to a specific part of a theater, but this definition is still listed in some modern dictionaries, so it's apparently still in use.)
According to World Wide Words, the reason it's called a peanut gallery is that:
A significant difference between the American and British theatres is that American patrons ate peanuts; these made wonderful missiles for showing their opinion of artistes they didn’t like.
The earliest citation for the expression in the OED is 1876:
As a bid for applause from the political pit and peanut gallery it was a masterpiece.
The Mountain Democrat (Placerville, California)
The earliest I have been able to find (with Google Books) is 1874:
... but, concluding that we could see nothing worth seeing from this position, in what we would call the "peanut gallery" at home, we respectfully declined the proposal.
Europe Viewed Through American Spectacles
A search of newspapers brought up a slightly earlier result:
...he thought he would buy a ticket admitting him to the peanut gallery.
Delaware state journal. (Wilmington, Del.), 31 May 1873.
Merriam Webster, on the other hand, lists 1867 as the year of first known use (but has no specific citation).
Whatever it may be now, 'peanut gallery' seems to have started as a thin veneer laid over more overtly racist names for segregated seating. The earliest use I could find of the specific phrase exposes the agenda:
It is useless for us to repeat our praises of Johnny Thompson, Billy Reeves, and others of the company, as negro delineators; they "out Herod Herod," and put the darkies in the "peanut gallery" fairly to the blush.
(The "out Herod Herod" in the quoted paragraph alludes to Shakespeare's use of the phrase in Hamlet, where it means "to outdo Herod in cruelty, etc.". Here it is probably used in a weakened sense, that is, "they are more outrageous than Herod".)
In isolation, the use of 'peanut gallery' in The Times-Picayune of 1867 might be considered incidental to the skin tones of those seated there; it is not in isolation, however. The same section of seats was commonly called the 'negro gallery' (from at least 1853 to the mid-1900s), the 'nigger gallery' (from at least 1860 to the mid-1900s), and the 'nigger seats' (from at least 1833). For example, this early use of 'nigger seats' lays the practice and terminology bare:
The following dialogue, says the N. E. Galaxy, occurred on the morning of the first discussion between Messrs. Wright and Finley, at Park-street meeting house:
'A very respectable and well-dressed colored man had taken a station in a distant corner of the gallery. A colonizationist came up to him, and the following dialogue ensued.
Colonization. You must not remain here.
Color. Where shall I go?
Colonization. Up there. [Pointing to a large martin box, commonly called nigger seats, the Liberia of every church.]
Color. Where is Mr. Simpson's pew; he invited me to take a seat in it, whenever I should come here.
Colonization. Mr. Simpson has no pew.
Color. Doesn't he come here to meeting.
Color. Well; has he no pew to sit in?
Colonization. Yes; but he hires it.
Color. Well, Sir, will you be so good as to show it to me.
Colonization. No, you can't go there, but you may go into the other gallery. [Pointing to the opposite side.]
The seat to which this colored man, whose character would dignify nine out of ten whites in this city, was so arbitrarily driven, was similar to that which he had first taken.
The Liberator, Boston, Massachusetts, 29 Jun 1833 (paywalled).
Note that the 'martin box' was so called because of its elevation and distance from the pulpit or stage, compared to other seating areas. Note also that "Liberia" in the dialog alludes to "a West African state founded in 1822 as a settlement for freed black slaves from the United States" (OED). And note finally that a 'colonizationist' was an "adherent or advocate of colonization; spec[ifically] (in U.S. Hist.) an advocate of the colonization of Africa by emancipated slaves and free black people from America, as a solution to the slavery question" (OED).
I suppose the Spanish gallinero is roughly equivalent in some senses to contemporary senses of 'peanut gallery'. Colloquial use of gallinero, especially in the UK, emphasizes the elevation of seating in theaters by refering to the spectators as "gods". Similarly, the 'peanut gallery' is today known for the rowdy and noisy behavior of its occupants, and gallinero in colloquial use refers to the noise and bedlam of the madhouse. The literal sense of gallinero, however, is "henhouse" or "coop".