We report on the investigation of In surface segregation in GaInP/GaAs and GaInAs/GaAs heterostructures grown by chemical beam epitaxy (CBE). Owing to the peculiarities of CBE growth, it is shown that In segregation can be quantitatively evaluated in real-time by using reflection high-energy electron diffraction (RHEED). A segregation coefficient and its variation with the growth temperature is extracted from the RHEED data. It is used to determine the In composition profiles at the interfaces of GaInAs/GaAs quantum well (QW) structures as a function of the growth temperature. A good agreement is found between optical transition energies calculated from these profiles and the experimental photoluminescence (PL) energies. PL energy shifts observed in GaInP/GaAs QW's as a function of the growth temperature are qualitatively explained by In segregation.