All URIs are relative to https://api.blockchainapi.com/v1
Method | HTTP request | Description |
---|---|---|
SolanaCreateNFT | POST /solana/nft | Create an NFT on Solana |
SolanaGetNFT | GET /solana/nft/{network}/{mint_address} | Get an NFT's metadata |
SolanaGetNFTMintFee | GET /solana/nft/mint/fee | Get the NFT mint fee |
SolanaGetNFTOwner | GET /solana/nft/{network}/{mint_address}/owner | Get owner of an NFT |
SolanaGetNFTOwnerAdvanced | GET /solana/nft/{network}/{mint_address}/owner_advanced | Get owner of an NFT (advanced) |
SolanaGetNFTsCandyMachineId | POST /solana/nft/candy_machine_id | Get the ID of the candy machine of an NFT |
SolanaSearchNFTs | POST /solana/nft/search | Search NFTs on Solana |
NFT SolanaCreateNFT (NFTMintRequest nFTMintRequest = null)
Create an NFT on Solana
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/create-an-nft\" target="_blank">See examples (Python, JavaScript). Create a Metaplex NFT on Solana. Read more on this <a href="https://blog.blockchainapi.com/2021/11/16/a-note-on-nfts.html\" target="_blank">here. Note: Please see <a href="https://blog.blockchainapi.com/2022/01/18/how-to-format-off-chain-nft-metadata.html\" target="_blank">this article to learn more about what nft_upload_method
means and how storing the metadata of an NFT works. If you're using nft_upload_method = \"LINK\"
, then to add attributes to the NFT or an image, add them to a JSON file and upload that to Arweave/IPFS/Filecoin. See the JSON format <a href="https://blog.blockchainapi.com/2022/01/18/how-to-format-off-chain-nft-metadata.html\">here. Then supply the link to the JSON file in nft_url
. NOTE: Don't use nft_metadata
. Values provided here do not do anything at the moment. We are fixing this soon. Cost: 5 Credits
(<a href="#section/Pricing">See Pricing)
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class SolanaCreateNFTExample
{
public static void Main()
{
Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
// Configure API key authorization: APIKeyID
Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
// Configure API key authorization: APISecretKey
Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");
var apiInstance = new SolanaNFTApi(Configuration.Default);
var nFTMintRequest = new NFTMintRequest(); // NFTMintRequest | (optional)
try
{
// Create an NFT on Solana
NFT result = apiInstance.SolanaCreateNFT(nFTMintRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SolanaNFTApi.SolanaCreateNFT: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
nFTMintRequest | NFTMintRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
400 | Bad request (check response message) | - |
401 | Invalid API key pair in headers | - |
402 | Payment required. Occurs when you run out of API requests. Upgrade <a href="https://dashboard.theblockchainapi.com/billing\" target="_blank">here</a>. | - |
414 | URI too long (the data you provided was too large [e.g., the metadata provided was 500kb]) | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
NFT SolanaGetNFT (string network, string mintAddress)
Get an NFT's metadata
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/get-nft-metadata\" target="_blank">See examples (Python, JavaScript). Get the metadata of an NFT. If you're looking for metadata such as attributes and others, you can retrieve them from the link in the URI field of the NFT metadata returned. See the example on the right. The URI is an Arweave URL. That contains the attributes and other information about the NFT. That URL is stored on the Solana blockchain. Cost: 0.25 Credit
(<a href="#section/Pricing">See Pricing)
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class SolanaGetNFTExample
{
public static void Main()
{
Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
// Configure API key authorization: APIKeyID
Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
// Configure API key authorization: APISecretKey
Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");
var apiInstance = new SolanaNFTApi(Configuration.Default);
var network = mainnet-beta; // string | The network ID
var mintAddress = EEr5yQpNXf7Bru6Rt5podx56HGW9CEehXqgRGh2wa71w; // string | The mint address of the NFT
try
{
// Get an NFT's metadata
NFT result = apiInstance.SolanaGetNFT(network, mintAddress);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SolanaNFTApi.SolanaGetNFT: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
network | string | The network ID | |
mintAddress | string | The mint address of the NFT |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
400 | Bad request (check response message) | - |
401 | Invalid API key pair in headers | - |
402 | Payment required. Occurs when you run out of API requests. Upgrade <a href="https://dashboard.theblockchainapi.com/billing\" target="_blank">here</a>. | - |
404 | The doesn't exist | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
NFTMintFee SolanaGetNFTMintFee ()
Get the NFT mint fee
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/get-nft-mint-fee\" target="_blank">See examples (Python, JavaScript). Get the estimated fee for minting an NFT on the Solana blockchain using the Metaplex protocol. Cost: 0 Credit
(Free) (<a href="#section/Pricing">See Pricing)
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class SolanaGetNFTMintFeeExample
{
public static void Main()
{
Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
// Configure API key authorization: APIKeyID
Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
// Configure API key authorization: APISecretKey
Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");
var apiInstance = new SolanaNFTApi(Configuration.Default);
try
{
// Get the NFT mint fee
NFTMintFee result = apiInstance.SolanaGetNFTMintFee();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SolanaNFTApi.SolanaGetNFTMintFee: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
401 | Invalid API key pair in headers | - |
402 | Payment required. Occurs when you run out of API requests. Upgrade <a href="https://dashboard.theblockchainapi.com/billing\" target="_blank">here</a>. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
NFTOwnerResponse SolanaGetNFTOwner (string network, string mintAddress)
Get owner of an NFT
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/get-nft-owner\" target="_blank">See examples (Python, JavaScript). Get the owner of an NFT. This returns the public key of the wallet that owns the associated token account that owns the NFT. If you want to get the associated token account that literally owns the NFT, derive the associated token account address from the public key returned and the NFT mint address using <a href="#operation/solanaDeriveAssociatedTokenAccountAddress">this endpoint. Cost: 0.25 Credit
(<a href="#section/Pricing">See Pricing)
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class SolanaGetNFTOwnerExample
{
public static void Main()
{
Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
// Configure API key authorization: APIKeyID
Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
// Configure API key authorization: APISecretKey
Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");
var apiInstance = new SolanaNFTApi(Configuration.Default);
var network = devnet; // string | The network ID
var mintAddress = 4zH3Rwm1QXdfTSUqsYmeUBY4QqQmQEXJVbv4ErSK736Q; // string | The mint address of the NFT
try
{
// Get owner of an NFT
NFTOwnerResponse result = apiInstance.SolanaGetNFTOwner(network, mintAddress);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SolanaNFTApi.SolanaGetNFTOwner: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
network | string | The network ID | |
mintAddress | string | The mint address of the NFT |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
400 | Bad request (check response message) | - |
401 | Invalid API key pair in headers | - |
402 | Payment required. Occurs when you run out of API requests. Upgrade <a href="https://dashboard.theblockchainapi.com/billing\" target="_blank">here</a>. | - |
404 | The doesn't exist | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
NFTOwnerAdvancedResponse SolanaGetNFTOwnerAdvanced (string network, string mintAddress)
Get owner of an NFT (advanced)
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/get-nft-owner\" target="_blank">See examples (Python, JavaScript). Get the owner, state, listed price, and listed marketplace (if any) of an NFT. Here's are a couple of example responses: { 'contract': { 'contract_blockchain_identifier': 'M2mx93ekt1fmXSVkTrUL9xVFHkmME8HTUi5Cyc5aF7K', 'contract_id': 'magic-eden-v2', 'contract_name': 'Magic Eden v2', 'contract_type': 'marketplace' }, 'owner': '25UJMR3FiMM6noQtPEaCJ6eDU2YQ7myDhikVQXmMuSRW', 'price': 50000000, 'state': 'listing' }
{ 'contract': null, 'owner': 'C37PJiJU8WTgoUoFqmB1Maw8hkuENDZoGDQA1pm54Fdd', 'price': null, 'state': 'holding' }
This function will return whether the NFT is listed
, loaned
(Yawww NFT loans), otc
, staked
, burned
, or held
. If listed, it will return the contract, the readable name of the contract (e.g., Magic Eden, OpenSea), the contract ID (if any; e.g., open-sea), the owner, and the listed price. From this, you can get the floor of a collection. We currently support Magic Eden (v1, v2), Exchange.Art (auction, singles), CoralCube, Solanart (v1, v2), Yawww Loans, Yawww OTC, OpenSea, Fractal, SolSea, and AlphaArt. If loaned, it will return the loan requester as the owner, the loan amount, and the loan contract. We only support the Yawww loaning contract. If listed on an OTC marketplace, it will return the same information as listed
. OTC is used to distinguish between marketplaces that respect royalties (OTC) and those that don't (normal ones). The only OTC
contract we track is Yawwww, at the moment. We do not yet track Solanart v3. If staked, it will return the owner and the staking contract public key. If burned, it will return the burner
as the owner
. If held, it will simply return the owner. If you want to get the literal owner, which may or may not be the same as the owner returned here, call the simplified get NFT owner function. For example, Bob might own the NFT, but if it is listed on Magic Eden, then the NFT is held in escrow and "owned" by Magic Eden. The simplified function will return Magic Eden as the owner (the literal owner). This advanced function will tell you the implied owner, which would be Bob. Cost: 1.0 Credit
(<a href="#section/Pricing">See Pricing)
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class SolanaGetNFTOwnerAdvancedExample
{
public static void Main()
{
Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
// Configure API key authorization: APIKeyID
Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
// Configure API key authorization: APISecretKey
Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");
var apiInstance = new SolanaNFTApi(Configuration.Default);
var network = devnet; // string | The network ID
var mintAddress = 4zH3Rwm1QXdfTSUqsYmeUBY4QqQmQEXJVbv4ErSK736Q; // string | The mint address of the NFT
try
{
// Get owner of an NFT (advanced)
NFTOwnerAdvancedResponse result = apiInstance.SolanaGetNFTOwnerAdvanced(network, mintAddress);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SolanaNFTApi.SolanaGetNFTOwnerAdvanced: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
network | string | The network ID | |
mintAddress | string | The mint address of the NFT |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
400 | Bad request (check response message) | - |
401 | Invalid API key pair in headers | - |
402 | Payment required. Occurs when you run out of API requests. Upgrade <a href="https://dashboard.theblockchainapi.com/billing\" target="_blank">here</a>. | - |
404 | The doesn't exist | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetCandyMachineIDResponse SolanaGetNFTsCandyMachineId (GetCandyMachineIDRequest getCandyMachineIDRequest = null)
Get the ID of the candy machine of an NFT
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/get-nft-candy-machine-id\" target="_blank">See examples (Python, JavaScript). Get the candy machine ID from where the NFT came, if any. NFTs can also be minted without a candy machine. It's also possible that we return "Not Found" when the NFT actually did come from a version of a candy machine. We check for the most popular versions of candy machine, but it is possible that someone creates their own candy machine version and mints NFTs from it. Cost: 1 Credit
(<a href="#section/Pricing">See Pricing)
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class SolanaGetNFTsCandyMachineIdExample
{
public static void Main()
{
Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
// Configure API key authorization: APIKeyID
Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
// Configure API key authorization: APISecretKey
Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");
var apiInstance = new SolanaNFTApi(Configuration.Default);
var getCandyMachineIDRequest = new GetCandyMachineIDRequest(); // GetCandyMachineIDRequest | (optional)
try
{
// Get the ID of the candy machine of an NFT
GetCandyMachineIDResponse result = apiInstance.SolanaGetNFTsCandyMachineId(getCandyMachineIDRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SolanaNFTApi.SolanaGetNFTsCandyMachineId: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
getCandyMachineIDRequest | GetCandyMachineIDRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
400 | Bad request (check response message) | - |
401 | Invalid API key pair in headers | - |
402 | Payment required. Occurs when you run out of API requests. Upgrade <a href="https://dashboard.theblockchainapi.com/billing\" target="_blank">here</a>. | - |
404 | Not found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<NFTSearchResponse> SolanaSearchNFTs (NFTSearchRequest nFTSearchRequest = null)
Search NFTs on Solana
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/search-nfts\" target="_blank">See examples (Python, JavaScript). With this endpoint, you can search for NFTs by their symbol, name of NFTs, uuid, configuration address, and update authority. The output is a list of NFTs that match your query. You can also provide multiple search clauses, such as the update authority (update_authority=\"G17UmNGnMJ851x3M1JXocgpft1afcYedjPuFpo1ohhCk\"
) and symbol begins with "Sol" (symbol=\"Sol\", symbol_search_method='begins_with'
). Cost: 1 Credit
(<a href="#section/Pricing">See Pricing)
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class SolanaSearchNFTsExample
{
public static void Main()
{
Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
// Configure API key authorization: APIKeyID
Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
// Configure API key authorization: APISecretKey
Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");
var apiInstance = new SolanaNFTApi(Configuration.Default);
var nFTSearchRequest = new NFTSearchRequest(); // NFTSearchRequest | (optional)
try
{
// Search NFTs on Solana
List<NFTSearchResponse> result = apiInstance.SolanaSearchNFTs(nFTSearchRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SolanaNFTApi.SolanaSearchNFTs: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
nFTSearchRequest | NFTSearchRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
400 | Bad request (check response message) | - |
401 | Invalid API key pair in headers | - |
402 | Payment required. Occurs when you run out of API requests. Upgrade <a href="https://dashboard.theblockchainapi.com/billing\" target="_blank">here</a>. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]