This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mystring = """ | |
{{ | |
orders (first: 1000 orderBy: updatedAt, orderDirection: asc where: {{ status:sold category:wearable updatedAt_gt:"{0}"}}) {{ | |
category | |
nftAddress | |
price | |
status |