Most patent offices and agencies make their statistics available online:
The USPTO enables Google to provide the public with bulk downloads of patent and trademark data that can be read in applications. Coverage goes back to 1977 and the availability of formats varies by dates. Be sure to review the USPTO's policies on the use of its data.