Witnesses said one of the homemade bombs — bottles filled with gasoline or other inflammable liquid, with a rag as a fuse — did not explode because heavy rain put its flame out.
An employee at embassy contacted by AFP said she was not authorized to comment on the incident.
The attack occurred in a tense security climate in Venezuela, heightened by protests against a new “Constituent Assembly” that is to start work on Friday with sweeping powers.
Spain has been especially critical of the new body, whose election was orchestrated by Venezuelan President Nicolas Maduro. It and the rest of the European Union have said they will not recognize the assembly as legitimate.
According to Venezuela's prosecutors' office, the two attackers threw several Molotov cocktails at the Spanish embassy, located in the chic inner-eastern district of Chacao.
The district's mayor, Ramon Muchacho, sent photos to AFP, one showing a soda bottle filled with what appeared to be gasoline, with red cloth stuffed into it. Another showed a black mark that could have come from a small explosion.
Neither the prosecutors nor the mayor linked the attack to Venezuela's degraded political situation.