Disclosed is a container, e.g. a medication container (1), for storing objects to be dispensed, e.g. medication objects (2). The medication container (1) comprises an opening (6) with dimensions enabling a free passage of a medication object (2) to leave the container. Shaking the medication container (1) while it is held in a slanting position cause that pills are moved to the opening (6) and will leave the container 1. A detector (42, 43 and 44) detects a medication object (2) which passes the opening (6). Electronic circuitry (8) derives and stores information related to one or more detected passages of medication objects. The container is provided with an interface for communication with the outside world for outputting the information derived.