In these lectures I will show some results obtained with the chiral unitary approach applied to the photo and electroproduction of mesons. The results for photoproduction of ηπ 0 p and K 0 π 0 Σ + , together with related reactions will be shown, having with common denominator the excitation of the ∆(1700) resonance which is one of those dynamically generated in the chiral unitary approach. Then I will show results obtained for the e + e − → φf 0 (980) reaction which reproduce the bulk of the data except for a pronounced peak, giving support to a new mesonic resonance, X(2175). Results will also be shown for the electromagnetic form factors of the N * (1535) resonance, also dynamically generated in this approach. Finally, I will show some results on the photoproduction of the ω in nuclei, showing that present experimental results claiming a shift of the ω mass in the medium are tied to a particular choice of background and are not conclusive. On the other hand, the same experimental results show unambiguously a huge increase of the ω width in the nuclear medium.