Skip to main content
This endpoint allows you to retrieve a paginated list of tokens, including both fungible tokens and NFTs, with various filtering options.

Prerequisites

  • Valid API key with token read permissions
  • Understanding of pagination parameters

Request

curl -X GET "https://api.g2cplatform.com/v2/tokens?limit=20&offset=0&tokenType=NFT" \
  -H "X-API-Key: your-api-key"

Query Parameters

ParameterTypeRequiredDescription
limitnumberNoMaximum number of tokens to return (default: 20, max: 100)
offsetnumberNoNumber of tokens to skip for pagination (default: 0)
walletAddressstringNoFilter by wallet address
tokenTypestringNoFilter by token type: “FUNGIBLE” or “NFT”
statusstringNoFilter by status: “active”, “transferred”, “all”
createdAfterstringNoFilter tokens created after date (ISO 8601)
createdBeforestringNoFilter tokens created before date (ISO 8601)
sortstringNoSort order: “createdAt:desc”, “createdAt:asc” (default: “createdAt:desc”)

Response

{
  "data": [
    {
      "tokenId": "token_abc123...",
      "tokenType": "NFT",
      "walletAddress": "0x1234567890abcdef...",
      "metadata": {
        "name": "Digital Certificate",
        "description": "Certificate of completion",
        "image": "https://example.com/certificate.png"
      },
      "blockchainTxId": "0xabcdef123456...",
      "status": "active",
      "createdAt": "2025-01-15T10:30:00Z"
    },
    {
      "tokenId": "token_def456...",
      "tokenType": "FUNGIBLE",
      "walletAddress": "0x9876543210fedcba...",
      "amount": 1000,
      "metadata": {
        "name": "Loyalty Points",
        "symbol": "LP"
      },
      "blockchainTxId": "0xfedcba654321...",
      "status": "active",
      "createdAt": "2025-01-15T09:15:00Z"
    }
  ],
  "pagination": {
    "total": 150,
    "limit": 20,
    "offset": 0,
    "hasNext": true,
    "hasPrevious": false
  }
}

Response Fields

FieldTypeDescription
dataarrayArray of token objects
paginationobjectPagination information

Token Object

FieldTypeDescription
tokenIdstringUnique token identifier
tokenTypestringToken type: “FUNGIBLE” or “NFT”
walletAddressstringCurrent owner wallet address
metadataobjectToken metadata
amountnumberToken amount (for fungible tokens)
blockchainTxIdstringBlockchain transaction hash
statusstringToken status
createdAtstringISO 8601 timestamp of creation

Pagination Object

FieldTypeDescription
totalnumberTotal number of tokens matching criteria
limitnumberCurrent page size
offsetnumberCurrent offset
hasNextbooleanWhether more pages are available
hasPreviousbooleanWhether previous pages exist

Examples

List All Tokens

GET /tokens?limit=50&offset=0

List NFTs for Specific Wallet

GET /tokens?walletAddress=0x1234567890abcdef...&tokenType=NFT

List Recent Tokens

GET /tokens?createdAfter=2025-01-01T00:00:00Z&sort=createdAt:desc

List Fungible Tokens Only

GET /tokens?tokenType=FUNGIBLE&limit=100

Error Responses

Status CodeDescription
400Invalid query parameters
401Unauthorized - invalid API key
403Insufficient permissions
500Internal server error

Pagination Best Practices

  • Use limit to control page size (recommended: 20-50 items)
  • Use offset to navigate through pages
  • Check hasNext before requesting the next page
  • Consider using date filters for better performance on large datasets