Created
August 31, 2021 12:16
-
-
Save Partysun/fa4f5cf40ffb85fc45cae98b91e9331a to your computer and use it in GitHub Desktop.
It's a sample which is demonstrating how to call many assets and many metrics in a single API call.
This file contains hidden or 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 san | |
from san.graphql import execute_gql | |
import pandas as pd | |
san.ApiConfig.api_key = "Your API key" | |
res = execute_gql("""{ prices: getMetric(metric: "price_usd") { | |
timeseriesDataPerSlug( | |
from: "utc_now-1d" | |
to:"utc_now" | |
interval: "15m" | |
selector: {slugs: ["ethereum","tezos","eos","color-platform","enecuum","slink"]}) | |
{ | |
data { | |
slug | |
value | |
} | |
datetime | |
} | |
}, | |
socialVolume: getMetric(metric: "social_volume_total") { | |
timeseriesDataPerSlug( | |
from: "utc_now-1d" | |
to:"utc_now" | |
interval: "15m" | |
selector: {slugs: ["ethereum","tezos","eos","color-platform","enecuum","slink"]}) | |
{ | |
data { | |
slug | |
value | |
} | |
datetime | |
} | |
} | |
}""") | |
res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
View on GraphiQL - here