Passthrough Endpoint

The passthrough endpoint allows users to use the Unified API to call endpoints from our supported providers that may not be supported by the unified set of endpoints. Some of the supported providers have specialty endpoints that do not fit into any of the unified set of endpoints so this passthrough endpoints allows users to access them. The API keys registered through the Uniblock Dashboard will automatically be applied when making passthrough calls, with some additional work to be done for some providers:

  • Alchemy: Alchemy requires users to include their API key in the API call. Replace where the API key would be included with {{API_KEY}} and the Unified API will automatically inject the API key from the user’s project when making the API call to Alchemy.
    Eg. "path": "https://eth-mainnet.g.alchemy.com/nft/v3/*{{API_KEY}}*/getContractMetadata?contractAddress=0xe785E82358879F061BC3dcAC6f0444462D4b5330"

  • QuickNode: QuickNode treats the API key as the entire base URL so the path must be {{API_KEY}}, followed by the specific API endpoint the user wishes to call in the body.
    Eg. "path": "{{API_KEY}}"

    No additional work to be done for other providers. Learn more about these endpoints on the Passthrough page.

Code Example:

The code below is written in javascript/typescript using fetch().

const response = await fetch('http://api.uniblock.dev/uni/v1/passthrough', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-API-KEY': '<UNIBLOCK_API_KEY>',
      },
      body: JSON.stringify({
        service: 'Moralis',
        method: 'GET',
        path: 'https://deep-index.moralis.io/api/v2/0xcA3Da5102ED32A2b953ec97F2EE8Fde78b518E21/erc20/transfers?chain=mumbai',
      }),
    });

The response from the API call can then be accessed by calling response.json() or response.text().