In just five years, China has surpassed the United States as a trading partner for much of the world, including US allies such as South Korea and Australia, according to an Associated Press analysis of trade data.