All URIs are relative to https://api.blockchainapi.com/v1.
Method | HTTP request | Description |
---|---|---|
getTokenMetadata() | GET /{blockchain}/{network}/token/{token_blockchain_identifier} | Get a token's metadata |
listAllTokens() | GET /{blockchain}/{network}/all_tokens | List all tokens |
getTokenMetadata($blockchain, $network, $token_blockchain_identifier): \OpenAPI\Client\Model\TokenMetadataResponse
Get a token's metadata
<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/tokens/get-token-metadata\" target="_blank">See examples (Python, JavaScript) [Coming Soon]. Get the metadata of a token. Cost: 0.25 Credit
(<a href="#section/Pricing">See Pricing)
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: APIKeyID
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('APIKeyID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('APIKeyID', 'Bearer');
// Configure API key authorization: APISecretKey
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('APISecretKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('APISecretKey', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\TokenApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$blockchain = 'blockchain_example'; // string | The blockchain you want to use
$network = ropsten; // string | The network of the blockchain you selected - Solana: `devnet`, `mainnet-beta` - Ethereum: `ropsten`, `mainnet` Defaults when not provided (not applicable to path parameters): - Solana: `devnet` - Ethereum: `ropsten`
$token_blockchain_identifier = 'token_blockchain_identifier_example'; // string | The identifier of the token (e.g., `mint_address` on `Solana` or `token_address` on `Ethereum`)
try {
$result = $apiInstance->getTokenMetadata($blockchain, $network, $token_blockchain_identifier);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TokenApi->getTokenMetadata: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
blockchain | string | The blockchain you want to use | |
network | string | The network of the blockchain you selected - Solana: `devnet`, `mainnet-beta` - Ethereum: `ropsten`, `mainnet` Defaults when not provided (not applicable to path parameters): - Solana: `devnet` - Ethereum: `ropsten` | |
token_blockchain_identifier | string | The identifier of the token (e.g., `mint_address` on `Solana` or `token_address` on `Ethereum`) |
\OpenAPI\Client\Model\TokenMetadataResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listAllTokens($blockchain, $network): \OpenAPI\Client\Model\TokenMetadataResponse[]
List all tokens
<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/tokens/get-all-tokens\" target="_blank">See examples (Python, JavaScript) [Coming Soon]. List all tokens. Cost: 1 Credit
(<a href="#section/Pricing">See Pricing)
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: APIKeyID
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('APIKeyID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('APIKeyID', 'Bearer');
// Configure API key authorization: APISecretKey
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('APISecretKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('APISecretKey', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\TokenApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$blockchain = 'blockchain_example'; // string | The blockchain you want to use
$network = ropsten; // string | The network of the blockchain you selected - Solana: `devnet`, `mainnet-beta` - Ethereum: `ropsten`, `mainnet` Defaults when not provided (not applicable to path parameters): - Solana: `devnet` - Ethereum: `ropsten`
try {
$result = $apiInstance->listAllTokens($blockchain, $network);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TokenApi->listAllTokens: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
blockchain | string | The blockchain you want to use | |
network | string | The network of the blockchain you selected - Solana: `devnet`, `mainnet-beta` - Ethereum: `ropsten`, `mainnet` Defaults when not provided (not applicable to path parameters): - Solana: `devnet` - Ethereum: `ropsten` |
\OpenAPI\Client\Model\TokenMetadataResponse[]
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]