This command is in CURL
{
"id": 1,
"jsonrpc": "2.0",
"method": "alchemy_getAssetTransfers",
"params": [
{
"fromBlock": "0x0",
"toBlock": "latest",
"toAddress": "0x4761d7306ffd97b64a72d1007189b5ca799c6eea",
"withMetadata": false,
"excludeZeroValue": true,
"maxCount": "0x3e8",
"category": [
"external"
]
This command is in Python
import requests
# Alchemy API endpoint and API key
url = "[Link]
# Headers
headers = {
"accept": "application/json",
"content-type": "application/json"
}
# Request payload
payload = {
"id": 1,
"jsonrpc": "2.0",
"method": "alchemy_getAssetTransfers",
"params": [
{
"fromBlock": "0x0",
"toBlock": "latest",
"toAddress": "0x4761d7306ffd97b64a72d1007189b5ca799c6eea",
"withMetadata": False,
"excludeZeroValue": True,
"maxCount": "0x3e8",
"category": [
"external"
]
}
]
}
# Make the POST request
response = [Link](url, headers=headers, json=payload)
# Print the response
if response.status_code == 200:
print([Link]())
else:
print(f"Error: {response.status_code}, {[Link]}")