In my experience (first came to live and work in Japan in 1985), discrimination against foreigners was at somewhat of a peak in the 1980's, in large part due to (a) the trade war with the U.S. and the negative media coverage of all things American during that time, and (b) a certain nationalist arrogance Japan was feeling at the time due to their economic dominance.

During that time, I was stopped by police for "bicycling while foreign" on many occasions, and a policeman stopping you while walking down the street and asking you for your gaijin card was far from unheard-of. In the many times I went apartment hunting, I had a 90%+ rejection rate just from when the landlord heard I was non-Japanese. The real estate agents even used the exact identical phrase when explaining it to me: "gaijin wa dame." Can't tell you how many hundreds of times I heard that phrase. I saw three specific notices at real estate agencies which read "pets, bar girls (mizushoubai) and foreigners not allowed."

I was once told to leave a restaurant as I walked in, and one video shop said I could not join unless I held Japanese citizenship. However, these two locations were both in proximity to Yokota base, and likely the reactions there were to the perceived unruly behavior of military personnel, imagined or not.

The media could be very bad. If you saw a foreigner on TV during that time, it was quite common for them to be portraying a criminal or AIDS carrier or something of the like. America was seen as a violent, crime-ridden nation. One drama had a Japanese couple visit Hawaii and suffer as victims of five different crimes in the span of a few days, including mugging and rape. One well-publicized TV movie, "Rosu no Dai-ikkyu Satsujin" (The First-Degree Murderer of Los Angeles) was "based upon" the story of a Japanese woman living in L.A. with her husband and two small children; her husband cheated on her, she found out, committed oya-ko suicide (took her kids with her)--her kids died but she didn't, and she was charged with murder. The jury sentenced her to time served upon understanding the cultural differences. But in the TV movie, the woman was made out to be a heroic victim, she did not commit suicide, but rather violent Americans started a fire which killed her kid and she was unmercifully disbelieved and sentenced to prison time. This was kind of typical of the era.

Sports was also a big area of discrimination. Foreign batters, brought in for their home run power, were commonly beaned by Japanese pitchers who believe that this was the way things were done in the U.S.--without thinking that rushing the mound and beating the **** out of such a pitcher was also the way thing were done. But the foreign players were blamed for the violence, even though a majority (around 2/3rds, I believe) of the violence was perpetrated by Japanese players, coaches and managers. But TV shows didn't reveal that--one sports show had about 20 clips of violence on the field, all but one of which was foreign players rushing the mound--and the last clip being of a coach shouting at an ump, followed by the announcer 'reasonably' admitting that "Japanese could be violent, too."

Sports magazines commonly changed the kanji for "gai-jin" ("outside person") to the homonym "gai-jin" ("harmful person"), and the term was used so commonly as an epithet that it had to actually be banned by the league.

-----

Today, things are quieter. Japan has suffered not only a decade-long recession, but has seen a surge in home-grown crime (witness the schoolgirl killing just a few days ago) as well; it has been my observation that both of these have humbled Japanese people somewhat in terms of how they relate Japan to the rest of the world. The contrast between the late 80's and today is very marked. I rarely hear stories of foreigners on bikes being pulled over, and never hear of gaijin-card checks any more. Landlords still discriminate, but not as much nor as brashly as before.

Discrimination will exist, as it always does in all places, but in my past six unbroken years of residence I hardly see any of that at all. It is a good time in that respect to live in Japan, though the job market is far less attractive than it was.