Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple example of how to export all assets declarations from website.
import requests
import json
from time import sleep
data = []
print("Fetching page #%s" % 1)
r = requests.get("").json()
data += r["results"]["object_list"]
for page in range(2, r["results"]["paginator"]["num_pages"] + 1):
print("Fetching page #%s" % page)
subr = requests.get(
"" % page).json()
data += subr["results"]["object_list"]
print("Declarations exported %s" % len(data))
with open("feed.json", "w") as fp:
json.dump(data, fp)

This comment has been minimized.

Copy link

@Nazarii77 Nazarii77 commented Mar 16, 2017

How to encode file feed.json from unicode to utf-8 properly? I can easily encode small file, using js, but 344megabutes can not be encoded with the same code that works on small files(


This comment has been minimized.


This comment has been minimized.

Copy link
Owner Author

@dchaplinsky dchaplinsky commented May 31, 2017

Check the updated docs and new API here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment