API Documentation

Find an example of token gating rules and check whether a given address is authorized to access specific areas.

Before you begin

Let's say a user has a minBalance of at least 11 aria on Mainnet or 13 on POA, then the strategy is authorized and the API function will return a result indicating that the user is authorized. If this user does not have the strategy requirements, then a result indicates that the user is not authorized.

Let's start ๐Ÿš€

Use the /strategies?addresses={addresses}.

๐Ÿ’ก

To interact with API, use the x-api-key โ†’ readme-api-key.

ParameterTypeMandatoryDescription
Query param - addressesStringโœ…Parameters automatically retrieved by the API corresponding to the Ethereum wallet addresses that are being checked for ERC-721 tokens. The specific addresses are listed in the addresses array for each test case.
strategiesObjectโœ…Body parameters โ†’ strategies to define.
nameStringโœ…Name of the strategy.
paramsObjectโœ…Parameters of the strategy.
minBalanceNumberโœ…Minimum owned tokens.
tokensObjectโœ…Tokensโ€™ network information:
โ†’ chainId
โ†’ network
โ†’ address
{
   "strategies":[
      [
         {
            "name":"erc-20-balance-of",
            "params":{
               "minBalance":"11",
               "tokens":[
                  {
                     "chainId":"1",
                     "networkId":"1",
                     "address":"0xedf6568618a00c6f0908bf7758a16f76b6e04af9"
                  }
               ]
            }
         }
      ],
      [
         {
            "name":"erc-20-balance-of",
            "params":{
               "minBalance":"13",
               "tokens":[
                  {
                     "chainId":"99",
                     "networkId":"1",
                     "address":"0x55d536e4d6c1993d8ef2e2a4ef77f02088419420"
                  }
               ]
            }
         }
      ]
   ]
}

Result:

