Whether or not "Yanqui" is offensive probably depends on where you're from.
The only place I can think of in the US where Yankee might be considered significantly pejorative is the deep south, where people who never got over the civil war use it as an epithet for meddling outsiders. Nonetheless, it is fairly universally (within the US) considered to refer mainly to people from the northeastern quarter or so of the country -- north of the Mason-Dixon line and east of the Mississippi, approximately. In other words, the area that was known as the North during the civil war. Calling someone from Alabama or Missouri or Texas a Yankee is not significantly different from calling someone from Wessex a Scott. I don't think it would generally be considered offensive, though, unless it's clearly done deliberately to provoke. Most folks I know would just write it off as a foreigner not knowing the local geography very well.