Created
January 5, 2022 01:17
-
-
Save mike-weiner/7b1bb938f12575daee525fd2079d51b0 to your computer and use it in GitHub Desktop.
A Python script to utilize the OpenSea API to get all available information on a single asset listed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
# https://opensea.io/assets/<your-asset-contract-address>/<your-token-id> | |
ASSETCONTRACTADDRESS = "<your-asset-contract-address>" # Replace with your Asset Contract Address | |
TOKENID = "<your-token-id>" # Replace with your Token ID | |
# Construct URL for OpenSea API to make GET call | |
url = "https://api.opensea.io/api/v1/asset/" + ASSETCONTRACTADDRESS + "/" + TOKENID + "/" | |
response = requests.request("GET", url) | |
print(json.dumps(json.loads(response.text), indent=4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Review https://docs.opensea.io/reference/retrieving-a-single-asset for more information.