We present APEX 218 GHz observations of molecular emission in a complete sample of embedded protostars in the Ophiuchus star-forming region. To study the physical properties of the cores, we calculate H\(_2\)CO and c-C\(_3\)H\(_2\) rotational temperatures, both of which are good tracers of the kinetic temperature of the molecular gas. We find that the H\(_2\)CO temperatures range between 16 K and 124 K, with the highest H\(_2\)CO temperatures toward the hot corino source IRAS 16293-2422 (69-124 K) and the sources in the \(\rho\) Oph A cloud (23-49 K) located close to the luminous Herbig Be star S 1, which externally irradiates the \(\rho\) Oph A cores. On the other hand, the c-C\(_3\)H\(_2\) rotational temperature is consistently low (7-17 K) in all sources. Our results indicate that the c-C\(_3\)H\(_2\) emission is primarily tracing more shielded parts of the envelope whereas the H\(_2\)CO emission (at the angular scale of the APEX beam; 3600 au in Ophiuchus) mainly traces the outer irradiated envelopes, apart from in IRAS 16293-2422, where the hot corino emission dominates. In some sources, a secondary velocity component is also seen, possibly tracing the molecular outflow.