import urllib2
import json
url = 'http://api.opencorporates.com/v0.2/companies/search?q=&jurisdiction_code=us_ca¤t_status=Active&page='
i = 0
while True:
i += 1
print i
response = urllib2.urlopen('%s%d' % (url, i))
content = response.read()
with open(str(i) + '.json', 'w') as f:
f.write(content)
at the 22nd page I got HTTP Error 401: Unauthorized