The youngsters, all aged 13, fell ill and were taken to Crosshouse Hospital in Kilmarnock on Saturday.
Police Scotland said it was investigating whether they had taken a type of MDMA tablet stamped with an owl logo.
The children – who are all known to each other – were kept in hospital overnight for observations.
Detective Inspector Fraser Normansell said: “One line of enquiry is that they had taken a type of MDMA tablet, believed to be red, green or brown in colour bearing an owl logo.
“We want to remind the public that any drug can be dangerous and that you are putting your health at risk if you do take anything unknown to you.
“Anyone who feels unwell, or knows anyone who appears unwell after taking these substances should seek medical treatment as soon as possible.”