-
You can do it online via the Chinese embassy, but you need to pick a US consulate location.
I personally went to the Chinese embassy in Berlin but it took almost 2 weeks.
If you are only going for a few days and transiting, China has visa free travel option but you are limited to only a few days.