Token API Quickstart
A new developer’s guide to using the Token API and getting token information. Query Token data using alchemy-web3 (recommended) or fetch.
How to Query the Token API
Alchemy SDK (Recommended)
Install the alchemy-sdk
module to easily interact with Alchemy APIs. We highly recommend the alchemy-sdk
for WebSocket support, retries, and more.
Check the Github repo here: https://github.com/alchemyplatform/alchemy-sdk-js
Installation
Run the following command to install alchemy-sdk
with npm
or yarn
Usage
And then paste the following code snippet into the file:
From your command line, you can execute the script with:
You should see output like this:
Node Fetch
node-fetch
is a lightweight, common module for making HTTP requests.
See the documentation for more info: https://www.npmjs.com/package/node-fetch
Installation
Run the following command to install node-fetch
with npm
or yarn
Usage
token-api-javascript-scripts/fetch-script.js at main · alchemyplatform/token-api-javascript-scripts
and then paste the following code snippet into the file to explore the getNFTs
method:=
From your command line, you can execute the script with:
Your output should look like the following: