forked from sorare/api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetNBACardPrice.js
More file actions
34 lines (29 loc) · 795 Bytes
/
getNBACardPrice.js
File metadata and controls
34 lines (29 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const { GraphQLClient, gql } = require("graphql-request");
const GetNBACardsPrices = gql`
query GetNBACardsPrices($slugs: [String!]!) {
nbaCards(slugs: $slugs)
token {
latestEnglishAuction {
bestBid {
amount
amountInFiat { eur gbp usd }
}
}
}
}
}
`;
const slug = "jeremy-sochan-20030520-2022-rare-134";
async function main() {
const graphQLClient = new GraphQLClient("https://api.sorare.com/federation/graphql", {
headers: {
// 'Authorization': `Bearer <YourJWTorOAuthToken>`,
// 'APIKEY': '<YourOptionalAPIKey>'
},
});
const prices = await graphQLClient.request(GetNBACardsPrices, {
slugs: [slug],
});
console.log(prices)
}
main().catch((error) => console.error(error));