Carbon Tracker describes its report as a wake-up call to oil producing countries and international policymakers. It says they have planned on the basis that demand for oil will increase until 2040.
But the agency warns that demand will have to fall to meet climate targets, and oil prices will be lower than oil producers and the industry currently expect.
The report looks at what would happen to government revenues if the increase in global temperature is limited to 1.65C.
The $13 trillion figure for lost revenue is compared with what it calls "business as usual" expectations of continued growth. It includes countries whose economies are not dominated by oil - such as the UK, the US, India and China.
The main focus of the report, however, is a group for which the loss of oil income will be much more challenging, 40 countries it calls "petrostates".