theericstonesolscan metadata example
Updated 2023-07-07
99
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
35
36
›
⌄
-- here's a demo of how to use the solscan api via flipside
-- to pull metadata info into the Studio app
--select livequery.utils.udf_register_secret( '337429be-c5a7-441e-9a2d-7f3faf924404', 'rb7dt4rqvKC1iCXtib8BBr3FNEJU8CUK21Oa4q4Cnao=');
with raw as (
SELECT
livequery.live.udf_api(
'GET' ,
'https://public-api.solscan.io/account/{{address}}',
{'accept': 'application/json',
'token': '{{apikey}}'},
{}
) as response
),
-- one example of organizing the metadata in particular
-- but there are a few other pieces of info you
-- could grab from 'raw' if you need it
metadata as (
select
path,
value
from raw,
lateral flatten (input => response:data:metadata:data)
)
select
"'name'" as name,
address,
"'symbol'" as symbol,
"'seller_fee_basis_points'" as seller_fee_basis_points,
"'attributes'" as attributes,
"'properties'" as properties,
"'uri'" as uri
from metadata
PIVOT (
Run a query to Download Data