The price gap between the Canadian oilsands benchmark and the more widely used American one has risen to its widest level in more than five years.

The price of the heavy type of oil that comes out of Alberta's oilsands — known as Western Canada Select — is now trading below $40 US a barrel, and was changing hands at $38.29 a barrel on Tuesday. West Texas Intermediate, which is a type of oil that's much easier to refine and as such is the much more commonly used oil price benchmark, was trading at just under $70.

That puts the gap between the two oil prices at $31.25, the widest gulf since 2013. And it means Canadian producers are getting far less for their oil than others do.

And experts are blaming the usual suspects for it: pipelines.

"Continued growth in Western Canadian oilsands production is running up against insufficient pipeline capacity," Scotiabank's commodity economist Rory Johnston said.

Despite being a major oil producer, Canada actually refines little crude oil, which means most of what the country produces has to get shipped to refineries on the U.S. Gulf Coast. And while many have been proposed, very few pipelines have actually been built, meaning that those that do exist are at full capacity.

That means Canadian oil producers have to sell their product to refineries at a discount, to offset the difficulty and cost of getting it there. Major oilsands producer Canadian Natural Resources said last week that it plans to shift its focus to invest in lighter fuel blends, to take advantage of the price mismatch. "To maximize value, we are shifting capital from primary heavy crude oil to light crude oil," CNR said in releasing its quarterly earnings.

Rail is another way for Canadian oil companies to get their oil to market, and there too, the system can't process any more oil. Canadian oil shipments by rail rose to a record 198,788 barrels of oil per day in May, the latest month for which there is available data.

That's an all-time high, but capacity is not rising fast enough to offset tight pipeline space.

Judith Dwarkin, chief economist at RS Energy Group says the uptick in crude by rail is a function of the widening price gap.

"It only takes one barrel not able to get into the pipeline for the spread to widen," she said. "Really it's egress by pipeline that needs to be addressed."

Analyst Tom Kloza of the Oil Price Information Service says lack of pipelines are to blame.

"You don't have a pipeline to move it to the Pacific Ocean where you would be golden, so you are seeing these weak numbers," Kloza said.

Another factor is shutdowns of various oil processing facilities on both sides of the border. In June, a power outage at Syncrude helped the price gap to narrow to as little as $16 a barrel, as reduced output from a major oilsands producer made it easier for other producers to get their product to market.

But that outage is over now, and Syncrude is ramping back up to full production, which has caused the comparative oversupply of WCS.

Making things worse, refineries in the U.S. have less appetite for Canadian crude. A refinery in Whiting, Ind., owned by British multinational firm BP is scheduled to go offline for maintenance later this year. The 414,000 barrels-per-day refinery "is probably the biggest customer for Canadian heavy oil," Kloza said, so it being offline will reduce demand for Western Canada Select.

"We expect that the discount is going to remain especially volatile over the next year or so as we teeter on the edge of sufficient takeaway capacity out of Western Canada," Johnston said.

Dwarkin agrees that the volatility will last for as long as pipelines continue to be an issue.

"It's a triple whammy depressing prices at our end of the pipeline system. And the impact of that is not rocket science."