I hold a Thai passport. I'm planning to go to Japan through Shanghai from the US. It's the only reasonable price I could find. The transit would be around 6 hours at Pu Dong airport. I can only find information about 72-hour visa free program which Thai passport holders are not among the countries there. But I cannot find any other information what should I do to apply or do I need a transit visa to go through China if I'm not going out of the airport?
Foreigners in transit in China with booked itineraries departing within 24 hours and not wishing to leave the transit area of the airport do not need a visa, according to Travel China Guide:
2. For Direct Transit
No visa is required for foreigners who hold tickets to the final destination and have booked seats on international airlines, ships, trains transiting directly through China, and will stay for less than 24 hours and do not leave the specified transit area.
Foreigners are able to apply for a Temporary Entry Permit to leave the port for city sightseeing or going to a dock or a railway station. Those who transfer in two cities of China within 24 hours are also available to enjoy this policy. For instance, if one’s trip is Los Angeles – Beijing – Kunming – Chiengmai and the time in China is less than 24 hours, the passenger can enjoy the direct transit.
This is also confirmed by the Chinese embassy in Indonesia:
Visas are not required of aliens (includes Indonesian), who hold final destination tickets and have booked seats on international airliners flying directly through China, and will stay in a transit city for less than 24 hours without leaving the airport.