There has been random spot checks by the US just inside their border. I have gone through two in the last year alone, one on Hwy 10, the other on Hwy 83.
Last week I was searched by Canadian customs. I was in Canada, studying reptiles. About a half mile from customs when suddenly a voice said to come with his. Customs.
Apparently if you are close to customs they search you.
I was detained, searched and I wasn't even a half a mile from the border. Once I asked the customs officer why I am being detained, he said "because you were in a customs area". I asked if I was under arrest. He said no. I grabbed my ID and walked out, over their objections that I am required to be searched.
Gotta love the summer students at customs. They do looks scary when they wear gloves. I think it makes it easier for them to calculate taxes.
Just wish they knew there own Charter of Rights and Freedoms.