-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from spacescan-io/sabari
Added new changes
- Loading branch information
Showing
12 changed files
with
1,896 additions
and
1,076 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
import CodeBlock from '@theme/CodeBlock'; | ||
import ApiCallExample from '@site/src/components/ApiCallExample'; | ||
|
||
# Get DID Information | ||
|
||
This endpoint allows you to fetch detailed information about a specific DID (Decentralized Identifier). | ||
|
||
### Endpoint | ||
|
||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
|
||
``` | ||
GET https://api.spacescan.io/did/info/{did} | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
|
||
``` | ||
GET https://api-testnet11.spacescan.io/did/info/{did} | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
### Parameters | ||
|
||
| Parameter | Type | Description | | ||
|-----------|--------|-------------------------------------------------| | ||
| did | string | The Decentralized Identifier (DID) | | ||
|
||
:::info Free API | ||
Use `api.spacescan.io` for free tier access. See our [API Plans](https://spacescan.io/apis#plans) for rate limits and features. | ||
::: | ||
|
||
:::tip Pro API | ||
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. | ||
|
||
```bash | ||
curl -X GET "https://pro-api.spacescan.io/did/info/{did}" \ | ||
-H "x-api-key: YOUR_API_KEY" | ||
``` | ||
::: | ||
|
||
### Live API Test | ||
|
||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<a href="https://api.spacescan.io/did/info/did:chia:19qf3g9876t0rkq7tfdkc28cxfy424yzanea29rkzylq89kped9hq3q7wd2" target="_blank" rel="noopener noreferrer" className="api-test-button"> | ||
🚀 Test API in Browser | ||
</a> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<a href="https://api-testnet11.spacescan.io/did/info/did:chia:19qf3g9876t0rkq7tfdkc28cxfy424yzanea29rkzylq89kped9hq3q7wd2" target="_blank" rel="noopener noreferrer" className="api-test-button"> | ||
🚀 Test API in Browser | ||
</a> | ||
</TabItem> | ||
</Tabs> | ||
|
||
### Request Example | ||
|
||
<Tabs> | ||
<TabItem value="curl" label="cURL"> | ||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<CodeBlock language="bash"> | ||
curl -X GET "https://api.spacescan.io/did/info/did:chia:19qf3g9876t0rkq7tfdkc28cxfy424yzanea29rkzylq89kped9hq3q7wd2" | ||
</CodeBlock> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<CodeBlock language="bash"> | ||
curl -X GET "https://api-testnet11.spacescan.io/did/info/did:chia:19qf3g9876t0rkq7tfdkc28cxfy424yzanea29rkzylq89kped9hq3q7wd2" | ||
</CodeBlock> | ||
</TabItem> | ||
</Tabs> | ||
</TabItem> | ||
<TabItem value="python" label="Python"> | ||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<CodeBlock language="python"> | ||
import requests | ||
|
||
did = "did:chia:19qf3g9876t0rkq7tfdkc28cxfy424yzanea29rkzylq89kped9hq3q7wd2" | ||
url = f"https://api.spacescan.io/did/info/{did}" | ||
|
||
response = requests.get(url) | ||
data = response.json() | ||
print(data) | ||
</CodeBlock> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<CodeBlock language="python"> | ||
import requests | ||
|
||
did = "did:chia:19qf3g9876t0rkq7tfdkc28cxfy424yzanea29rkzylq89kped9hq3q7wd2" | ||
url = f"https://api-testnet11.spacescan.io/did/info/{did}" | ||
|
||
response = requests.get(url) | ||
data = response.json() | ||
print(data) | ||
</CodeBlock> | ||
</TabItem> | ||
</Tabs> | ||
</TabItem> | ||
<TabItem value="javascript" label="JavaScript"> | ||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<CodeBlock language="javascript"> | ||
const did = "did:chia:19qf3g9876t0rkq7tfdkc28cxfy424yzanea29rkzylq89kped9hq3q7wd2"; | ||
const url = `https://api.spacescan.io/did/info/${did}`; | ||
|
||
fetch(url) | ||
.then(response => response.json()) | ||
.then(data => console.log(data)) | ||
.catch(error => console.error('Error:', error)); | ||
</CodeBlock> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<CodeBlock language="javascript"> | ||
const did = "did:chia:19qf3g9876t0rkq7tfdkc28cxfy424yzanea29rkzylq89kped9hq3q7wd2"; | ||
const url = `https://api-testnet11.spacescan.io/did/info/${did}`; | ||
|
||
fetch(url) | ||
.then(response => response.json()) | ||
.then(data => console.log(data)) | ||
.catch(error => console.error('Error:', error)); | ||
</CodeBlock> | ||
</TabItem> | ||
</Tabs> | ||
</TabItem> | ||
</Tabs> | ||
|
||
### Response | ||
|
||
<Tabs> | ||
<TabItem value="mainnet" label="Mainnet"> | ||
<ApiCallExample endpoint="https://api.spacescan.io/did/info/did:chia:19qf3g9876t0rkq7tfdkc28cxfy424yzanea29rkzylq89kped9hq3q7wd2" /> | ||
</TabItem> | ||
<TabItem value="testnet" label="Testnet"> | ||
<ApiCallExample endpoint="https://api-testnet11.spacescan.io/did/info/did:chia:19qf3g9876t0rkq7tfdkc28cxfy424yzanea29rkzylq89kped9hq3q7wd2" /> | ||
</TabItem> | ||
</Tabs> | ||
|
||
### Response Schema | ||
|
||
| Field | Type | Description | | ||
|-------------------------|---------|-------------------------------------------------------| | ||
| status | string | The status of the API request | | ||
| data | object | The main data object | | ||
| data.did | object | DID information | | ||
| data.did.did | string | The DID identifier | | ||
| data.did.did_hex | string | Hexadecimal representation of the DID | | ||
| data.name | string | Name associated with the DID | | ||
| data.name_nft_id | string | NFT ID associated with the name (if any) | | ||
| data.name_service | string | Name service information | | ||
| data.expiry | string | Expiration date (if applicable) | | ||
| data.profile_url | string | URL to the profile image | | ||
| data.banner_url | string | URL to the banner image | | ||
| data.flagged | boolean | Whether the DID has been flagged | | ||
| data.social | object | Social media information | | ||
| data.bio | string | Biography or description | | ||
| data.collections_count | string | Number of NFT collections | | ||
| data.created_nft_count | string | Number of NFTs created | | ||
| data.owned_nft_count | number | Number of NFTs owned | | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.