They are not harmful to eat if you cut them out, but they spoil fruit.
Females lay eggs on leaves and fruit; the hatching larvae bore into the fruit, usually through the blossom end, and feed on the core and seeds.
The apple maggot is the larva of a small fly with banded wings, related to fruit flies.
Codling moth larvae and apple maggots are not toxic or harmful to people.
Bagging is the most effective non-chemical method for a few trees.
If you choose to spray, timing matters more than the product.
Parts of the western US, including areas of Washington, Oregon and California, have quarantines to keep apple maggot out of commercial orchard districts.
Step-by-step advice, charts and free garden calculators at Garden Voila.