Fetch Contract Details by Address
Guide on how to fetch contract details by contract address
Endpoint
GET https://rest-v1.ludo.ninja/contracts/{blockchain}/{contractAddress}
Path Parameters
blockchain ━ String, The blockchain in where the contract address exists on.
contractAddress ━ String, The contract address to fetch details from.
Query Parameters
tokenId ━ The tokenId of the NFT.
Returns a JSON object with the properties below
nfts ━ Array, An array of objects each containing the following fields
address ━ String, The contract address of the NFT.
tokenId ━ String, The token ID of the NFT.
blockchain ━ String, The blockchain of where the NFT contract address exists on.
name ━ String, The name of the NFT Collection.
originalUrls ━ Array, Urls that host the NFT data.
ownerAddresses ━ Array, The address that currently holds the NFT.
creatorsAddresses ━ Array, The address that has created the NFT Collection.
How to fetch all NFTs by collection using Ludo API
In this guide we will be looking into how to fetch the details of a contract by contract address, the endpoint requires 3 parameters values in order for the request to succeed and they are blockchain, contractAddress and tokenId.
We will be sending a request with the contract address we will be using below on the ethereum blockchain and the NFT token id
Contract Address
0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d
NFT Token ID
101
Below is an example of how to send a request to fetch all NFTs by an address using Ludo API
curl --request GET \
--url 'https://rest-v1.ludo.ninja/contracts/ethereum/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d?tokenId=101' \
--header 'accept: application/json'
const options = {method: 'GET', headers: {accept: 'application/json'}};
fetch('https://rest-v1.ludo.ninja/contracts/ethereum/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d?tokenId=101', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import requests
url = "https://rest-v1.ludo.ninja/contracts/ethereum/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d?tokenId=101"
headers = {"accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.text)
After a successful result you will get a response of the contract details that looks similar to below
{
"nfts": [
{
"address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
"tokenId": "101",
"blockchain": "ethereum",
"name": "BoredApeYachtClub",
"originalUrls": [
"ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/101"
],
"ownersAddresses": [
"0xE1f303C9CbD39ABc513bD812FD05516685f873C3"
],
"creatorsAddresses": [
"0x0000000000000000000000000000000000000000"
]
}
]
}
Updated almost 2 years ago