Skip to content

Instantly share code, notes, and snippets.

@mike-weiner
Created January 5, 2022 01:17
Show Gist options
  • Save mike-weiner/7b1bb938f12575daee525fd2079d51b0 to your computer and use it in GitHub Desktop.
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.
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))
@mike-weiner
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment