The clicker advice above is misleading as you can inadvertently be conditioning your dog to get a reward for the very behavior you do NOT want. My dogs both love the sound of the clicker because they know the reward is coming (operant conditioning). The clicker is used to shape behavior you want and is followed by a reward, so using the clicker for an undesirable behavior is not recommended if you are not an experienced dog trainer.
@rooeytoo is on the right track. I have done the same thing with excellent results. But timing and quick hands are important to making it an effective technique.
@Blueroses suggestion will also work, but perfect timing is often required for this method to be effective as well.
I agree that a command word (e.g., no bite) is important. But commands should be given calmly and consistently (not always possible if you are getting nipped). Chew toys are great for redirecting a dog. I found putting the bitter apple on my hand made nipping at me very undesirable and didn’t require pinpoint timing. I also question if your dog is teething. In which case, the best suggestion I have (worked for 4 dogs) is to buy a supply of cheap washcloths. Get them wet, wring them out, tie them in a knot and put in the freezer. Just like with teething children, the cold really helps with the teething pain.
I will redirect a dog to a toy, exercise the heck of him, and if he is still nippy—he gets a break from my company.