Shangyi is a county in the northwest of Hebei province, China. It falls under the administration of Zhangjiakou City.
The county lies in the far northwest of Hebei, bordering Inner Mongolia to both the north and the west. This location places it in the transitional zone between the North China Plain and the Inner Mongolian plateau.
Its position on the provincial border makes it one of the northernmost and westernmost parts of Hebei, adjacent to the neighbouring autonomous region on two sides.