{"id":21247157,"url":"https://github.com/alchemyplatform/get-token-metadata","last_synced_at":"2025-09-04T16:50:30.290Z","repository":{"id":188545468,"uuid":"678952445","full_name":"alchemyplatform/get-token-metadata","owner":"alchemyplatform","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-15T19:20:16.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-15T05:13:59.352Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alchemyplatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-15T19:11:48.000Z","updated_at":"2025-01-10T11:43:26.000Z","dependencies_parsed_at":"2023-08-15T20:41:32.161Z","dependency_job_id":"e6f79c60-0de6-4873-afcc-8e3e9525e596","html_url":"https://github.com/alchemyplatform/get-token-metadata","commit_stats":null,"previous_names":["alchemyplatform/get-token-metadata"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alchemyplatform/get-token-metadata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fget-token-metadata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fget-token-metadata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fget-token-metadata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fget-token-metadata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alchemyplatform","download_url":"https://codeload.github.com/alchemyplatform/get-token-metadata/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fget-token-metadata/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273641574,"owners_count":25142246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T02:16:45.432Z","updated_at":"2025-09-04T16:50:30.225Z","avatar_url":"https://github.com/alchemyplatform.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Overview\nThis repository contains a JavaScript script that utilizes Alchemy's SDK to fetch the metadata for a specified token. The specific attributes below are printed, however, to see all fields of metadata refer to the [getTokenMetadata](https://alchemyenterprisegroup.readme.io/alchemy-docs/reference/alchemy-gettokenmetadata) endpoint:\n\n- Decimals\n- Logo\n- Name\n- Symbol\n\nIn this example, the script fetches the metadata for a Tether USDT coin, but you can change the token address you want to query on line 13.\n\n## Steps to Run\n\nBefore running the script, ensure that you have [Node.js](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm), and [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable) installed on your system. \n\nFollow these steps to run the script:\n\n1. Clone this repository to your local machine:\n`git clone https://github.com/alchemyplatform/get-token-metadata.git`\n\n\n2. Navigate to the project folder: `cd get-token-metadata`\n\n\n3. Install the Alchemy SDK and the `dotenv` package running either of the following commands:\n    - `yarn add alchemy-sdk dotenv`\n    - `npm i alchemy-sdk dotenv`\n  \n4. Open the `sample.env` file and update the value for the API Key to your own value and rename file to `.env`. If you don't have an Alchemy API Key yet you can [create one for free here](https://alchemy.com/?a=starter-code). Simply make an account and find the \"Access Keys\" section in the dashboard to generate your own key!\n\n5. Open `getMetadata.js` and update the value of the token address found within the main function on line 13 and to reflect the address that you will be querying to get metadata. \n\n\n6. Run the script in the terminal: `node getMetadata.js`\n\n\nBy following these steps, the script will execute and fetch the ERC-20 tokens owned by the specified address, printing out the desired fields to the console.\n\n\n## Frequently Used Options and Best Practices\nWhen working with the Alchemy SDK, there are several options and best practices that you can consider:\n\n### Pagination\nBy default, the request for tokens has a page size of 100. If you have a large number of tokens and want to retrieve all of them, you can implement pagination. Alchemy's API supports pagination using the `page` and `size` parameters. You can adjust the `size` parameter to specify the number of tokens to retrieve per page and use the `page` parameter to iterate through the pages of results.\n\n### Filtering and Excluding Tokens\nThe Alchemy API allows you to apply filters to your token requests. For example, you can exclude certain tokens based on specific criteria. The exact filtering options depend on the available fields and operators supported by Alchemy's API. Please refer to the linked API reference doc above for more information on how to apply filters to your requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemyplatform%2Fget-token-metadata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falchemyplatform%2Fget-token-metadata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemyplatform%2Fget-token-metadata/lists"}