A school in Buffalo, New York has filled a vending machine with books to get young students more interested in reading.

Locking up a stack of books behind a wall of glass and then demanding payment for them may seem like a counterintuitive way to promote literacy, but in this case it appears to be working.

The novelty is just too great a reward and the kids are eating it up. With a special 'gold coin', students at the school can pick out their favourite book, punch in the appropriate digits and - voila! - begin their very own personal library.

That's right, they get to take the books home for free. And the best part? It's not a system based on behaviour or attendance. The process is designed so that every student will get a chance to use the machine at some point.

The idea was first introduced by the assistant principal, Unseld Robinson, who was inspired by another school he visited doing something similar. He thought it could be a fun way to get parents and students at his school focused on reading.

Now, after a year of fundraising, the bow on the final product has been cut and the machine has been filled with over US$1,000 worth of books - all of which will be continuously topped up through various donations.

Each month, a random selection of children in prekindergarten through to fourth grade will earn a trip to the library and a gold coin for the vending machine nestled in the corner.

Peering through the glass, hopeful students will be able to feast their eyes on an enticing library of tasty treats. And once they have decided what they want, they can drop their coin into the slot and take their book home to read over and over again.

From Goosebumps to Pippi Longstockings and Hidden Figures, there is a wide variety of options for all age levels and all interests. However, the books will be labelled to ensure that children are curling up with something age appropriate.

Robinson says that many children in Buffalo are not reading as much as they should. So the idea of the vending machine was "to encourage reading in and out of school as well as increase every child's overall excitement about reading."

"One of the biggest issues we have in this district is literacy," Buffalo School Board member Sharon Belton-Cottman told WBFO News.

"If our children can read, they can survive."

Amen to that.