Skip to content

Commit 7231e9e

Browse files
authored
Merge pull request #171 from spacescan-io/sabari
Added NFT info
2 parents 73a5f0d + 62c1b50 commit 7231e9e

File tree

1 file changed

+106
-107
lines changed

1 file changed

+106
-107
lines changed

api/nft/info.md

Lines changed: 106 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@ import ApiCallExample from '@site/src/components/ApiCallExample';
88

99
# Get NFT Information
1010

11-
This endpoint allows you to fetch detailed information about a specific NFT using its NFT ID.
11+
This endpoint allows you to fetch detailed information about a specific NFT.
1212

1313
### Endpoint
1414

1515
<Tabs>
1616
<TabItem value="mainnet" label="Mainnet">
1717

18-
```
19-
GET https://api.spacescan.io/nft/info/{nft_id}
18+
```bash
19+
GET https://api.spacescan.io/nfts/{nft_id}
2020
```
2121

2222
</TabItem>
2323
<TabItem value="testnet" label="Testnet">
2424

25-
```
26-
GET https://api-testnet11.spacescan.io/nft/info/{nft_id}
25+
```bash
26+
GET https://api-testnet11.spacescan.io/nfts/{nft_id}
2727
```
2828

2929
</TabItem>
3030
</Tabs>
3131

3232
### Parameters
3333

34-
| Parameter | Type | Description |
35-
|-----------|--------|-------------------------------------------------|
36-
| nft_id | string | The unique NFT ID |
34+
| Parameter | Type | Required | Default | Description |
35+
|-----------|------|----------|---------|-------------|
36+
| nft_id | string | Yes | - | The unique identifier of the NFT |
3737

