"Use of fireworks originated in China and later spread to India through trade and military contact. Fireworks constitute an integral part of Indian festivals and are particularly important in Kerala temples.
When and how did the usage of fireworks originate?
The use of fireworks originated in China. The prime constituent of fireworks is gunpowder, which in turn is formed of saltpeter, sulfur and charcoal. It is saltpeter which gives the colours to fireworks, while the other two ingredients are required for prolonging its effects. In his work, “Book of the kinship of the three”, Wei Boyang of the Han dynasty in second century CE, had first mentioned the use of a substance which historians believe was the first reference to gunpowder.
There are other historians who ascribe the origins of gunpowder to Indian Sanskrit texts such as the Nitiprakasika of Vaisampayana which was compiled in the 8th century BCE. However, the potential of gunpowder to be used in fireworks was not realised during this period.
Saltpeter and Sulphur appeared in Chinese texts before the first century CE. Historian Kaushik Roy is of the opinion that ancient India was aware of the existence of saltpeter which was known as ‘agnichurna’ (powder that creates fire). Reference to the substance is available in Kautilya’s Arthashastra, an ancient Sanskrit treatise on statecraft and military strategy. It was composed between 300 BCE and 300 CE. .."
Find this at http://indianexpress.com/article/research/kollam-temple-fire-kerala-fireworks-history .