Is the weather station to be used the one closest to the latitude, longitude coordinates? Or does it also take into account a reliability measure for the stations as well? This is for historical measurements.
The lat/lon matches to a zip code and the weather station is picked as the closest to the center of that zip code. If a station is failing our quality check software, it won't appear in our current conditions. But we don't take reliability into account. For history the best data comes from the NWS observations at mostly airports. Those are "official" records.