Skip to content

Instantly share code, notes, and snippets.

@Partysun
Created August 31, 2021 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Partysun/fa4f5cf40ffb85fc45cae98b91e9331a to your computer and use it in GitHub Desktop.
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.
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
@Partysun
Copy link
Author

View on GraphiQL - here

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