Skip to content

Instantly share code, notes, and snippets.

mystring = """
{{
orders (first: 1000 orderBy: updatedAt, orderDirection: asc where: {{ status:sold category:wearable updatedAt_gt:"{0}"}}) {{
category
nftAddress
price
status
@dumplingcompromise
dumplingcompromise / imports.py
Created February 20, 2021 22:05
imports for decentraland api project
import requests
import json
from gql import gql, Client
import pandas as pd
import time
from gql.transport.requests import RequestsHTTPTransport
# Select your transport with a defined url endpoint
transport = RequestsHTTPTransport(url="https://api.thegraph.com/subgraphs/name/decentraland/marketplace")
# Create a GraphQL client using the defined transport
@dumplingcompromise
dumplingcompromise / gist:7354080af12b58c09d685f50876e365f
Last active February 20, 2021 22:09
decentraland api looping
df = pd.DataFrame()
#update parameter used in mystring to start querying the database at the earliest update date of sale. The update
#date is specified in epoch date and needs to be converted to datetime for human consumption.
update = 1
while True:
#query the data using GraphQL python library.
query = gql(mystring.format(update))