Python을 사용하여 FTX에서 NFT 가격 추적
이 기간 동안
ChickenTribe #0
가 판매 목록에 있었지만 구매를 클릭하면 오류가 반환되었습니다. 프로그래밍 방식으로 판매하고 구매할 수 있을 때까지 핑하는 API를 만들어 보자고 생각했습니다. 제가 놀랐던 점은 API을 통해 FTX에 전화를 걸고 받은 데이터에 따라 조치를 취하는 것이 얼마나 쉬운지였습니다.특정 NFT에 대한 정보를 얻으려면 다음 파이썬 프로그램을 작성하고 실행하기만 하면 됩니다.
import requests
import json
while True:
try:
data = requests.get('https://ftx.us/api/nft/nft/485223445421518089').json()
result = data['result']
result_formatted = json.dumps(result, indent=2)
print(result_formatted)
break
except Exception as e:
print(f'Error obtaining NFT data: {e}')
이것은 다음을 반환합니다.
{
"id": "485223445421518089",
"name": "ChickenTribe #0",
"description": null,
"issuer": "ChickenTribe",
"collection": "ChickenTribe",
"series": "ChickenTribe",
"solMintAddress": "Du7roiVM8VzX6GFiQLYePcp1fLnkDhxWdFeQN4GMpAQF",
"ethContractAddress": null,
"imageUrl": "https://www.arweave.net/FnSVZj95IP0uYpU0mcHVr3TPUvCewxwTNgCQ1Ff6Xjc?ext=png",
"videoUrl": null,
"animationUrl": null,
"thumbnailUrl": null,
"attributes": {
"Backgrounds": "Rust Red",
"Bodies": "Fall",
"Heads": "Ruby",
"Faces": "Lava",
"Combs": "Basic Purple",
"Eyes": "None",
"Accessories": "None",
"Smokes": "None"
},
"attributesList": [
{
"value": "Rust Red",
"trait_type": "Backgrounds"
},
],
"number": "0",
"totalQuantity": null,
"redeemable": false,
"redeemed": false,
"offerPrice": null,
"donation": false,
"status": "approved",
"needsListingFee": false,
"featured": false,
"created_at": "2021-10-29T15:42:44.431599+00:00",
"createdAt": "2021-10-29T15:42:44.431599+00:00",
"quoteCurrency": "SOL",
"auction": null,
"depositMethods": [],
"withdrawalMethods": [
"sol"
],
"totalSellerFeeRate": 0.07,
"royaltyFeeRate": 0.05
}
nft/nft/{$id}는 처음에는 혼란스러울 수 있습니다. 모든 nft를 가져오려면 nft/nfts를 호출하고 결과를 반복하면 됩니다.
while True:
try:
data = requests.get('https://ftx.us/api/nft/nfts').json()
result = data['result']
for nft in result:
result_formatted = json.dumps(nft, indent=2)
print(result_formatted)
break
except Exception as e:
print(f'Error obtaining NFT data: {e}')
컴퓨터에서 파이썬 코드를 실행한 적이 없다면 Google Collab을 추천합니다. 다음은 위의 코드가 있는 link to a worksheet입니다. 각 셀을 순서대로 개별적으로 실행해야 합니다.
여기에서 FTX에 가입하세요
향후 튜토리얼에서 보고 싶은 내용을 알려주세요. 다음 자습서에서는 검색한 데이터에 대해 조치를 취하는 인증을 다룰 것입니다.
If you found this helpful, consider sending a tip to the author.
2vta8S9QJEeZSRTXxR5eL3tfpFVbHhRAKMnQmQeCBKAV
Reference
이 문제에 관하여(Python을 사용하여 FTX에서 NFT 가격 추적), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/apollotoday/using-python-to-track-nft-prices-on-ftx-1h3n텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)