The hamster is omnivorous. In the wild the hamster diet will contain just about any vegetable matter that is available from the smallest grass seeds to farmed crop vegetables like maize. The natural hamster diet is high in dietary fiber and quite low in protein. A good proportion of the daily intake of water will come from the vegetable matter consumed, so a wild hamster may not drink water for days.
Make sure your pet hamster has unrestricted access to fresh water as you cannot know what its requirements are in that area.
A pet hamster diet needs to be controlled to a degree. A hamster will eat between 7 and 15 grams of commercial hamster food per day depending on size.
A typical packet hamster diet that contains 15% to 20% vegetable protein, 60 to 80% carbohydrate, 5% to 10% vegetable oils and fats, 5% to 15% fiber and about 5% ash with a balance of vitamins A, D3, E and minerals made up from whole seeds, grass pellets, vegetable flakes, sunflower seeds and a few peanuts is a good basic diet.
Protein rich foods like peanuts and other nuts should be restricted to avoid your pet hamster becoming over weight.
Some people feed their hamster’s table scraps. Your hamster will probably eat them but this may cause a hygiene problem. With small particles of food being spread around the cage. This could be a source of contamination.
Fresh green vegetable and small amounts of fruit can be given, such as grapes or strawberries as explained on this Can hamsters have grapes article on Petsium.