3838
:::info Free API
3939
Use `api.spacescan.io` for free tier access. See our [API Plans](https://spacescan.io/apis#plans) for rate limits and features.
@@ -43,7 +43,7 @@ Use `api.spacescan.io` for free tier access. See our [API Plans](https://spacesc
4343
Use `pro-api.spacescan.io` with your API key in the `x-api-key` header. See our [API Plans](https://spacescan.io/apis#plans) for details.
4444

4545
```bash
46-
curl -X GET "https://pro-api.spacescan.io/nft/info/{nft_id}" \
46+
curl -X GET "https://pro-api.spacescan.io/nfts/{nft_id}" \
4747
-H "x-api-key: YOUR_API_KEY"
4848
```
4949
:::
@@ -52,123 +52,122 @@ curl -X GET "https://pro-api.spacescan.io/nft/info/{nft_id}" \
5252

5353
<Tabs>
5454
<TabItem value="mainnet" label="Mainnet">
55-
<a href="https://api.spacescan.io/nft/info/nft1qy8twtlun5ppfxmysp6sgvnawmn4ysq4gycz8yzm8rzkzx9mnk2syyza4u" target="_blank" rel="noopener noreferrer" className="api-test-button">
56-
🚀 Test API in Browser
57-
</a>
58-
</TabItem>
59-
<TabItem value="testnet" label="Testnet">
60-
<a href="https://api-testnet11.spacescan.io/nft/info/nft1qy8twtlun5ppfxmysp6sgvnawmn4ysq4gycz8yzm8rzkzx9mnk2syyza4u" target="_blank" rel="noopener noreferrer" className="api-test-button">
55+
<a href="https://api.spacescan.io/nfts/nft10lutrplp2mqrp0wg27sjmjeezzluk9a7jgmjpdv6n5qalkpy8kxqrkqag7" target="_blank" rel="noopener noreferrer" className="api-test-button">
6156
🚀 Test API in Browser
6257
</a>
6358
</TabItem>
6459
</Tabs>
6560

66-
### Request Example
61+
### Request Examples
6762

6863
<Tabs>
6964
<TabItem value="curl" label="cURL">
70-
<Tabs>
71-
<TabItem value="mainnet" label="Mainnet">
72-
<CodeBlock language="bash">
73-
curl -X GET "https://api.spacescan.io/nft/info/nft1qy8twtlun5ppfxmysp6sgvnawmn4ysq4gycz8yzm8rzkzx9mnk2syyza4u"
74-
</CodeBlock>
75-
</TabItem>
76-
<TabItem value="testnet" label="Testnet">
77-
<CodeBlock language="bash">
78-
curl -X GET "https://api-testnet11.spacescan.io/nft/info/nft1qy8twtlun5ppfxmysp6sgvnawmn4ysq4gycz8yzm8rzkzx9mnk2syyza4u"
79-
</CodeBlock>
80-
</TabItem>
81-
</Tabs>
65+
66+
```bash
67+
curl -X GET "https://api.spacescan.io/nfts/nft10lutrplp2mqrp0wg27sjmjeezzluk9a7jgmjpdv6n5qalkpy8kxqrkqag7"
68+
```
69+
8270
</TabItem>
8371
<TabItem value="python" label="Python">
84-
<Tabs>
85-
<TabItem value="mainnet" label="Mainnet">
86-
<CodeBlock language="python">
87-
import requests
88-
89-
nft_id = "nft1qy8twtlun5ppfxmysp6sgvnawmn4ysq4gycz8yzm8rzkzx9mnk2syyza4u"
90-
url = f"https://api.spacescan.io/nft/info/{nft_id}"
91-
92-
response = requests.get(url)
93-
data = response.json()
94-
print(data)
95-
</CodeBlock>
96-
</TabItem>
97-
<TabItem value="testnet" label="Testnet">
98-
<CodeBlock language="python">
99-
import requests
100-
101-
nft_id = "nft1qy8twtlun5ppfxmysp6sgvnawmn4ysq4gycz8yzm8rzkzx9mnk2syyza4u"
102-
url = f"https://api-testnet11.spacescan.io/nft/info/{nft_id}"
103-
104-
response = requests.get(url)
105-
data = response.json()
106-
print(data)
107-
</CodeBlock>
108-
</TabItem>
109-
</Tabs>
72+
73+
```python
74+
import requests
75+
76+
nft_id = "nft10lutrplp2mqrp0wg27sjmjeezzluk9a7jgmjpdv6n5qalkpy8kxqrkqag7"
77+
url = f"https://api.spacescan.io/nfts/{nft_id}"
78+
79+
response = requests.get(url)
80+
data = response.json()
81+
print(data)
82+
```
83+
11084
</TabItem>
11185
<TabItem value="javascript" label="JavaScript">
112-
<Tabs>
113-
<TabItem value="mainnet" label="Mainnet">
114-
<CodeBlock language="javascript">
115-
const nftId = "nft1qy8twtlun5ppfxmysp6sgvnawmn4ysq4gycz8yzm8rzkzx9mnk2syyza4u";
116-
const url = `https://api.spacescan.io/nft/info/${nftId}`;
117-
118-
fetch(url)
119-
.then(response => response.json())
120-
.then(data => console.log(data))
121-
.catch(error => console.error('Error:', error));
122-
</CodeBlock>
123-
</TabItem>
124-
<TabItem value="testnet" label="Testnet">
125-
<CodeBlock language="javascript">
126-
const nftId = "nft1qy8twtlun5ppfxmysp6sgvnawmn4ysq4gycz8yzm8rzkzx9mnk2syyza4u";
127-
const url = `https://api-testnet11.spacescan.io/nft/info/${nftId}`;
128-
129-
fetch(url)
130-
.then(response => response.json())
131-
.then(data => console.log(data))
132-
.catch(error => console.error('Error:', error));
133-
</CodeBlock>
134-
</TabItem>
135-
</Tabs>
136-
</TabItem>
137-
</Tabs>
13886

139-
### Response
87+
```javascript
88+
const nftId = "nft10lutrplp2mqrp0wg27sjmjeezzluk9a7jgmjpdv6n5qalkpy8kxqrkqag7";
89+
const url = `https://api.spacescan.io/nfts/${nftId}`;
90+
91+
fetch(url)
92+
.then(response => response.json())
93+
.then(data => console.log(data))
94+
.catch(error => console.error('Error:', error));
95+
```
14096

141-
<Tabs>
142-
<TabItem value="mainnet" label="Mainnet">
143-
<ApiCallExample endpoint="https://api.spacescan.io/nft/info/nft1qy8twtlun5ppfxmysp6sgvnawmn4ysq4gycz8yzm8rzkzx9mnk2syyza4u" />
144-
</TabItem>
145-
<TabItem value="testnet" label="Testnet">
146-
<ApiCallExample endpoint="https://api-testnet11.spacescan.io/nft/info/nft1qy8twtlun5ppfxmysp6sgvnawmn4ysq4gycz8yzm8rzkzx9mnk2syyza4u" />
14797
</TabItem>
14898
</Tabs>
14999

150100
### Response Schema
151101

152-
| Field | Type | Description |
153-
|--------------------|---------|-------------------------------------------------------|
154-
| status | string | The status of the API request |
155-
| nft | object | Detailed information about the NFT |
156-
| nft.nft_id | string | The unique identifier of the NFT |
157-
| nft.name | string | The name of the NFT |
158-
| nft.description | string | Description of the NFT |
159-
| nft.collection_id | string | ID of the collection this NFT belongs to |
160-
| nft.metadata_uri | string | URI to the NFT's metadata |
161-
| nft.metadata | object | Metadata of the NFT |
162-
| nft.owner | string | Current owner's address |
163-
| nft.minted_height | number | Block height when the NFT was minted |
164-
| nft.minted_timestamp | number | Timestamp when the NFT was minted |
102+
| Field | Type | Description |
103+
|-------|------|-------------|
104+
| id | string | The unique identifier of the NFT |
105+
| name | string | The name of the NFT |
106+
| preview_url | string | URL to the NFT's preview image |
107+
| created_height | string | Block height when the NFT was created |
108+
| created_time | string | Timestamp of NFT creation |
109+
| collection | object | Collection information |
110+
| collection.id | string | Collection identifier |
111+
| collection.name | string | Collection name |
112+
| collection.description | string | Collection description |
113+
| collection.preview_url | string | Collection preview image URL |
114+
| price | string | Current listing price |
115+
| creator | object | Creator information including DID and address |
116+
| owner | object | Current owner information including DID and address |
117+
| description | string | NFT description |
118+
| data_url | array | Array of URLs to NFT data |
119+
| metadata_urls | array | Array of URLs to NFT metadata |
120+
| license_urls | array | Array of URLs to license information |
121+
| rarity | number | Rarity score |
122+
| top_bid | string | Highest bid amount |
123+
| last_sale | string | Last sale price |
124+
| current_price | string | Current listing price |
125+
| attributes | array | Array of NFT attributes/traits |
126+
127+
### Example Response
128+
129+
```json
130+
{
131+
"id": "nft10lutrplp2mqrp0wg27sjmjeezzluk9a7jgmjpdv6n5qalkpy8kxqrkqag7",
132+
"name": "Chia Friends #6707",
133+
"preview_url": "https://assets.spacescan.io/nft/95cdc50c1315791cacc318c8d45ebff64863f355ad833bc2144cabb7b47db271.webp",
134+
"created_height": "2208201",
135+
"created_time": "2022-07-04T05:01:44.000Z",
136+
"collection": {
137+
"id": "col1z0ef7w5n4vq9qkue67y8jnwumd9799sm50t8fyle73c70ly4z0ws0p2rhl",
138+
"name": "Chia Friends",
139+
"description": "10,000 eco-bit NFTs on Chia, from Chia.",
140+
"preview_url": "https://assets.spacescan.io/col/a7f7513f445bf620d230d06442ea938cb0703a48ebbd0e16f8113c6472383f04.webp"
141+
},
142+
"price": "6.9000000000000",
143+
"creator": {
144+
"did": {
145+
"id": "did:chia:19qf3g9876t0rkq7tfdkc28cxfy424yzanea29rkzylq89kped9hq3q7wd2",
146+
"name": "Chia Network"
147+
},
148+
"address": {
149+
"address": "xch1mvdvhnl9mmmqdl9e4nvvr6ak329vmv293k0t3hfy2p983t3lj4wqdgqu7j"
150+
}
151+
},
152+
"attributes": [
153+
{
154+
"value": "Yak",
155+
"trait_type": "Background"
156+
},
157+
{
158+
"value": "Parakeet (Green)",
159+
"trait_type": "Body"
160+
}
161+
]
162+
}
163+
```
165164

166165
### Error Responses
167166

168-
| HTTP Status Code | Meaning |
169-
|------------------|-------------------------------------------------------------------------------------------|
170-
| 400 | Bad Request -- Your request is invalid. |
171-
| 404 | Not Found -- The specified NFT could not be found. |
172-
| 429 | Too Many Requests -- You're requesting too many times! Slow down! |
173-
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
174-
| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |
167+
| HTTP Status Code | Meaning |
168+
|-----------------|---------|
169+
| 400 | Bad Request -- Your request is invalid |
170+
| 404 | Not Found -- The specified NFT could not be found |
171+
| 429 | Too Many Requests -- You're requesting too many times |
172+
| 500 | Internal Server Error -- We had a problem with our server |
173+
| 503 | Service Unavailable -- We're temporarily offline for maintenance |

0 commit comments

Comments
 (0)