Does an apricot have to have another one near it to cross pollinate to produce fruit?

Mostly not. Apricots are self-pollinating with a couple of exceptions that I am aware of. A new variety called 'Perfection' needs 'Trevatt' and 'Early Divinity' needs 'Moorpark' for better cropping. You may still get fruit, but not in quantity or quality. The vast majority don't need any company, though.