cityDistance = APIFunction[{"city1"->"City","city2"->"City"}, QuantityMagnitude@TravelDistance[#city1,#city2]&]

co=CloudDeploy[cityDistance,Permissions->"Public"]

EmbedCode[co,"Python"]