Skip to content

Commit 31fd1e5

Browse files
authored
Merge pull request #153 from spacescan-io/sabari
Added new API
2 parents 6308aca + 9569474 commit 31fd1e5

File tree

5 files changed

+681
-0
lines changed

5 files changed

+681
-0
lines changed

api/cat/list.md

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
import Tabs from '@theme/Tabs';
5+
import TabItem from '@theme/TabItem';
6+
import CodeBlock from '@theme/CodeBlock';
7+
import ApiCallExample from '@site/src/components/ApiCallExample';
8+
9+
# List All CATs
10+
11+
This endpoint allows you to fetch a comprehensive list of all Chia Asset Tokens (CATs) in the Chia ecosystem. CATs are fungible tokens built on the Chia blockchain that enable users to create and trade custom assets, representing everything from wrapped cryptocurrencies to gaming tokens and platform utilities.
12+
13+
### Endpoint
14+
15+
<Tabs>
16+
<TabItem value="mainnet" label="Mainnet">
17+
18+
```
19+
GET https://api.spacescan.io/cats
20+
```
21+
22+
</TabItem>
23+
<TabItem value="testnet" label="Testnet">
24+
25+
```
26+
GET https://api-testnet11.spacescan.io/cats
27+
```
28+
29+
</TabItem>
30+
</Tabs>
31+
32+
### Parameters
33+
34+
This endpoint doesn't require any parameters.
35+
36+
:::info Free API
37+
Use `api.spacescan.io` for free tier access. See our [API Plans](https://spacescan.io/apis#plans) for rate limits and features.
38+
:::
39+
40+
:::tip Pro API
41+
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.
42+
43+
```bash
44+
curl -X GET "https://pro-api.spacescan.io/cats" \
45+
-H "x-api-key: YOUR_API_KEY"
46+
```
47+
:::
48+
49+
### Live API Test
50+
51+
<Tabs>
52+
<TabItem value="mainnet" label="Mainnet">
53+
<a href="https://api.spacescan.io/cats" target="_blank" rel="noopener noreferrer" className="api-test-button">
54+
🚀 Test API in Browser
55+
</a>
56+
</TabItem>
57+
<TabItem value="testnet" label="Testnet">
58+
<a href="https://api-testnet11.spacescan.io/cats" target="_blank" rel="noopener noreferrer" className="api-test-button">
59+
🚀 Test API in Browser
60+
</a>
61+
</TabItem>
62+
</Tabs>
63+
64+
### Request Example
65+
66+
<Tabs>
67+
<TabItem value="curl" label="cURL">
68+
<Tabs>
69+
<TabItem value="mainnet" label="Mainnet">
70+
<CodeBlock language="bash">
71+
curl -X GET "https://api.spacescan.io/cats"
72+
</CodeBlock>
73+
</TabItem>
74+
<TabItem value="testnet" label="Testnet">
75+
<CodeBlock language="bash">
76+
curl -X GET "https://api-testnet11.spacescan.io/cats"
77+
</CodeBlock>
78+
</TabItem>
79+
</Tabs>
80+
</TabItem>
81+
<TabItem value="python" label="Python">
82+
<Tabs>
83+
<TabItem value="mainnet" label="Mainnet">
84+
<CodeBlock language="python">
85+
import requests
86+
87+
url = "https://api.spacescan.io/cats"
88+
89+
response = requests.get(url)
90+
data = response.json()
91+
print(data)
92+
</CodeBlock>
93+
</TabItem>
94+
<TabItem value="testnet" label="Testnet">
95+
<CodeBlock language="python">
96+
import requests
97+
98+
url = "https://api-testnet11.spacescan.io/cats"
99+
100+
response = requests.get(url)
101+
data = response.json()
102+
print(data)
103+
</CodeBlock>
104+
</TabItem>
105+
</Tabs>
106+
</TabItem>
107+
<TabItem value="javascript" label="JavaScript">
108+
<Tabs>
109+
<TabItem value="mainnet" label="Mainnet">
110+
<CodeBlock language="javascript">
111+
const url = "https://api.spacescan.io/cats";
112+
113+
fetch(url)
114+
.then(response => response.json())
115+
.then(data => console.log(data))
116+
.catch(error => console.error('Error:', error));
117+
</CodeBlock>
118+
</TabItem>
119+
<TabItem value="testnet" label="Testnet">
120+
<CodeBlock language="javascript">
121+
const url = "https://api-testnet11.spacescan.io/cats";
122+
123+
fetch(url)
124+
.then(response => response.json())
125+
.then(data => console.log(data))
126+
.catch(error => console.error('Error:', error));
127+
</CodeBlock>
128+
</TabItem>
129+
</Tabs>
130+
</TabItem>
131+
</Tabs>
132+
133+
### Response
134+
135+
<Tabs>
136+
<TabItem value="mainnet" label="Mainnet">
137+
<ApiCallExample endpoint="https://api.spacescan.io/cats" />
138+
</TabItem>
139+
<TabItem value="testnet" label="Testnet">
140+
<ApiCallExample endpoint="https://api-testnet11.spacescan.io/cats" />
141+
</TabItem>
142+
</Tabs>
143+
144+
### Response Schema
145+
146+
| Field | Type | Description |
147+
|------------------|---------|-------------------------------------------------------|
148+
| status | string | The status of the API request |
149+
| data | array | Array of CAT information objects |
150+
151+
#### CAT Information Object
152+
153+
Each object in the data array contains:
154+
155+
| Field | Type | Description |
156+
|------------------|---------|-------------------------------------------------------|
157+
| id | string | The unique identifier of the CAT |
158+
| name | string | The name of the CAT |
159+
| symbol | string | The trading symbol of the CAT |
160+
| description | string | Description of the CAT and its purpose |
161+
| type | string | Type of the CAT (e.g., "CAT2") |
162+
| created_time | string | Timestamp when the CAT was created |
163+
| social | object | Social media and website links |
164+
| social.discord | string | Discord server link |
165+
| social.twitter | string | Twitter profile link |
166+
| social.website | string | Official website URL |
167+
| social.verified | boolean | Verification status of the CAT |
168+
| tags | string | Category tags for the CAT |
169+
| preview_url | string | URL to the CAT's logo or preview image |
170+
| multiplier | string | Token multiplier value |
171+
172+
### Error Responses
173+
174+
| HTTP Status Code | Meaning |
175+
|------------------|-------------------------------------------------------------------------------------------|
176+
| 429 | Too Many Requests -- You're requesting too many times! Slow down! |
177+
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
178+
| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |

api/cat/price.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
import Tabs from '@theme/Tabs';
5+
import TabItem from '@theme/TabItem';
6+
import CodeBlock from '@theme/CodeBlock';
7+
import ApiCallExample from '@site/src/components/ApiCallExample';
8+
9+
# Get CAT Price
10+
11+
This endpoint allows you to fetch real-time price information for Chia Asset Tokens (CATs) in various currencies. Track current market prices, exchange rates, and fiat valuations for any CAT in the Chia ecosystem. This data is essential for portfolio tracking, trading decisions, and financial applications built on the Chia blockchain.
12+
13+
### Endpoint
14+
15+
<Tabs>
16+
<TabItem value="mainnet" label="Mainnet">
17+
18+
```
19+
GET https://api.spacescan.io/cat/catprice/{asset_id}?currency={currency_code}
20+
```
21+
22+
</TabItem>
23+
<TabItem value="testnet" label="Testnet">
24+
25+
```
26+
GET https://api-testnet11.spacescan.io/cat/catprice/{asset_id}?currency={currency_code}
27+
```
28+
29+
</TabItem>
30+
</Tabs>
31+
32+
### Parameters
33+
34+
| Parameter | Type | Description | Required |
35+
|--------------|--------|-------------------------------------------------|----------|
36+
| asset_id | string | The unique identifier (TAIL hash) of the CAT | Yes |
37+
| currency | string | Currency code (e.g., USD, EUR, INR, etc.) | No |
38+
39+
:::info Free API
40+
Use `api.spacescan.io` for free tier access. See our [API Plans](https://spacescan.io/apis#plans) for rate limits and features.
41+
:::
42+
43+
:::tip Pro API
44+
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.
45+
46+
```bash
47+
curl -X GET "https://pro-api.spacescan.io/cat/catprice/{asset_id}?currency=INR" \
48+
-H "x-api-key: YOUR_API_KEY"
49+
```
50+
:::
51+
52+
### Live API Test
53+
54+
<Tabs>
55+
<TabItem value="mainnet" label="Mainnet">
56+
<a href="https://api.spacescan.io/cat/catprice/db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20?currency=INR" target="_blank" rel="noopener noreferrer" className="api-test-button">
57+
🚀 Test API in Browser
58+
</a>
59+
</TabItem>
60+
<TabItem value="testnet" label="Testnet">
61+
<a href="https://api-testnet11.spacescan.io/cat/catprice/db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20?currency=INR" target="_blank" rel="noopener noreferrer" className="api-test-button">
62+
🚀 Test API in Browser
63+
</a>
64+
</TabItem>
65+
</Tabs>
66+
67+
### Request Example
68+
69+
<Tabs>
70+
<TabItem value="curl" label="cURL">
71+
<Tabs>
72+
<TabItem value="mainnet" label="Mainnet">
73+
<CodeBlock language="bash">
74+
curl -X GET "https://api.spacescan.io/cat/catprice/db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20?currency=INR"
75+
</CodeBlock>
76+
</TabItem>
77+
<TabItem value="testnet" label="Testnet">
78+
<CodeBlock language="bash">
79+
curl -X GET "https://api-testnet11.spacescan.io/cat/catprice/db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20?currency=INR"
80+
</CodeBlock>
81+
</TabItem>
82+
</Tabs>
83+
</TabItem>
84+
<TabItem value="python" label="Python">
85+
<Tabs>
86+
<TabItem value="mainnet" label="Mainnet">
87+
<CodeBlock language="python">
88+
import requests
89+
90+
asset_id = "db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20"
91+
currency = "INR"
92+
url = f"https://api.spacescan.io/cat/catprice/{asset_id}?currency={currency}"
93+
94+
response = requests.get(url)
95+
data = response.json()
96+
print(data)
97+
</CodeBlock>
98+
</TabItem>
99+
<TabItem value="testnet" label="Testnet">
100+
<CodeBlock language="python">
101+
import requests
102+
103+
asset_id = "db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20"
104+
currency = "INR"
105+
url = f"https://api-testnet11.spacescan.io/cat/catprice/{asset_id}?currency={currency}"
106+
107+
response = requests.get(url)
108+
data = response.json()
109+
print(data)
110+
</CodeBlock>
111+
</TabItem>
112+
</Tabs>
113+
</TabItem>
114+
<TabItem value="javascript" label="JavaScript">
115+
<Tabs>
116+
<TabItem value="mainnet" label="Mainnet">
117+
<CodeBlock language="javascript">
118+
const assetId = "db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20";
119+
const currency = "INR";
120+
const url = `https://api.spacescan.io/cat/catprice/${assetId}?currency=${currency}`;
121+
122+
fetch(url)
123+
.then(response => response.json())
124+
.then(data => console.log(data))
125+
.catch(error => console.error('Error:', error));
126+
</CodeBlock>
127+
</TabItem>
128+
<TabItem value="testnet" label="Testnet">
129+
<CodeBlock language="javascript">
130+
const assetId = "db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20";
131+
const currency = "INR";
132+
const url = `https://api-testnet11.spacescan.io/cat/catprice/${assetId}?currency=${currency}`;
133+
134+
fetch(url)
135+
.then(response => response.json())
136+
.then(data => console.log(data))
137+
.catch(error => console.error('Error:', error));
138+
</CodeBlock>
139+
</TabItem>
140+
</Tabs>
141+
</TabItem>
142+
</Tabs>
143+
144+
### Response
145+
146+
<Tabs>
147+
<TabItem value="mainnet" label="Mainnet">
148+
<ApiCallExample endpoint="https://api.spacescan.io/cat/catprice/db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20?currency=INR" />
149+
</TabItem>
150+
<TabItem value="testnet" label="Testnet">
151+
<ApiCallExample endpoint="https://api-testnet11.spacescan.io/cat/catprice/db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20?currency=INR" />
152+
</TabItem>
153+
</Tabs>
154+
155+
### Response Schema
156+
157+
| Field | Type | Description |
158+
|--------------|---------|-------------------------------------------------------|
159+
| status | string | The status of the API request |
160+
| amount_price | number | Current price in the requested currency |
161+
| xch_price | string | Current price in XCH |
162+
163+
### Error Responses
164+
165+
| HTTP Status Code | Meaning |
166+
|------------------|-------------------------------------------------------------------------------------------|
167+
| 400 | Bad Request -- Your request is invalid or unsupported currency. |
168+
| 404 | Not Found -- The specified CAT could not be found. |
169+
| 429 | Too Many Requests -- You're requesting too many times! Slow down! |
170+
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
171+
| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |

0 commit comments

Comments
 (0)