Hi, and thanks for your medical question on eHealth forum!
It can be due to pregnancy so take a test if you miss periods. Once in a while it can be due to urinating too rapidly. Mild dehydration is another cause. You could drink more water to see if it goes away.
However, persistently foamy urine can be a sign of protein in your urine (proteinuria), which requires further evaluation. Large amounts of protein in urine may indicate a serious kidney problem. Urinary tract infection (UTI) is the other cause. Since a confirmed diagnosis cannot be given on net please consult your gynecologist regarding this. Hope this helps. Take care!