getAssets
curl --request POST \
--url 'https://rpc-mainnet.solanatracker.io/?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getAssets",
"params": {
"ids": [
"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
"86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY"
]
}
}
'import requests
url = "https://rpc-mainnet.solanatracker.io/?api_key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getAssets",
"params": { "ids": ["J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w", "86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY"] }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: '1',
method: 'getAssets',
params: {
ids: [
'J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w',
'86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY'
]
}
})
};
fetch('https://rpc-mainnet.solanatracker.io/?api_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://rpc-mainnet.solanatracker.io/?api_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => '1',
'method' => 'getAssets',
'params' => [
'ids' => [
'J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w',
'86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://rpc-mainnet.solanatracker.io/?api_key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getAssets\",\n \"params\": {\n \"ids\": [\n \"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w\",\n \"86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://rpc-mainnet.solanatracker.io/?api_key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getAssets\",\n \"params\": {\n \"ids\": [\n \"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w\",\n \"86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc-mainnet.solanatracker.io/?api_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getAssets\",\n \"params\": {\n \"ids\": [\n \"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w\",\n \"86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "1",
"result": [
{
"interface": "ProgrammableNFT",
"id": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://madlads-collection.s3.us-west-2.amazonaws.com/_collection.json",
"files": [
{
"uri": "https://madlads-collection.s3.us-west-2.amazonaws.com/_collection.png",
"mime": "image/png",
"cdn_uri": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fmadlads-collection.s3.us-west-2.amazonaws.com%2F_collection.png"
}
],
"metadata": {
"name": "Mad Lads",
"symbol": "MAD",
"json_name": "Mad Lads",
"description": "Fock it.",
"attributes": [],
"token_standard": "ProgrammableNonFungible"
},
"links": {
"image": "https://madlads-collection.s3.us-west-2.amazonaws.com/_collection.png",
"external_url": "https://madlads.com"
},
"category": "image"
},
"authorities": [
{
"address": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": false,
"data_hash": "",
"creator_hash": "",
"asset_hash": "",
"tree": "",
"seq": 0,
"leaf_id": 0
},
"grouping": [],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0.05,
"basis_points": 500,
"primary_sale_happened": false,
"locked": false
},
"creators": [
{
"address": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
"share": 100,
"verified": true
}
],
"ownership": {
"frozen": true,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": 253
},
"mutable": true,
"burnt": false,
"token_info": {
"supply": 1,
"decimals": 0,
"token_program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"mint_authority": "2G5CotQ6Q87yhZxKUWkwLY6Foi12Q3VFQ6KN4nTLbPSz",
"freeze_authority": "2G5CotQ6Q87yhZxKUWkwLY6Foi12Q3VFQ6KN4nTLbPSz"
}
},
null
]
}DAS API
getAssets DAS 方法
一次调用按 id 获取最多 1,000 个 Solana 数字资产,按请求顺序返回,缺失的 id 返回 null。查看 getAssets 的参数和代码示例。
POST
/
getAssets
curl --request POST \
--url 'https://rpc-mainnet.solanatracker.io/?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": "1",
"method": "getAssets",
"params": {
"ids": [
"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
"86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY"
]
}
}
'import requests
url = "https://rpc-mainnet.solanatracker.io/?api_key="
payload = {
"jsonrpc": "2.0",
"id": "1",
"method": "getAssets",
"params": { "ids": ["J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w", "86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY"] }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: '1',
method: 'getAssets',
params: {
ids: [
'J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w',
'86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY'
]
}
})
};
fetch('https://rpc-mainnet.solanatracker.io/?api_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://rpc-mainnet.solanatracker.io/?api_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => '1',
'method' => 'getAssets',
'params' => [
'ids' => [
'J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w',
'86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://rpc-mainnet.solanatracker.io/?api_key="
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getAssets\",\n \"params\": {\n \"ids\": [\n \"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w\",\n \"86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://rpc-mainnet.solanatracker.io/?api_key=")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getAssets\",\n \"params\": {\n \"ids\": [\n \"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w\",\n \"86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://rpc-mainnet.solanatracker.io/?api_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": \"1\",\n \"method\": \"getAssets\",\n \"params\": {\n \"ids\": [\n \"J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w\",\n \"86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": "1",
"result": [
{
"interface": "ProgrammableNFT",
"id": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://madlads-collection.s3.us-west-2.amazonaws.com/_collection.json",
"files": [
{
"uri": "https://madlads-collection.s3.us-west-2.amazonaws.com/_collection.png",
"mime": "image/png",
"cdn_uri": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fmadlads-collection.s3.us-west-2.amazonaws.com%2F_collection.png"
}
],
"metadata": {
"name": "Mad Lads",
"symbol": "MAD",
"json_name": "Mad Lads",
"description": "Fock it.",
"attributes": [],
"token_standard": "ProgrammableNonFungible"
},
"links": {
"image": "https://madlads-collection.s3.us-west-2.amazonaws.com/_collection.png",
"external_url": "https://madlads.com"
},
"category": "image"
},
"authorities": [
{
"address": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": false,
"data_hash": "",
"creator_hash": "",
"asset_hash": "",
"tree": "",
"seq": 0,
"leaf_id": 0
},
"grouping": [],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0.05,
"basis_points": 500,
"primary_sale_happened": false,
"locked": false
},
"creators": [
{
"address": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW",
"share": 100,
"verified": true
}
],
"ownership": {
"frozen": true,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": 253
},
"mutable": true,
"burnt": false,
"token_info": {
"supply": 1,
"decimals": 0,
"token_program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"mint_authority": "2G5CotQ6Q87yhZxKUWkwLY6Foi12Q3VFQ6KN4nTLbPSz",
"freeze_authority": "2G5CotQ6Q87yhZxKUWkwLY6Foi12Q3VFQ6KN4nTLbPSz"
}
},
null
]
}以命名参数传入
ids。结果是与 ids 顺序相同的数组。
- 可用的方法名:
getAssets、get_assets、getAssetBatch和get_asset_batch。 - 每次调用最多 1,000 个 id。超出会返回
-32602和Batch Size Error。 - 不是资产的 id,或供应量为零的 NFT,会在对应位置返回
null。调用本身仍然成功。 - 显示选项放在
options或displayOptions中。与 getAsset 不同,这里支持showUnverifiedCollections。 - 响应是一个纯数组,因此不包含
last_indexed_slot。 - 费用:每次调用 1 积分,与 id 数量无关。计入套餐的 DAS RPS 限制。
请求体
application/json
响应
Assets in request order.
此页面对您有帮助吗?