Fasting bring on a rapid release of toxins. Apples are also very cleansing. Your body was probably rapidly detoxing and entering ketosis. There was lot whole lot going on. This kind of detox can last for days and can be pretty rough. You can slow it down by drinking a little juice once or twice a day. Carbohydrates help because you give your body some glucose to fuel it and ketosis slows or stops. Since ketones come from adipose tissue, which is commonly filled with stored toxins, you got a big whammy all at once. If this happens again, consider doing a juice fast or Master Cleanse for a week or so to get some more toxins out in a more gentle manner. Surprisingly, you can lose as much weight through juice fasting as you can through Water Fasting because Water Fasting shuts down the metabolism pretty fast. You would be better off on juice because the apple will not allow the digestive system to shut down, in a sense, it ceases to be a fast and becomes a starvation diet.
If you do not want to go through the trouble of juicing, consider getting a high quality green powder drink. One serving contains 35-45 calories. You can have two or three glasses of highly nutritious liquid food for about the same number of calories as the apple.