httpCodeDescription
200Success and array of addresses is authorized.
200Success and array of addresses is unauthorized.
400Ethereum addresses are required.
400Strategy is required.
{
    "isAuthorized": true,
    "strategies": [
        [
            {
                "isAuthorized": false,
                "strategy": {
                    "name": "erc-20-balance-of",
                    "params": {
                        "minBalance": "11",
                        "tokens": [
                            {
                                "chainId": "1",
                                "networkId": "1",
                                "address": "0xedf6568618a00c6f0908bf7758a16f76b6e04af9"
                            }
                        ]
                    },
                    "addresses": [
                        "0x1383ddcf0aee4adb6402f5aaf47b327cbbd2bf2d",
                        "0xb261d59bc5b2ced5c000ecb23783f3054e5fc5d0"
                    ]
                },
                "message": "You have 0 ARIA20. You need a very little bit of ARIA20",
                "code": 1,
                "details": {
                    "decimals": "18",
                    "sumWithDecimals": "0",
                    "sum": "0",
                    "balances": [
                        {
                            "address": "0x1383ddcf0aee4adb6402f5aaf47b327cbbd2bf2d",
                            "balanceOf": "0",
                            "chainId": "1"
                        },
                        {
                            "address": "0xb261d59bc5b2ced5c000ecb23783f3054e5fc5d0",
                            "balanceOf": "0",
                            "chainId": "1"
                        }
                    ],
                    "minBalance": "few",
                    "minBalanceWithDecimals": "0.000000000000000011"
                },
                "enrichedInformations": {
                    "logo": "https://storage.googleapis.com/zapper-fi-assets/tokens/ethereum/0xedf6568618a00c6f0908bf7758a16f76b6e04af9.png",
                    "symbol": "ARIA20",
                    "name": "ARIANEE"
                }
            }
        ],
        [
            {
                "isAuthorized": true,
                "strategy": {
                    "name": "erc-20-balance-of",
                    "params": {
                        "minBalance": "13",
                        "tokens": [
                            {
                                "chainId": "99",
                                "networkId": "1",
                                "address": "0x55d536e4d6c1993d8ef2e2a4ef77f02088419420"
                            }
                        ]
                    },
                    "addresses": [
                        "0x1383ddcf0aee4adb6402f5aaf47b327cbbd2bf2d",
                        "0xb261d59bc5b2ced5c000ecb23783f3054e5fc5d0"
                    ]
                },
                "message": "You have 4 ARIA. You need a very little bit of ARIA",
                "code": 0,
                "details": {
                    "decimals": "18",
                    "sumWithDecimals": "4000000000000000000",
                    "sum": "4",
                    "balances": [
                        {
                            "address": "0x1383ddcf0aee4adb6402f5aaf47b327cbbd2bf2d",
                            "balanceOf": "0",
                            "chainId": "99"
                        },
                        {
                            "address": "0xb261d59bc5b2ced5c000ecb23783f3054e5fc5d0",
                            "balanceOf": "4000000000000000000",
                            "chainId": "99"
                        }
                    ],
                    "minBalance": "few",
                    "minBalanceWithDecimals": "0.000000000000000013"
                },
                "enrichedInformations": {
                    "logo": "https://raw.githubusercontent.com/Arianee/spkz-metadata/main/assets/default-icon.png",
                    "symbol": "ARIA",
                    "name": "ARIANEE"
                }
            }
        ]
    ],
    "owner": {
        "address": "none"
    }
}
{
    "isAuthorized": false,
    "strategies": [
        [
            {
                "isAuthorized": false,
                "strategy": {
                    "name": "erc-20-balance-of",
                    "params": {
                        "minBalance": "11",
                        "tokens": [
                            {
                                "chainId": "1",
                                "networkId": "1",
                                "address": "0xedf6568618a00c6f0908bf7758a16f76b6e04af9"
                            }
                        ]
                    },
                    "addresses": [
                        "0xb261d59bc5b2ced5c000ecb23783f3054e5fc6d0"
                    ]
                },
                "message": "You have 0 ARIA20. You need a very little bit of ARIA20",
                "code": 1,
                "details": {
                    "decimals": "18",
                    "sumWithDecimals": "0",
                    "sum": "0",
                    "balances": [
                        {
                            "address": "0xb261d59bc5b2ced5c000ecb23783f3054e5fc6d0",
                            "balanceOf": "0",
                            "chainId": "1"
                        }
                    ],
                    "minBalance": "few",
                    "minBalanceWithDecimals": "0.000000000000000011"
                },
                "enrichedInformations": {
                    "logo": "https://storage.googleapis.com/zapper-fi-assets/tokens/ethereum/0xedf6568618a00c6f0908bf7758a16f76b6e04af9.png",
                    "symbol": "ARIA20",
                    "name": "ARIANEE"
                }
            }
        ],
        [
            {
                "isAuthorized": false,
                "strategy": {
                    "name": "erc-20-balance-of",
                    "params": {
                        "minBalance": "13",
                        "tokens": [
                            {
                                "chainId": "99",
                                "networkId": "1",
                                "address": "0x55d536e4d6c1993d8ef2e2a4ef77f02088419420"
                            }
                        ]
                    },
                    "addresses": [
                        "0xb261d59bc5b2ced5c000ecb23783f3054e5fc6d0"
                    ]
                },
                "message": "You have 0 ARIA. You need a very little bit of ARIA",
                "code": 1,
                "details": {
                    "decimals": "18",
                    "sumWithDecimals": "0",
                    "sum": "0",
                    "balances": [
                        {
                            "address": "0xb261d59bc5b2ced5c000ecb23783f3054e5fc6d0",
                            "balanceOf": "0",
                            "chainId": "99"
                        }
                    ],
                    "minBalance": "few",
                    "minBalanceWithDecimals": "0.000000000000000013"
                },
                "enrichedInformations": {
                    "logo": "https://raw.githubusercontent.com/Arianee/spkz-metadata/main/assets/default-icon.png",
                    "symbol": "ARIA",
                    "name": "ARIANEE"
                }
            }
        ]
    ],
    "owner": {
        "address": "none"
    }
}
{
    "errors": [
        {
            "msg": "Invalid Ethereum address in addresses parameter",
            "param": "addresses",
            "location": "query"
        }
    ]
}
{
    "errors": [
        {
            "msg": "strategy must be a non-empty array",
            "param": "strategies",
            "location": "body"
        },
        {
            "msg": "strategy items must be arrays",
            "param": "strategies",
            "location": "body"
        }
    ]
}

Get your API key

๐Ÿ“ฉ

If you cannot interact with the API in the API Reference section, the rate limit may be reached. Contact us at [email protected]to get your own API key and get rid of the rate limit.